Forum rules - please read before posting.

Wait action while paused

I have a container menu that, when opened, pauses the game. This is intended (I don't want anything else to happen while the player is interacting with the menu). The issue is that my examine item actionlists generally run a narration line that describes the item. It works very well when the game is unpaused, but obviously not when it's paused.

I was initially going to ask if there was a way to run some (and only some) speech lines while the game was paused. That sounded more complicated than it had to be though, so I duplicated my narration menu, named it "paused narration", set it to a manual appear type, and changed the label from "dialogue line" to "global variable". After that, I changed the item's examine actionlist to set the variable to the text I wanted to display > turn menu on > wait 2 seconds > turn menu off.

As long as "wait until finish?" is unchecked, the menu actions run just fine, but the wait action freezes when the game is paused (which is a good thing in most other situations).

It's my understanding that the wait action depends on Time.timeScale, and that's why it freezes when the game pauses. Would it be possible for the action to have a checkbox (unchecked by default) that allowed it to use Time.unscaledTime instead? It'd allow for a lot more flexibility when designing menu behaviour. Another example of where this would be useful: creating a loop to increase a variable over time up to a given value, where the variable is linked via script to a postprocessing effect (allowing for a smooth depth of field or colour change).

Comments

  • It's my understanding that the wait action depends on Time.timeScale

    It's actually the ActionList itself that checks for Time updates - but the ActionList should check for real-time as opposed to un-paused time so long as:

    • It's an ActionList asset
    • "When running" is set to "Pause Gameplay"
    • "Unfreeze 'Pause' menus?" is unchecked
    • A Menu that pauses the game is currently enabled

    Are each of these conditions met?

    Another example of where this would be useful: creating a loop to increase a variable over time up to a given value

    This should be possible via the Timers system, introduced in 1.76.1.

  • Ah, my mistake! I was under the impression the Pause Gameplay option was just for when you wanted the actionlist to pause gameplay while it ran, and that it wouldn't make a difference if the game was already paused by a menu. I get it now. Thanks!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.