Forum rules - please read before posting.

Navigate conversations & adding new buttons in input script

Alright, I'm taking baby steps toward understanding AC properly (the previous plugins/softwares I've used have been very different), so I'm still posting these beginner's questions...

Trying out my first conversation, I noticed I can't navigate the options with up & down keys. This is super strange since I can navigate other menus just fine (the inventory/equipment windows we've been working with before) and I've made sure the navigate-directly-boxes are all ticked. However, using numbers for the corresponding option also works as intended.

2

I have problems assigning more buttons using the script you put in the wiki for integrating the new input system. Is there a tutorial for adding buttons here? I want to be able skip cut-scenes, so I checked the "is skippable" but I have failed to create a designated button (like Escape) for "End Cutscene".

Comments

  • Trying out my first conversation, I noticed I can't navigate the options with up & down keys.

    Are you using Unity UI, is the menu set to pause the game, and/or is the first option highlighting without use of the mouse? Share screens of your Menu Manager and the Menu's properties if possible.

    The Menu Manager has a dedicated Directly-navigate Menus during Conversations? option, but if you've enabled Allow regular gameplay during Conversations? in the Settings Manager then you'll instead have to use the Engine: Manage systems Action to enable the direct-navigation of menus during gameplay.

    I want to be able skip cut-scenes, so I checked the "is skippable" but I have failed to create a designated button (like Escape) for "End Cutscene".

    It's a case of creating a new InputAction at the top with the others, and then creating a case for it in the GetInputAction function's switch statement.

    To get EndCutscene input working, paste this in the "variables" region at the top:

    [SerializeField] InputAction endCutsceneAction = null;
    

    Then, underneath:

    case "ToggleCursor":
        return toggleCursorAction;
    

    paste:

    case "EndCutscene":
        return endCutsceneAction;
    
  • Okay, so number 2 is taken care of - I was actually very close to fixing this myself, I had just forgotten to add "Action" after "endCutscene" in the script :)

    The conversation-navigation is still a mystery. I'm using the default AC menu. The first option is indeed highlighted. I have checked all of the Directly-navigate Menus boxes. As I mentioned, the number keys work to select the options, only the up and down keys don't work.

    The conversation menu doesn't have an option to pause the game as far as I can see (unlike other menus where the option is clearly visible). I'll upload a screen, but I'm not sure what it will reveal, since most options are left unchanged.

    [img]https://i.imgur.com/chqKBlv.png[/img]

    (Excuse the horrible placeholder graphics; it will look very pretty once I start importing proper art:) )

  • What of the "Allow regular gameplay during Conversations?" option in the Settings Manager?

  • The only thing that happened with that one ticked (apart from the character being able to move) is that the first option is no longer highlighted. But it still doesn't react to arrow keys.

  • Keep it unchecked if it was already - I'm just trying to learn the situation.

    I can't recreate the issue, but it may be related to the mixing of Input System.

    Do you have any other Menus or UI elements enabled at the time?

    In PlayerInput.cs, look for the line:

    scrollingLocked = menu.GetNextSlot (rawInput, scrollingLocked);
    

    Underneath it, paste the following:

    Debug.Log ("Menu: "+ menu.title + ", Input: " + rawInput.y + ", scrolling locked: " + scrollingLocked);
    

    That should display a message whenever an AC menu is under direct control. Does it display for your Conversation menu, and - if not - any other directly-controlled menu?

  • edited September 2021

    No other menus are enabled at the same time.

    The bug report displays the message "Menu: Conversation, Input: 0, scrolling locked: False"

    It also displays with other menus.

  • For other menus, presumably, it shows values other than "Input: 0", I take it?

    Inside your InputSystemIntegration script, look for the Custom_GetAxis function. At the top, copy/paste:

    Debug.Log ("Input axis: " + axisName); if (axisName == "Vertical") Debug.Log ("Value: " + movementAction.ReadValue<Vector2> ().y);
    

    That should report what's being requested, and the value, if it's Vertical. What gets shown when you use the vertical axis while the menu is shown?

  • edited September 2021

    Hmm, I immediately get 999+ reports no matter what I press, so it's hard to make it just about up/down.
    They say a variety of things, mostly "CycleHotspots", "CursorHorizontal", "CursorVertical", "Horizontal", "Vertical"....

    For other menus, presumably, it shows values other than "Input: 0", I take it?

    No, it shows 0 until I press the up-key, upon which it blinks 1.

    I don't know, can all this be related to how my game sometimes (at least after a while) acts strangely when I press keys, as I mentioned in another thread? How it sometimes ignores key presses, and sometimes acts as if it's being held down.

  • edited September 2021

    Hmm, I immediately get 999+ reports no matter what I press, so it's hard to make it just about up/down.

    Reduce this line to just:

    if (axisName == "Vertical") Debug.Log ("Value: " + movementAction.ReadValue<Vector2> ().y);
    

    The messages should then be limited to Vertical axis checks. What do they show when pressing this axis?

    No, it shows 0 until I press the up-key, upon which it blinks 1.

    That "1" blink is what needs to occur for the menu to be navigated. To be clear: it shows "1" for other menus, but not the Conversation menu?

    can all this be related to how my game sometimes (at least after a while) acts strangely when I press keys, as I mentioned in another thread?

    It certainly sounds it, and most likely it's related to the presence of Input System. As mentioned in that thread, I'd need details of your input settings - see my last post there for the screenshots to take.

    Let me know also the version of Input System being used, as well as the "Input active handling" value in Unity's Player SSettings.

  • edited September 2021

    The reports look the same regardless of which menu I open, and even without any menu open; they report 0 except for 1 when I press up-key. Down-key has no effect.

    Alright, sorry for the double threads, but I'll continue the trouble-shooting here.

    Yes, reverting to the old input system solves everything, as far as I can tell; I can now navigate the conversation topics just fine (and the debug log now also reacts to down-key and shows -1), and so far there's no funny business with the movement,

    Should I just continue like this and leave the new input system for now? Maybe it's not worth the hassle.

  • I'm sure we can get it working, but you might prefer to come back to it later on.

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.