Forum rules - please read before posting.

Custom UI button for Simulate Input "EndConversation" issue

Hi,

I've made a custom UI button in Prefab and put it under "Conversation" menu like Click type: Simulate Input, simulate button, Input axis: EndConversation. I made this button in Menu manager, linked this button, but it doesn't work. The strange is that if the UI Sourse is Adventure Creator it works, I tested many times, just I have to use another UI now, so I have to use Unity Prefab UI. The Dialoguelist custom buttons are working and every other custom in my project, but this simulate input, its not. Of course I tried other method, I called Actionlist (Click type), and I write a Kickstarter.statehandler.EndConversation() void, but when AC triggers it, it never works.

My Unity version: 2019.2.9f1
My AC version: v1.70.1

Comments

  • So, when the menu Source: Unity UI Prefab, and I made a button (I made canvas, panel, and button after put it into the field under AC Menu Manager), I set Simulate Input and EndConversation.

    When it's fine, in "Actionlist when turn off", I set Input: Check (if input endcutscene) -> Actionlist: Run

    When I use Source: Adventure Creator for UI, it works, and my cutscene ran in the background

    When I use Source: Unity UI Prefab, my conversation is ended, BUT this cutscene don't run. So the Input: Check doesn't work and can't run my cutscene.

  • I write a Kickstarter.statehandler.EndConversation()

    There is no EndConversation method in StateHandler. Did you mean PlayerInput?

    if input endcutscene

    And did here you mean EndConversation?

    When I use Source: Unity UI Prefab, my conversation is ended, BUT this cutscene don't run. So the Input: Check doesn't work and can't run my cutscene.

    Which cutscene? I'm not clear on what it is exactly you're trying to do, here.

    I think you'll need to explain this again in more detail.

    Another way to do this, though, would be to use a custom Action to end the Conversation:

    using UnityEngine;
    #if UNITY_EDITOR
    using UnityEditor;
    #endif
    
    namespace AC
    {
    
        [System.Serializable]
        public class ActionEndConversation : Action
        {
    
            public ActionEndConversation ()
            {
                this.isDisplayed = true;
                category = ActionCategory.Dialogue;
                title = "End conversation";
            }
    
            public override float Run ()
            {
                KickStarter.playerInput.EndConversation ();
                return 0f;
            }
    
            #if UNITY_EDITOR
    
            public override void ShowGUI ()
            {
                AfterRunningOption ();
            }
    
            #endif
    
        }
    
    }
    
  • Sorry, yes I made many mistakes, so.:

    1. Yes, I mean for Player Input.

    2. Yes, EndConversation.

    3. I have a custom Cutscene, where I switch the camera back to AC's TPC. When Conversation menu turns off (Actionlist when turn off) I set that into asset actionlist.
      Input: Check
      Button name: EndConversation
      If condition is met -> Actionlist: Run
      in scene
      My camera change actionlist

    I have to set it, because when I click on Dialogue Option, Conversation menu turns off, but I don't want to set my camera back, so I put a checking, what I wrote under 3. point.

    I have an Exit button in Conversation menu. And my player can choose 2-4 dialogue options etc...and it loops, if the player click on it again. When the player click on Exit button, I set that: SImulate Input -> EndConversation.

    My problem is that, when I had a conversation with an NPC, after when I goes to an other NPC and click on first time the other NPC's dialogue option, I get back the previous NPC's dialogues options. It happens, when I use Actionlist Asset and set your new script (what you sent now) or what I used my custom script. When I set it to simulate input, it works well under Adventure Creator UI, but when I use Unity Prefab UI, the same method is not working. The problem is at there when Conversation menu turns off, where I set 3. points. The system don't sense that, PlayerInput was Endcutscene. Its a very strange issue for me. I don't understand it.

  • When you use a Unity Prefab UI button and set Input Simulation, the system close your conversation? The system sense your button interaction like Input Simulation?

  • When you use a Unity Prefab UI button and set Input Simulation, the system close your conversation?

    It does.

    The issue is likely to do with Unity UI having its own input sytem to AC.

    You're trying to detect if the player simulated input at the point the menu closed. But with the custom Action I gave you, there's no need to simulate input. You should run your "Camera change" ActionList at the same time that you run this custom Action instead - don't try to detect the input once the Menu itself has begun closing.

  • Okay, it closes my conversation and the camera cutscene runs after it. But in play mode, with my player, when I go to another NPC and click on a dialogue option, I get my previous NPC's dialogue options. And its a big problem. It doesn't "closes perfectly the previous conversation".

    I tested, and if I use Adventure Creator UI Source, it closes perfectly the previous conversation and there is no issue. So when I choose Unity UI Prefab, this problem comes again.

  • Again, I get no such behaviour. It may be that you've done something else that I don't know about. Please share details on anything you've done in the way of customisation.

    What if you use the Demo Game's Conversation menu, which also has a Unity UI variant? Temporarily set your Menu Manager to Demo_MenuManager, and set the Conversation menu to use Unity UI. Then copy it over into your own so that both show up at the same time.

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.
Do NOT follow this link or you will be banned from the site!