Forum rules - please read before posting.

Menu button to override text skipping

edited January 2022 in Technical Q&A

Hi, so in cutscenes where characters are speaking and able to click to skip text, how do I enable a menus click to override text skipping? THe menu button is bottom right, so I only need the menus area click to override text skipping

see settings for menu:

https://www.dropbox.com/s/dhpdm4rj3ffb56s/menuclick.png?dl=0

Comments

  • Uncheck Can skip with mouse clicks? in the Speech Manager, set your Button's Click type to Simulate Input and set it to simulate the SkipSpeech button.

  • I cannot do this as the bitton runs an action list and the speech manager **Can skip with mouse clicks? **was already unchecked

    See screenshots:

    https://www.dropbox.com/sh/aj7gey0wu7bstlz/AADRG3A_8uPJMmLGb_RHwNWGa?dl=0

  • edited January 2022

    To skip speech at the same time you click a Button, regardless of click type:

    using UnityEngine;
    using AC;
    
    public class SkipSpeechOnMenuClick : MonoBehaviour
    {
    
        public string menuName = "OptionsInPlay";
        public string elementName = "OptionsButton";
    
        private void OnEnable () { EventManager.OnMenuElementClick += OnMenuElementClick; }
        private void OnDisable () { EventManager.OnMenuElementClick -= OnMenuElementClick; }
    
        private void OnMenuElementClick (AC.Menu menu, MenuElement element, int slot, int buttonPressed)
        {
            if (menu.title == menuName && element != null && element.title == elementName)
            {
                KickStarter.playerInput.SimulateInputButton ("SkipSpeech");
            }
        }
    
    }
    
  • ok great, and where do i put this?

  • In the scene.

  • I'm also getting this error:
    Assets/TMOWM/Scripts/SkipSpeechOnMenuClick.cs(11,62): error CS0123: No overload for 'OnMenuElementClick' matches delegate 'EventManager.Delegate_OnMenuTurnOn'

  • Typo. Edited the above - try again.

  • Sorry, still doesn't work, as soon as the dialogue starts playing, clicking on the menu just skips speech along. see video:

    https://www.dropbox.com/s/n8i78rsiya11wxe/SkipSpeech.mov?dl=0

  • clicking on the menu just skips speech along.

    That was the intent, as I understood it.

    By "override", do you mean bypass? As in, clicking on the screen anywhere except the menu, skips speech?

  • Sorry, yes! my bad!

  • using UnityEngine;
    using AC;
    
    public class SkipSpeechOnMenuClick : MonoBehaviour
    {
    
        private void Update ()
        {
            if (Input.GetMouseButtonDown (0) && !KickStarter.playerMenus.IsMouseOverMenu ())
            {
                KickStarter.playerInput.SimulateInputButton ("SkipSpeech");
            }
        }
    
    }
    
  • Sorry, i think we are confused on our communication here. My skip speech works fine in cutscenes, but I want the player to be able to click on the OptionsInPlay menu and be able to pause. But currently, clicking anywhere means that speech is skipped, therefore if the player tries to click on the OptionsInPlay menu (situated in bottom right of screen) rather than being able to open the menu, instead the click just skips speech. I need the player to be able to click on the menu and therefore open the menu rather than skip speech is speech is playing.

  • Have you tried the above? If Can skip with mouse clicks? is unchecked, it should cause speech to be skipped only if a mouse click is registered when not over a menu.

  • I did and it makes no difference. It is already unchecked. Clicking on the menu just skips speech when speech is playing. BUt the menu can be accessed by input key.

  • Does speech skip if the script is disabled?

  • Speech has always skipped before I used the script

  • That will need to be prevented before the script is used. Do you have an input named "SkipSpeech" defined?

  • Ah i see, I do have an input called SkipSpeech

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.