Forum rules - please read before posting.

Dialogue Toggle option parameter

Hi, I'm currently working on a 2D game and I was wondering if there is a way to use a parameter for the Dialogue: Toggle option. In my game, when a player is given two dialogue options and chooses one, the other option should never be shown again. Up until now, I've been manually using the Dialogue: Toggle option to turn off the unchosen option. However, I'm wondering if there's a more efficient way to do this within Adventure Creator that I might not be aware of. Any advice is appreciated. Thank you for your time.

Comments

  • A custom script can hook into the OnClickConversation custom event, and turn off all options that don't have the same ID as the option clicked:

    using UnityEngine;
    using AC;
    
    public class AutoDisableConvOptions : MonoBehaviour
    {
    
        void OnEnable () { EventManager.OnClickConversation += OnClickConversation; }
        void OnDisable () { EventManager.OnClickConversation -= OnClickConversation; }
    
        void OnClickConversation (Conversation conversation, int optionID)
        {
            foreach (var option in conversation.options)
            {
                if (option.ID != optionID) option.isOn = false;
            }
        }
    
    }
    
  • Thank you so much for your help once again! This approach is indeed much more efficient.

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.