Wait for signal question

0 favourites
  • 4 posts
From the Asset Store
The official Scirra Multiplayer Signalling Server for helping peers find and connect to each other
  • I have a 'Wait for Signal' action inside a function. When I trigger the signal and return to the function I want to go to another layout which is defined by a parameter that was passed to that function. However, when I return after the signal the parameter seemingly is null. Before the 'Wait for Signal' the parameter is correct.

    I've tried storing the parameter in a local var too, but it gets set back to its default value when the signal is triggered.

    I tested this by placing a string variable before the 'Wait for...' and then after it.

    Is this to be expected? Do I really need to store the parameter to a global variable?

    Screenshot of the even:

    http://i1070.photobucket.com/albums/u490/EricThomasGames/Capture_zpsbnefgh2o.png[/img][/img]

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I think it's to be expected. A "wait" only saves the picked objects as far as I'm aware. Parameters aren't saved and I'm pretty sure local variables aren't either. One solution would be to right before the wait you create an object and save all the relevant info in it, then destroy it after the wait since we only need it saved temporarily.

  • As you suggested, eochranek, you need to save the parameter in a variable. But as you noticed, the variable is not kept either. The solution is to make the variable static (it's a checkbox when you create/edit the variable)

  • Thank you narFsnw! Setting to static was what I needed.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)