When using a function, if there is any 'wait' statement within the function, the parameters get wiped.
Attach a Capx
https://drive.google.com/file/d/0B3O5N3 ... sp=sharing
Description of Capx
Run the capx, and upon launching it will show an alert with the parameter 0 which is set to "Test" ... it waits for one frame, then shows it again... this time it's wiped.
I'm pretty sure the parameters shouldn't get wiped... maybe by design?
Operating System and Service Pack
Windows 10 64bit
Construct 2 Version ID
Latest - 231
Action wait will hang the remain events, then the function returns ( pop function stack, so parameters was gone )
Closing as by design. After the function call ends, the parameters are no longer available. It's like trying to access the function parameters in the next event - you're not in a function call any more.
A workaround solution is
1. create an official array object at function start
2. storing current parameters into this array object
3. this array object will be keep after action:wait.
4. get parameter value from this array object.
5. remember destroy this array object while leave function.
Here is my plugin to wrap these actions into an action.
Develop games in your browser. Powerful, performant & highly capable.
Besides that this solution is perfect, i cringe by the idea of encouraging the use of 'wait'.
Using 'wait' brings you for kinda sure to the forum for help.