How to implement a loop guard properly?

I’m trying to do something in a blueprint, using a logic that works in any other language on Earth form ancient Greek to Ruby but that for some reason doesn’t work in blueprints. A simple loop guard. So what I do is the following:

  1. Create a global counter
  2. Every time the macro is executed the counter is increased by 1
  3. If the counter reaches a certain level, say 1,000, it prints a text (in my case it is “==== Failsafe loopguard ====”) and quits (as in, the printstring is directly connected to the quit game node)

Quite simple right? Then when I click ‘run’ the biomass hits the fan and this is what I find in the logs:

LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====
LogBlueprintUserMessages: [TestProto3x3_C_0] ==== Failsafe loopguard ====

thousands of times. So clearly it is fundamentally ignoring my quit node. What is very interesting though, which would also be funny if it wasn’t already past 10pm, is that when I just call the quit node directly through a key or something it actually quits the game. So there is a rat here somewhere and for the life of me I can’t figure out where it is.

Any illuminating insights would be incredibly appreciated. Also, other ways to implement this loopguard watchdog would be appreciated just as much.

Thanks all,
A

Sorry, I do have to bump this back up again. Does anyone know how to force quite execution? I absolutely, genuinely, desperately need to be able to get a loop to freaking stop the execution and avoid an infinite loop. For the avoidance of doubt here is the macro I’m using:

Thanks

I’m getting crash on Quit button when I run packaged project. Any idea?

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000000

msctf
msctf
msctf
msctf
msctf
msctf
msctf
imm32
imm32
msctf
msctf
msctf
imm32
imm32
Darkisher_Win64_Shipping!FWindowsApplication::~FWindowsApplication()
Darkisher_Win64_Shipping!FWindowsApplication::`vector deleting destructor'()
Darkisher_Win64_Shipping!FSlateApplication::Shutdown()
Darkisher_Win64_Shipping!FEngineLoop::Exit()
Darkisher_Win64_Shipping!GuardedMain()
Darkisher_Win64_Shipping!GuardedMainWrapper()
Darkisher_Win64_Shipping!WinMain()
Darkisher_Win64_Shipping!__scrt_common_main_seh() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
kernel32
ntdll