Forum rules - please read before posting.

Custom Conversasion UI Box

Hello, I've been wondering if its possible to make a custom Conversation UI Box by making a new custom ActionList Node. Is this possible in the current version of Adventure Creator or does it require more work than usual? The link below has more details on how I would like to be done.
https://imgur.com/a/NI2vGj0

Comments

  • Having dialogue display in different ways is a case of either:

    1. Having a single UI-based Menu, and altering its appearance through animation
    2. Having multiple Menus, each styled differently, and keeping only one unlocked at a time

    If each of the displays are drastically different, you're better off with option 2. If you have multiple dialogue Menus, i.e. those with an Appear type of When Speech Plays, only those that are unlocked will display.

    Updating which one gets shown is then a case of locking each of the Menus, except for the one you want.

    You can do this without any scripting by having an ActionList that runs a sequence of Menu: Change state Actions that lock all of the speech Menus, and then an additional such Menu that unlocks the intended one. This last Menu could then use a String parameter to override which Menu it affects - allowing you to call it by using the ActionList: Run Action and specify the Menu as a parameter value.

    If you wanted to have a custom Action, that's possible - locking/unlocking Menus can be set through code.

    A general tutorial on writing custom Actions can be found here. Something along these lines would do it (modify the "menus" array to match your own speech menu names):

    using AC;
    
    [System.Serializable]
    public class ActionRename : Action
    {
    
        public int index;
        private readonly string[] menus = new string[] { "Menu1", "Menu2", "Menu3" };
    
        public override ActionCategory Category { get { return ActionCategory.Custom; } }
        public override string Title { get { return "UI switch"; } }
    
        public override float Run()
        {
            for (int i = 0; i < menus.Length; i++)
            {
                var menu = PlayerMenus.GetMenuWithName(menus[i]);
                if (menu != null) menu.isLocked = i != index;
            }
    
            return 0f;
        }
    
    #if UNITY_EDITOR
    
        public override void ShowGUI()
        {
            index = UnityEditor.EditorGUILayout.Popup("Menu to show:", index, menus);
        }
    
    #endif
    
    }
    
  • edited July 23

    Hi, I've been following your suggestion in creating a separate menu for what I wanted for an Alternative dialog box and I'm wondering if there's a way to expand this "New Label" box so that it wouldn't look crammed inside a small text box?

    Here's the image for reference
    https://imgur.com/a/yFxxZtH

  • Open up AC's ActionMenuSetInputBox script and replace the 149f on line 315 with 0f.

  • Thanks! I'll try that!

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.