Forum rules - please read before posting.

Checking that all conversation options are disabled?

edited June 2021 in Technical Q&A

Hey hey,

In a situation like this where after selecting conversation options, they're toggled off...

...is it possible to check a conversation to know if all conversation options are off and then do something, or, would I have to track it manually via a variable?

Basically, if the player has exhausted all options of a conversation I want to automatically move them to a new part of the logic, instead of leaving them with a singular "Back / Nevermind" option.

Thanks!

Comments

  • You can check the Conversation's Auto-play lone option? to have it automatically choose the response if only one is available.

    Otherwise, you can have a script hook into the OnStartConversation event to react if no options exist:

    using UnityEngine;
    using AC;
    
    public class ConvNoOptions : MonoBehaviour
    {
    
        public ActionList actionListOnNoOptions;
    
        private void OnEnable () { EventManager.OnStartConversation += OnStartConversation; }
        private void OnDisable () { EventManager.OnStartConversation -= OnStartConversation; }
    
        private void OnStartConversation (Conversation conversation)
        {
            if (conversation.GetNumEnabledOptions () == 0)
            {
                actionListOnNoOptions.Interact ();
            }
        }
    
    }
    
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.