Triggers

Discussion and feedback on Construct 2

Post » Fri May 29, 2015 5:05 am

If my understanding is correct, event sheets are run top down. If objects are destroyed, it will not be effectuated before the end of a tick. This means that you can't rely on stuff like object.count within the same tick. This is not a problem (one might argue though, that it would be more logical if the object.count variable was updated instantly, but of course you can always update your own variable).

What seems odd to me, is that the destruction of objects in triggered events, seem to happen instantly, even if the user action cause triggers to fire multiple at places in the event sheets, resulting in a stack of triggered events.

Below link is a capx with a very simple example. Description: If green sprite is clicked, it triggers a mouse click event, and +1 is added to a variable. Press 'b' to spawn a blue sprite at mouse position. If blue sprite is clicked it is destroyed. If blue sprite is clicked on top of green sprite, the green trigger event should't count a click, so a check is done to see if mouse is over green sprite. You switch the order of the 2 event sheet in the include, and it doesn't work.

https://drive.google.com/folderview?id=0B6WdU53eEV7Jflkya2t6UWhCQ2NNWldlLU1Va3RUWWowNUhMLTNlSk9Tc2Fyd2FvM3F0dmc&usp=sharing

I think synchronous triggered events should be handled like an event sheet more or less, meaning all the triggered events should be handled, and stuff like object destruction should happen afterwards, but before proceeding with other events. It is very difficult to order triggers in huge projects with many event sheets.

I'd welcome any deeper insight, since I'm no expert in the underlying engine.

Cheers,
thegrind
B
26
S
9
G
2
Posts: 78
Reputation: 2,524

Post » Fri May 29, 2015 6:40 am

Bumbing, since a flood of spam just hit after I posted :(
B
26
S
9
G
2
Posts: 78
Reputation: 2,524


Return to Construct 2 General

Who is online

Users browsing this forum: David181 and 10 guests