Page 1 of 1

Overriding QuestAction.GetEditorName not working

Posted: Fri Apr 30, 2021 9:39 pm
by jakecard
I've got a custom quest action that looks like this:

Code: Select all

using Hosts;
using PixelCrushers.QuestMachine;
using UnityEngine;
using UnityEngine.AddressableAssets;

namespace Quests.QuestActions {
    public class AddAvailableHostAction : QuestAction {
        [SerializeField]
        private AssetReference host;

        public override void Execute() {
            base.Execute();
            HostManager.Instance.AddAvailableHost(host);
        }

        public override string GetEditorName() {
            return "Hello";
        }
    }
}
However, when I go to add an action to quest node state, the name appears as "Add Available Host Action" instead of "Hello". Am I doing it wrong?

Re: Overriding QuestAction.GetEditorName not working

Posted: Fri Apr 30, 2021 10:23 pm
by jakecard
Never mind, I misunderstood what GetEditorName() was for! I thought it was for the name that appears when you go to add the action, but it looks like it's instead for the name that appears in your list of actions after it's added. I would've thought they'd be the same, so this could possibly use a note in the manual/template.

Re: Overriding QuestAction.GetEditorName not working

Posted: Fri Apr 30, 2021 10:42 pm
by Tony Li
I'll add a note to the comments in the template script.