Forum rules - please read before posting.

Script : Check if any speech is displayed

Hi everyone,

I have a script that run an actionlist every now and then, in this actionlist the player say something.

But if it happen when a speech UI is displayed (like when talking to a NPC) the player speech from the actionlist is launched anyway and the player speech is displayed at the same time as the current speech.

Is there a way in my script to check if any speech is displayed ?

I found AC.Dialog.IsAnySpeechPlaying, but I'm not sure how to use it in this case ^^'

Thanks for your help !

Comments

  • Welcome to the community, @Bricktop.

    The IsAnySpeechPlaying function can be used like this:

    if (AC.KickStarter.dialog.IsAnySpeechPlaying ())
    {
        //
    }
    

    (See the front page of the Scripting Guide for details on how to access AC component functions in custom scripts.)

    To check if a specific character is playing (for example, the Player), you can use:

    if (AC.KickStarter.dialog.CharacterIsSpeaking (AC.KickStarter.player)
    {
        //
    }
    

    Additionally, or alternatively, you may want to run your script-triggered ActionList only during gameplay - and not while a cutscene is running. To do this, you can check for:

    if (AC.KickStarter.stateHandler.IsInGameplay ())
    {
        //
    }
    
  • That's perfect ! l'll try that !
    Thank you :smile:

  • It work just like I need
    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.