wait() makes parameter disapears

Discussion and feedback on Construct 2

Post » Tue Mar 31, 2015 10:13 pm

I just spent all the day trying to understand why sometimes the function.param was not collecting the passed value and fortunatly i came to this topic!
Have to say that, since i was born with "basic" language, is really hard for me to get into construct 2 "wait"
It' s really important to me to use a wait command to have all the sprites, text and effects appear in the right sequence and timing.
If wait function won't work inside a function, how can be the right "timing" achieved? :)
B
6
S
1
Posts: 73
Reputation: 571

Post » Tue Mar 31, 2015 10:17 pm

Probably not best to use a function when timing is involved like this! Functions are supposed to be instantaneous - when you call them, they must finish before the processor moves on to anything else. Wait actions go against this. Just use regular events, or multiple spaced-out function calls.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,699

Post » Wed Apr 01, 2015 12:15 am

Create an array object under on function condition by action, I.e. Create at runtime, save parameters into this array to keep them.
When left function call, remember to destroy this array.

Edit
http://c2rexplugins.weebly.com/rex_fnparam2array.html
This plugin could help user to create and save all parameters into an array in an action.
B
109
S
27
G
277
Posts: 4,482
Reputation: 154,924

Post » Sun Apr 26, 2015 9:36 pm

Oh my... really sorry but i see this reply only now... do not know why! :O Maybe i was dunk :D
Thanks REX, i immediately try your plugin! (i'm already using the chess ones )
Seems you are the Wishmaster :)
B
6
S
1
Posts: 73
Reputation: 571

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 13 guests