How do I pause an specific set of events?

0 favourites
  • 10 posts
From the Asset Store
Publish and Subscribe to events in event sheets and from the scripting interface
  • For my game I've created a family for objects I want to set the timescale to 0 whenever the game is paused and such, because setting the project's time scale would also affect the pause menu. However, by doing this, events are also not paused, and some enemies' attacks are therefore not paused and the player can get damaged (making the player immune is not a solution because the enemies continuing to attack also means other problems that are not relevant to explain here). So, can I pause a specific set of events? Not stop and then restart them, but pause and then resume them.

  • Events are not paused when you set timescale to 0.

    The easiest solution is to add this condition to all such events:

    System Compare Two Values: timescale>0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If possible, you can also put them in a group and disable/enable the group as needed to "pause" them.

  • Yeah but, as I said, this would only stop the events and later start them over. I want to pause and resume them for if I'm running a loop, for example, I want it to continue from where it was.

  • Events are not paused when you set timescale to 0.

    The easiest solution is to add this condition to all such events:

    System Compare Two Values: timescale>0

    Isn't debug mode's pause just setting timescale to 0? I'm pretty sure it pauses wait actions, for loops, etc.

  • No, debug mode pause is different.

    Settings timescale to 0 pauses all behaviors, animations etc. But events still run on every tick. Otherwise how would you control the game while timescale=0?

  • system timescale pauses waits, fors, and etc tho

  • It pauses waits and events like "Every X seconds". It doesn't pause most other events, loops, triggers.

  • For a loop, use an instance variable to keep track of progress (loopindex), to resume from later.

  • I solved it by using the timer property so everything that uses time pauses when the object's timescale is 0.

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