Overriding QuestAction.GetEditorName not working

Announcements, support questions, and discussion for Quest Machine.
Post Reply
jakecard
Posts: 10
Joined: Mon Apr 26, 2021 10:06 am

Overriding QuestAction.GetEditorName not working

Post 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?
jakecard
Posts: 10
Joined: Mon Apr 26, 2021 10:06 am

Re: Overriding QuestAction.GetEditorName not working

Post 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.
User avatar
Tony Li
Posts: 21925
Joined: Thu Jul 18, 2013 1:27 pm

Re: Overriding QuestAction.GetEditorName not working

Post by Tony Li »

I'll add a note to the comments in the template script.
Post Reply