Why does "Function.Param()" change here? It breaks my game...

0 favourites
  • 6 posts
From the Asset Store
five golem elements Sprites Sheet.Best for enemy or villain game characters.
  • Hello,

    I'm currently out of nerves for thise one... After testing this out the whole day today, I finally managed to find the problem, but I have no clue why it even happens in the first place.

    I have a function, where I set a value based on a param, then wait, and then set that value again to something different.

    Weird thing is, that the function.param is changing... Isn't that completely impossible?

    Here is an image of the event:

    The first DebugText shows me "1", the second shows me "0". How on earth is that possible? It's not even possible to change function parameters. And even if that function would be called again, it should NOT influence this!

    Do you have any clue about it?

    Tagged:

  • The params only exist in the call.

    They are reset the next tick.

    Don't use wait.

  • newt

    Ugh, that explains a lot. And that's pretty unpractical... Guess I'll need to find a work around for that.

    Thank you!

  • FWIW, this is fixed with built-in functions in Construct 3. Function parameters are preserved across waits in that case.

  • Ashley

    Nice to know, maybe I will swap to Construct 3 someday. Do you know a good work around for saving the function.param in construct 2 after a "wait"?

    I need the function to be adaptive and be called quite frequently, so I can't just save it in a variable or an array I guess...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yep stick a variable, and a timer behavior on the text object.

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