Clarification needed: event order after loops

Discussion and feedback on Construct 2

Post » Thu Sep 05, 2013 7:13 pm

Hi, I just want clarification on event order in the case of events that follow a loop. If you have an event just after a loop, does it only run when the loop has completed for that frame? Or does it run the same frame that the loop began?

For example, in this case, will the "trigger once" event ONLY run when "SomeLoop" has completed?



B
11
S
2
Posts: 87
Reputation: 1,112

Post » Thu Sep 05, 2013 7:28 pm

The loop completes in single tick, and after that TestVar is set to 0 in that same tick.
B
24
S
9
G
7
Posts: 756
Reputation: 7,312

Post » Thu Sep 05, 2013 8:00 pm

Thanks!
B
11
S
2
Posts: 87
Reputation: 1,112

Post » Thu Sep 05, 2013 8:00 pm

And the 'trigger once' doesn't do anything there / is unnecessary.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,680

Post » Thu Sep 05, 2013 10:05 pm

I realize that, but it was just for a structure example, not a functional example.

In a real case it would be for wanting to perform an action when you are assured that the loop has finished, so for example if you were looping through something to initialize a bunch of things, and then wanted to do an action only when you were certain everything had been initialized.
B
11
S
2
Posts: 87
Reputation: 1,112


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests