System - Repeat X Times

Just started using Construct 2? Post your questions here

Post » Fri Aug 05, 2016 8:44 pm

Is System-Repeat every tick? How would I know that by reading the manual?

"Repeat
Simply repeat the event a given number of times. This tests any conditions following it on every repeat, and if those conditions are met also runs the actions and any sub-events on every repeat."

https://www.scirra.com/manual/124/system-conditions

It seems to be because it needs a condition to break the infinite loop, which is confirmed by debugger. The manual states it tests "any conditions", not that you have to have conditions to break the infinite loop. This caused me some time in testing initially because I couldn't figure out why it wasn't working and I didn't fully figure it out until I found other people's code examples and then a lot of testing.

Unless this is some general rule which was stated at the beginning of the manual that "everything is per system tick" unless stated otherwise.

From logic alone, one would think if you have repeat something x times, it should be repeated x times and that's it.
B
35
S
19
G
18
Posts: 242
Reputation: 12,732

Post » Fri Aug 05, 2016 8:49 pm

ImageImageImage
B
71
S
21
G
231
Posts: 3,688
Reputation: 129,352

Post » Fri Aug 05, 2016 8:58 pm

I read that section a zillion times before for other things.

"This means most system conditions do not pick any instances: they are either true or false. *If they are false the event stops running, otherwise the event continues* without the picked instances having been changed. "

Boy, that is really buried in there. :D

Unfortunately, I did not correlate the two. Maybe there should be some sort of preamble at the beginning of the System Conditions section of the manual?

That's what naturally comes up on Google search.
B
35
S
19
G
18
Posts: 242
Reputation: 12,732

Post » Sat Aug 06, 2016 12:17 am

The how events work page is probably the single most important page in the manual for beginners.

And it does state every event is checked once per tick pretty clearly.
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Sat Aug 06, 2016 1:07 am

To someone returning to Construct 2 after several years it wasn't obvious.

And that's an Events page, dealing with event structure.

System-Repeat is classified as an object in the Scirra manual.

So if someone's just returning and looks this up, a bit of transparency would've been helpful, especially when it seems counter-intuitive.

This is before I discovered Trigger - Once, mind you.
B
35
S
19
G
18
Posts: 242
Reputation: 12,732


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests