playMaker

Author Topic: Error Loading Action - Index was out of range  (Read 345 times)

K

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Error Loading Action - Index was out of range
« on: December 05, 2018, 01:37:30 AM »
Hi there,

I encounter the following error when I attempted to change an enum field to FsmEnum. I appreciate if someone could help m(- -)m


Error Loading Action: [ActionName] : [ClassName] : Action
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <f2e6809acb14476a81f399aeb800f8f2>:0
  at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <f2e6809acb14476a81f399aeb800f8f2>:0
  at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <f2e6809acb14476a81f399aeb800f8f2>:0
  at HutongGames.PlayMaker.ActionData.GetFsmEnum (HutongGames.PlayMaker.Fsm fsm, System.Int32 paramIndex) [0x00000] in C:\Projects\Playmaker_1.9.0\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1749
  at HutongGames.PlayMaker.ActionData.LoadActionField (HutongGames.PlayMaker.Fsm fsm, System.Object obj, System.Reflection.FieldInfo field, System.Int32 paramIndex) [0x00241] in C:\Projects\Playmaker_1.9.0\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1067
  at HutongGames.PlayMaker.ActionData.LoadActionField (HutongGames.PlayMaker.Fsm fsm, System.Object obj, System.Reflection.FieldInfo field, System.Int32 paramIndex) [0x006e5] in C:\Projects\Playmaker_1.9.0\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1225
  at HutongGames.PlayMaker.ActionData.CreateAction (HutongGames.PlayMaker.ActionData+Context context, System.Int32 actionIndex) [0x0024f] in C:\Projects\Playmaker_1.9.0\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:942
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.ActionData:CreateAction(Context, Int32) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ActionData.cs:947)
HutongGames.PlayMaker.ActionData:LoadActions(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ActionData.cs:776)
HutongGames.PlayMaker.FsmState:LoadActions() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:123)
HutongGames.PlayMaker.Fsm:InitData() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1745)
HutongGames.PlayMakerEditor.FsmErrorChecker:DoCheckFsmForErrors(Fsm) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmGraphView.cs:2459)
HutongGames.PlayMakerEditor.FsmErrorChecker:DoCheckForErrors() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmGraphView.cs:2347)
HutongGames.PlayMakerEditor.FsmErrorChecker:Update() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmGraphView.cs:2332)
HutongGames.PlayMakerEditor.FsmEditor:Update() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/FsmEditorGUILayout.cs:566)
HutongGames.PlayMakerEditor.FsmEditorWindow:Update() (at Assets/PlayMaker/Editor/FsmEditorWindow.cs:276)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()



Code snippet before and after change is as follows. I'm using Unity 2018.2.9f1 with PlayMaker 1.9.0

Code: [Select]
public class ClassName : FsmStateAction {
[System.Serializable]
public class SubClassName {
// vvv Before Change vvv //
public EnumClassName VariableName = EnumClassName.Value;
// ^^^ Before Change ^^^ //
// vvv After Change vvv //
[ObjectType(typeof(EnumClassName))]
public FsmEnum VariableName = new FsmEnum("name", typeof(EnumClassName), (int)EnumClassName.Value) { UseVariable = false };
// ^^^ After Change ^^^ //
...
}

[RequiredField, Tooltip("Tooltips")]
public SubClassName[] ArrayVariable;
...
}