Forum rules - please read before posting.

Play dialogue during pausing

Hi

I would like to know if there is a possible way to use dialogue: Play speech while the game is paused and be able to use the feature "Display Narration Forever until user skips it"

So it would be like the following: Pause > Play speech (press button to skip) > Unpause.

Also, is there another way to pause the game then using a menu? I certainly can't use change timescale to 0 as AC wont let me.

Comments

  • I would like to know if there is a possible way to use dialogue: Play speech while the game is paused and be able to use the feature "Display Narration Forever until user skips it"

    Not currently, but I will look to see if it's possible to allow this via custom script.

    Also, is there another way to pause the game then using a menu?

    The StateHandler script's EnforcePauseMode property can be set through script to handle this.

    AC.KickStarter.stateHandler.EnforcePauseMode = true;
    
  • Not currently, but I will look to see if it's possible to allow this via custom script.

    Thanks. I appreciate your constant support.

    The StateHandler script's EnforcePauseMode property can be set through script to handle this.

    Can't we use change timescale and set it to 0? or would that cause issues?

  • Can't we use change timescale and set it to 0? or would that cause issues?

    When AC switches state (i.e. from Paused to Normal, and vice-vera), it'll update the timescale as well.

    The "gameplay" timescale can be set with PlayerInput's SetTimeScale function - but currently this only accepts non-zero values. I could consider removing this restriction, but I'd need to know more about your situation.

  • By pausing the game (setting the timescale to zero), I can temporarily freeze all enemy behavior and other ongoing gameplay mechanics. Once the dialogue or interaction is completed, I would unpause the game by resetting the timescale to its original value. I chose this approach to avoids any issues with the player being attacked or interrupted during interaction.

    Kinda like classic resident evil games where you inspect something and everything freezes.

  • This should be doable with the EnforcePauseMode property, but as the Engine: Change Timescale Action already limits non-zero values, I'll allow zero to be set in this property through script.

  • That would be very helpful, but the dialogue and wait action would not work if time scale is set to zero, right?

  • ActionList assets will run when the game is paused if Unfreeze 'Pause' menus? is unchecked. I'll give it a test and see.

  • Yes, should be doable. You'd need to make sure your Menu is on at the time, and use a simple custom script to have the speech ignore the timescale, but once done it will play while paused.

  • Would you be able to help me with creating such a script or guide me in implementing this feature? Not sure where to begin

  • For the ActionTimescale script I replace

    else { LogWarning ("Cannot set timescale to zero!"); }

    With

    KickStarter.playerInput.SetTimeScale(timeScale, affectFixedDeltaTime);

    But nothing actually happens .

  • To set the Timescale to zero:

    AC.KickStarter.playerInput.SetTimeScale (0f, true);
    

    I recommend instead useing the EnforcePauseMode property, however.

    To have Speech to play while paused:

    void Update ()
    {
        var speech = AC.KickStarter.dialog.GetLatestSpeech ();
        if (speech != null) speech.useUnscaledTime = true;
    }
    

    (This isn't optimal, but will be enough for testing)

    The Menu will need to be enabled at the time for it to display the speech. A quick way to test is to set its Appear type to Manual and have it enabled on start.

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.