Forum rules - please read before posting.

Hiding Narration Speech Menu using WASD

edited September 2024 in Technical Q&A

I use AC 1.79.1
3d Direct
Mouse and Keyboard control.

I am looking for a way to help my narrations feel smooth.
At the moment when narration starts game stops and player should click to continue and finish/quit narration.
But i am looking for a way to Stop the game show the narration but at the end instead of only clicking, the user can just press any key or At least WASD and move without wasting a click for my dumb Narrator.
Any thoughts or Hints on this? I use Unity UI Prefab

Comments

  • edited September 2024

    The SkipSpeech input can be used to skip speech - this can be simulated through script to have it work with any key, and only when narration is being spoken:

    using UnityEngine;
    using AC;
    
    public class SkipNarration : MonoBehaviour
    {
    
        void Start ()
        {
            KickStarter.playerInput.InputGetButtonDownDelegate = My_GetButtonDown;
        }
    
        bool My_GetButtonDown (string inputName)
        {
            try
            {
                if (inputName == "SkipSpeech")
                {
                    var speech = KickStarter.dialog.GetLatestSpeech ();
                    if (speech != null && speech.GetSpeakingCharacter () == null)
                    {
                        return Input.anyKeyDown;
                    }
                }
                return Input.GetButtonDown (inputName);
            }
            catch {}
            return false;
        }
    
    }
    
  • Thank You. Wondering what a wonderful man you are. <3
    Going to use it as soon as possible.
    Just where to attach this script Probabely to GameEngine itself? in all scenes?

  • I have tried to use The script.
    I attached it to GameEngine inside my frist scene where i wanted to use it primarily.
    I got errors asking me to make SkipSpeech Input. i made it
    Then asked me to define a ToggleCursor Button. ok i made it
    then Interaction.A button.... Then interaction.B button ....

    it is the last by now:
    ArgumentException: Input Button InteractionB is not setup. To change the input settings use: Edit -> Settings -> Input SkipNarration.My_GetButtonDown (System.String inputName) (at Assets/SkipNarration.cs:26) AC.PlayerInput.InputGetButtonDown (System.String axis, System.Boolean showError) (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:1884) AC.PlayerInput.UpdateInput () (at Assets/AdventureCreator/Scripts/Controls/PlayerInput.cs:341) AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:159)

    and in the scene The scene stays locked and Narration speech does not show up. no buttons work. even WASD or space are gone when script is attached to the GameEngine.

  • Try the updated script now.

    To use it, attach to an Empty prefab, then use the Events Editor's Scene: Switch: After event to run an Object: Add or remove Action that spawns it into each scene.

  • Thanks it works + I got aware of a new realm which is events editor. wow

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.