running sub events in sequence

Get help using Construct 2

Post » Fri Aug 23, 2013 10:57 pm

Sorry if this has already been posted in the forums, I don't mind it being delted.

I am wondering what is the best way to run sub events in sequence. Such that the second one starts after the first completes. I'm using sub events because they need to contain seperate conditions. This would be similar to using two if statements one after eachother in scripted code.

For example:



What I would want to happen is for the program to check the first sub events conditions (which there are none) then wait 1 second then change the text to "ONE" then immediately after run the second sub event checking its conditions (none here either) and then immediately change the text to "TWO"

Instead what happens is it changes it to "TWO", then waits 1 second and changes it to "ONE"

So it seems seperate sub events don't execute in sequence, which is good for most situations, but how do i do that?

Here is my proposed solution, and I think its the correct one that will allow seperate conditions to run in order.



If anyone thinks there is a better way please let me know.
B
4
Posts: 8
Reputation: 341

Post » Fri Aug 23, 2013 11:59 pm

How about
?
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,630

Post » Sat Aug 24, 2013 12:05 am

Or...
ImageImageImage
B
71
S
21
G
222
Posts: 3,652
Reputation: 124,733

Post » Sat Aug 24, 2013 12:14 am

well those would both work for the simplified example. but their still just running non sequential sub events.

[edit] yes blackhornet with your example the second sub event is forced to run after the first because its a sub event OF the first, but I want them both to be sub events of the main event. [/edit]

The reason I'm asking this question is what if I have a really complex operation that takes a few miliseconds to complete? The second sub event might begin before the first one completes. I was using the wait action to symbolize this.

I really think functions are the way to force sub events to execute in sequence.tjjoris2013-08-24 00:19:39
B
4
Posts: 8
Reputation: 341

Post » Sat Aug 24, 2013 12:25 am

You can't use Wait to simulate this. Wait spawns off and runs whatever is underneath IT in parallel. You should be fine with what you are doing. The sub events are sequential.
ImageImageImage
B
71
S
21
G
222
Posts: 3,652
Reputation: 124,733

Post » Sat Aug 24, 2013 12:53 am

OK thanks.
B
4
Posts: 8
Reputation: 341


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests