Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: Razieln64 on September 11, 2011, 10:51:46 AM

Title: 1.2 Bug - ArgumentOutOfRangeException, Parameter name: Index
Post by: Razieln64 on September 11, 2011, 10:51:46 AM
I always have the Playmaker Edit Tool window open. Whenever I load a different scene, I get this error in a loop in Unity's log.

ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
System.Collections.Generic.List`1[HutongGames.PlayMaker.FsmEventTarget].get_Item (Int32 index)
HutongGames.PlayMaker.ActionData.LoadActionField (System.Object obj, System.Reflection.FieldInfo field, Int32 paramIndex)
HutongGames.PlayMaker.ActionData.CreateAction (HutongGames.PlayMaker.FsmState state, Int32 actionIndex)
HutongGames.PlayMaker.ActionData.LoadActions (HutongGames.PlayMaker.FsmState state)
HutongGames.PlayMaker.FsmState.get_Actions ()
HutongGames.PlayMakerEditor.FsmErrorChecker.DoCheckFsmForErrors (HutongGames.PlayMaker.Fsm fsm)

I also have a scene that was working fine before 1.2. Now I get this whenever I try to edit an FSM with this scene opened, this is logged at every editor update:

ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
System.Collections.Generic.List`1[HutongGames.PlayMaker.FsmEventTarget].get_Item (Int32 index)
HutongGames.PlayMaker.ActionData.LoadActionField (System.Object obj, System.Reflection.FieldInfo field, Int32 paramIndex)
HutongGames.PlayMaker.ActionData.CreateAction (HutongGames.PlayMaker.FsmState state, Int32 actionIndex)
HutongGames.PlayMaker.ActionData.LoadActions (HutongGames.PlayMaker.FsmState state)
HutongGames.PlayMaker.FsmState.LoadActions ()
HutongGames.PlayMaker.Fsm.Init ()
HutongGames.PlayMaker.Fsm.Reinitialize ()
HutongGames.PlayMakerEditor.FsmEditor.Reinitialize ()
HutongGames.PlayMakerEditor.FsmEditor.Update ()
FsmEditorWindow.Update () (at Assets/PlayMaker/Editor/FsmEditorWindow.cs:233)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj)
UnityEditor.HostView.Invoke (System.String methodName)
UnityEditor.HostView.SendUpdate ()
UnityEditor.EditorApplication.Internal_CallUpdateFunctions ()

This happens even if I edit prefabs from the Project view. If I create a new scene and instantiate my prefab and edit the FSM, I don't get this error.

I tried to check the code and fix it, but it's in a DLL.  :(
Title: Re: 1.2 Bug - ArgumentOutOfRangeException, Parameter name: Index
Post by: Alex Chouls on September 12, 2011, 05:57:14 PM
Do you have small repro scenes you could send me? Haven't been able to repro on my end...
Title: Re: 1.2 Bug - ArgumentOutOfRangeException, Parameter name: Index
Post by: Razieln64 on September 13, 2011, 11:47:48 AM
I'm sorry, my project is about 300MB and it only does it in this one scene that I was working on before the 1.2 update. It's a sample scene with a lot of FSMs in it, but not all of them are enabled. I will not use this scene in my final build so don't worry. I just hope this bug will not repeat itself with future updates.