Custom PlayMaker sequencer shortcut registration action doesn't work
Posted: Thu Aug 05, 2021 1:20 pm
Hi there,
So... I've made me a PlayMaker action to register shortcuts procedurally...
...but DS tells me "Unrecognized shortcut {{shortcutname}}" when testing the thing in a convo.
So, two things...
1.- For troubleshooting purposes, where could I read a list of the registered sequencer shorcuts at runtime?
2.- Am I getting this error because the action script is not located under the Dialogue Manager game object?
Thanks.
So... I've made me a PlayMaker action to register shortcuts procedurally...
Code: Select all
using System;
using UnityEngine;
using HutongGames.PlayMaker;
namespace PixelCrushers.DialogueSystem.PlayMaker {
[ActionCategory("Dialogue System")]
[HutongGames.PlayMaker.TooltipAttribute("Registers a Sequencer shortcut in Dialogue System.")]
public class RegisterSequencerShortcut : FsmStateAction {
[RequiredField]
[HutongGames.PlayMaker.TooltipAttribute("Unique shorcut name to be registered. Newer registrations with the same name will overwrite the previous.")]
public FsmString shortcutName;
[HutongGames.PlayMaker.TooltipAttribute("String of Sequencer commands to be registered as a shortcut.")]
public FsmString shortcutValue;
public override void Reset()
{
shortcutName = null;
shortcutValue = null;
}
public override void OnEnter() {
if (shortcutName != null)
{
// Remove braces if already entered
shortcutName.Value.Replace("{{", "");
shortcutName.Value.Replace("}}", "");
// Add braces
shortcutName.Value = "{{" + shortcutName.Value + "}}";
// Register shortcut
Sequencer.RegisterShortcut(shortcutName.Value, shortcutValue.Value);
}
Finish();
}
}
}
So, two things...
1.- For troubleshooting purposes, where could I read a list of the registered sequencer shorcuts at runtime?
2.- Am I getting this error because the action script is not located under the Dialogue Manager game object?
Thanks.