Issue with calling the same function multiple times with different parameters.

0 favourites
  • 8 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • So, as you can see, I have the same function but with different parameters called in startup, the layout four times. The thing is when I call it with the "6-second wait," the result is as shown below (Some context: the boxes are given physics properties and they drop from the green point one by one in a short intervels (loopindex), lastly the crown will be spwan, that is the idea). Below The result is exactly what I wanted.

    But the issue arises when I don't use the 6-second wait. If I remove the 6-second wait, the result is as shown below (it spawns everything except the crown).

    So, if I call a single function (instead of four) at a time at the start of the layout, it works great. However, when I call all the four functions at once (unless 6 sec wait is given), the issue arises. My question is, how can I make it work without the 6-second wait? I don't want to use this 6-second wait here.

    So what I'm doing wrong?

    Tagged:

  • Here is the project file

    easyupload.io/43vuxc

  • I hope I understand your purpose.

    I think this is the final result so the towers should grow parallel and at the same time.

    The number and speed should be adjusted and the height should be adjusted.

    I will take the liberty of suggesting a smooth tower growth, I like it.

    We can choose the height, speed of growth and position.

    To optimize the heaviest events I hid in a group that disconnects after the completion of growth.

    File

  • Hi igortyhon, I have to say you provided an amazing piece of code, thanks for that and your time, but

    I hope I understand your purpose.

    :( Sadly it is the polar opposite of what I am asking.

  • But anyway, I'm trying to make it work by looking at yours where you use "Wait for previous actions to complete" when calling the same function multiple times. I wonder why when I use this:

    -> System: Wait for previous actions to complete

    it's not working, but when you did it in your project, it works. I'm still wondering why. What's the issue with calling the same function multiple times with different parameters?

    Is it a bug with the function, or am I doing something wrong? Or is the issue occurring because there is a repeat thing going on inside the function?

  • I've also noticed something: if I change the "Z" local variable from normal to static and vice versa, the behavior suddenly changes. However, it still doesn't work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ....

    Is it a bug with the function, or am I doing something wrong? Or is the issue occurring because there is a repeat thing going on inside the function?

    - No, it's not a glitch, it's just that my function is executed instantly, it just sets the spawning parameters, and then the code inside the group runs continuously until it is executed and disables the group itself.

    - And you just use the glitch when you add lupindex to the wait. And your function is executed for several seconds.

    Unfortunately, I didn't see your post with an example and didn't understand that you want to throw cubes from above.

    I redid the example, now it throws cubes. There is a function that sets the parameters of who spawns and how many and there is a block that is responsible for spawning.File

    - Remember in Construct3 all functions are executed instantly.

  • I redid the example, now it throws cubes. There is a function that sets the parameters of who spawns and how many and there is a block that is responsible for spawning.File

    It is so generous of you to redo that. Peoples like you play a pivotal role in the community's prosperity. Thank you so much for your time.

    - Remember in Construct3 all functions are executed instantly.

    Got it. 👍

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