When is trigger actually run ? (at which order)

Discussion and feedback on Construct 2

Post » Fri May 11, 2012 9:20 am

I have a question about trigger,
when is trigger actually run ? or at which order ?

Let say my Event Sheet looks like this:[code]
Event A
Event B
Trigger 1
Event C
Event D[/code]

so what is the order when player doing "Trigger 1"

Is it at the beginning of frame ?
Trigger 1
Event A
Event B
Event C
Event D

Or is it at the end of each frame ?
Event A
Event B
Event C
Event D
Trigger 1


Or it could happen at any order ?
Event A
(Trigger 1)
Event B
(Trigger 1)
Event C
(Trigger 1)
Event D
(Trigger 1)

Or even run parallel with the regular event :P ?
Event A (Trigger 1)
Event B (Trigger 1)
Event C (Trigger 1)
Event D (Trigger 1)


Thanks a lot in advancePotato2012-05-11 09:23:50
B
34
S
13
G
8
Posts: 134
Reputation: 8,118

Post » Fri May 11, 2012 9:31 am

I'm confused what you mean by trigger?
B
55
S
12
G
8
Posts: 339
Reputation: 9,314

Post » Fri May 11, 2012 9:35 am

just a regular trigger, for example, player clicking on an object, pressing key, etc:

For example:


or

B
34
S
13
G
8
Posts: 134
Reputation: 8,118

Post » Fri May 11, 2012 11:08 am

It can happen at any time. Each trigger runs at the moment it is fired, which can be during an event (e.g. like when the Function object triggers an event from an action) or before/after the event sheet runs. I deliberately try not to say specifically when triggers fire, because it could also be different across browsers (for things like input triggers). The only example you gave which is never used is parallel: if a trigger fires during events (as in the function example again), the running of events is paused, the trigger runs, then it resumes from where it left off.

Is it important to you when a particular trigger fires?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri May 11, 2012 11:45 am

[QUOTE=Ashley]
Is it important to you when a particular trigger fires?[/QUOTE]

hehe.. not really I'm just curious, just trying to understand how C2 works and how the events flow.

thanks a lot Ashley.
B
34
S
13
G
8
Posts: 134
Reputation: 8,118


Return to Construct 2 General

Who is online

Users browsing this forum: randomly and 15 guests