Forum rules - please read before posting.

Beyond two souls like buttons

Hi there, I was windering how the button clicking can be done in with adventure creator? Ideally I want the result which is like in Beyond two souls, chech the screen below

No matter will it be arrow button or for examp the A button on keyboard

Comments

  • The screen isn't clear enough to illustrate your intent - can you describe what you're looking to achieve in more detail?

    QTEs can be used to run Actions when an input is held down, but it may be that a custom interaction system is better suited in this case. More on this topic can be found in the Manual's "Custom interaction systems" chapter.

  • Thanks for the answer, what I need is to add various buttons for some simple functions, f.e. Pressing the D button on keyboard to to knock the door, or pressing the left arrow button on keyboard to put the box to left and of course F button to pay respect)) Do you know how can this functions be done with buttons? And also do I need to write code for if I use the "Custom interaction systems" ?

    Thanks beforehand.

  • And also do I need to write code for if I use the "Custom interaction systems" ?

    If it comes to it, yes. But some amount of coding will be necessary even without it, as the behaviour is very specific - and depends on other factors e.g. how/when are such inputs valid, how many are shown at once etc.

    Either way, the first thing to do is probably to sync up the various inputs you want to have with the Cursor Manager - so that each input has its own icon defined in the "Interaction icons" panel.

    For each of the inputs, create a new interaction icon. Here you can also assign a graphic to display - i.e. a "D" keyboard key etc. For each input, go to Unity's Input Manager and define an input with the correct "Positive Button" assigned. For example, define an input named "Interaction_F" with a Positive Button value of "f" (no quotes).

    Next, switch your Settings Manager's Interaction method to Context Sensitive, uncheck Mouse clicks have default functionality?, to prevent left-clicks running interactions.

    For each Hotspot, you can can now define a single "Use" interaction and assign it the desired input from its Icon drop-down.

    To have these icons display when a Hotspot is selected, you can add them as Interaction elements to your Hotspot menu. Create an Interaction element for each icon you've defined in the Cursor Manager, and you should find that they show/hide automatically at runtime based on what each Hotspot's icon is set to.

    It may then just be a case of using a custom script to override the default "InteractionA" input with your per-icon inputs. Something like this should do it:

    using UnityEngine;
    using AC;
    
    public class MultiInputInteractions : MonoBehaviour
    {
    
        [SerializeField] private InputIconPair[] inputIconPairs = new InputIconPair[0];
    
        private void Start ()
        {
            KickStarter.playerInput.InputGetButtonDownDelegate = CustomGetButtonDown;
        }
    
        private bool CustomGetButtonDown (string buttonName)
        {
            if (buttonName == "InteractionA")
            {
                if (!KickStarter.stateHandler.IsInGameplay ())
                {
                    return Input.GetButtonDown (buttonName);
                }
    
                foreach (InputIconPair inputIconPair in inputIconPairs)
                {
                    if (!string.IsNullOrEmpty (inputIconPair.inputName) && Input.GetButtonDown (inputIconPair.inputName))
                    {
                        return IsValid (inputIconPair.iconID);
                    }
                }
                return false;
            }
    
            try
            {
                return Input.GetButtonDown (buttonName);
            }
            catch {}
    
            return false;
        }
    
        private bool IsValid (int iconID)
        {
            foreach (Menu menu in PlayerMenus.GetMenus (true))
            {
                if (menu.IsOn () && menu.TargetHotspot)
                {
                    AC.Button useButton = menu.TargetHotspot.GetUseButton (iconID);
                    if (useButton != null && !useButton.isDisabled)
                    {   
                        return true;
                    }
                }
            }
    
            return false;
        }
    
    
        [System.Serializable]
        private class InputIconPair
        {
    
            public string inputName;
            public int iconID;
    
        }
    
    }
    

    (See the Manual's "Remapping inputs" chapter for details on this technique).

    Paste in a script named MultiInputInteractions.cs, and place on an empty in your scene. In its Inspector, you'll need to create an array to match each input you've defined in the Input Manager with its associated icon in the Cursor Manager (referencing each icon's ID number).

  • I'm total 0 with coding, and if it finds out that for my project to use qte's I need to code it really sad

    You also said "QTEs can be used to run Actions when an input is held down"

    Can I get more information for that? What chapter in manual I need to read for it? And also do I need to code for it?

    If for QTE I use running actions when an input is held down, how it can be done with android mobile devices?

    Thank you.

  • QTEs by themselves do not require coding to operate.

    They are covered in the Manual's "Quick-time events" chapter, and tutorials on their usage can be found here.

    When used on mobile devices, you can either leave the Input: QTE Action's Input button name field blank for any tap on the screen to register, or simulate inputs by creating Button menu elements set to Simulate Input.

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.