How do I make an alternate event?

Get help using Construct 2

Post » Sun Apr 27, 2014 6:41 am

How I make an alternate event. (In my case I want my event to do an action every 1.5 seconds but this action will alternated to action 1 and action 2. So it will be like:
action 1--> Wait 1.5 seconds --> action 2 --> Wait 1.5 seconds (And then make a infinite loop)

I tried to make that way, but when I test it the local number doesn't change I think. Just the first action is playing...
So it's like: action 1--> Wait 1.5 seconds --> action1 --> Wait 1.5 seconds.... (infinite loop)

Image

PS: In my case Action 1 is the top event and action 2 is the bottom event.
B
7
S
2
Posts: 6
Reputation: 842

Post » Sun Apr 27, 2014 7:52 am

A similar example.
You do not have the required permissions to view the files attached to this post.
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882

Post » Sun Apr 27, 2014 2:35 pm

Thanks!! It works perfectly! But I don't understand why it only works when you toggle the static box in the Local Variable. What it do?

EDITED: Already found my answer : https://www.scirra.com/manual/55/event-variable

"The Static checkbox only applies to local variables. By default, local variables reset their value to the initial value every tick. However, if Static is checked, the local variable's value will persist permanently, like a global variable. Static local variables differ from global variables in that they can still only be used within their scope. Global variables always hold their values permanently so the Static option does not apply to them. For more information about local variables, see Event Variables." :D
Last edited by rafa25 on Sun Apr 27, 2014 2:52 pm, edited 1 time in total.
B
7
S
2
Posts: 6
Reputation: 842

Post » Sun Apr 27, 2014 2:49 pm

ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Sun Apr 27, 2014 2:53 pm

That's it! Thank you!
B
7
S
2
Posts: 6
Reputation: 842


Return to How do I....?

Who is online

Users browsing this forum: jbr190, valefor and 31 guests

cron