Hello everyone,
I created a for loop that looks like this:
https://i.imgur.com/S7RYfyh.png
My expectation with this is that the for loop will run, ends and then the empty condition-event will execute. Turns out that is not the case. It runs BEFORE the for loop ends.
Fine. So I do this:
https://i.imgur.com/lbVxbGA.png
Guess what, that code that checks if loopindex >= currentWaveEnemyCount? That doesn't run at all. So I put a "DebugText > Set Text to loopindex" inside the for loop to see what that brings. It is 0.
The weird thing is, in the game, the enemies spawn with 1 second wait time apart just like the for loop code says. But for some odd reason, loopindex is 0.
What gives?
Another similar thing. I have a repeat every X seconds event that looks like this:
https://i.imgur.com/07kUpz4.png
At first, the event didn't have so many "Call IncrementWaveCount" or "Add 1 to currentWaveID". It was only the highlighted part at the top. I thought that the repeat would happen, passes by all conditions firing the correct one and then firing the bottom highlighted section.
That doesn't happen. It loops 3 times without executing ANY of the conditions that check IDs and then on ID = 5 it works.
So I thought I'd force it to work, so I put at each condition the increment call + add 1 and then I removed the bottom highlighted part. I also included an empty event to run after the forloop to stop loop
Again, with the weirdness, the ID was incremented to 7 in an instant and ALL conditions were run.