Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: frontakk on January 03, 2012, 02:52:35 AM

Title: What kind of meaning is this error?
Post by: frontakk on January 03, 2012, 02:52:35 AM
I get this error.
What kind of meaning is it?
Code: [Select]
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
System.Collections.Generic.List`1[HutongGames.PlayMaker.FsmOwnerDefault].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.SelectFsm (HutongGames.PlayMaker.Fsm fsm)
HutongGames.PlayMakerEditor.FsmEditor.ResyncFsmSelection ()
HutongGames.PlayMakerEditor.FsmEditor.OnHierarchyChange ()
FsmEditorWindow.OnHierarchyChange () (at Assets/PlayMaker/Editor/FsmEditorWindow.cs:253)
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.OnHierarchyChange ()
Is this error restored by the next version?  ???
Title: Re: What kind of meaning is this error?
Post by: Alex Chouls on January 03, 2012, 02:19:35 PM
Does the error go away if you re-open the Playmaker editor? Or restart Unity?

If not, can you send me the project?
Title: Re: What kind of meaning is this error?
Post by: Alex Chouls on January 14, 2012, 08:23:42 PM
Did you get this error with the beta or 1.2.1? Have you seen this error again in the latest beta?
Title: Re: What kind of meaning is this error?
Post by: aliessmael on January 31, 2012, 11:34:46 PM
same problem happened with me.
this problem still exist even if i close and restart unity again
this problem happen on specific state , if i select this state the playmaker editor dissapear , so i can not delete this state.

i delete it by this way.
first i remember what is the action inside it , after that i change thier names from script , so next time when i start unity this state can not load its actions , then i delete it . after that i rename back the names.

but this is big problem. because i spend alot of time for fixing this issue.
Title: Re: What kind of meaning is this error?
Post by: aliessmael on January 31, 2012, 11:36:00 PM
oooh i forget.
i use playMaker 1.2.1
Title: Re: What kind of meaning is this error?
Post by: aliessmael on January 31, 2012, 11:45:19 PM
this is detail of error

ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
System.Collections.Generic.List`1[HutongGames.PlayMaker.FsmGameObject].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)
HutongGames.PlayMakerEditor.FsmErrorChecker.DoCheckForErrors ()
HutongGames.PlayMakerEditor.FsmErrorChecker.Update ()
HutongGames.PlayMakerEditor.FsmEditor.OnInspectorUpdate ()
FsmEditorWindow.OnInspectorUpdate () (at Assets/PlayMaker/Editor/FsmEditorWindow.cs:238)
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.OnInspectorUpdate ()
Title: Re: What kind of meaning is this error?
Post by: aliessmael on February 02, 2012, 03:13:59 AM
I tried playMaker 1.3.0 RC1 , the problem still the same.
Title: Re: What kind of meaning is this error?
Post by: Alex Chouls on February 02, 2012, 08:03:28 AM
Can you send me your project?
Title: Re: What kind of meaning is this error?
Post by: aliessmael on February 02, 2012, 10:23:46 AM
Right now the project is huge .
I will reproduce the problem in small project and send it to your email.
Title: Re: What kind of meaning is this error?
Post by: Alex Chouls on February 02, 2012, 12:19:37 PM
Thanks!
Title: Re: What kind of meaning is this error?
Post by: aliessmael on February 05, 2012, 12:04:55 AM
Hello
sorry for late
as i promised you , this is small project with playMaker bug

[EDIT - Download link removed]

you have to do the following

1- create empty project

2- import the package from attachment

3 - open problem scene

4 - run the scene ( check the log , no error )

5 - stop running

6 - open "Root" FSM

7 - delete "Exit" state ( you can find it from bottom left )

8 - run the scene and check the log ( NullReferenceExecption )

     till now this is not the real problem

9- stop running

10- select Lobby state ( bottom right )

now this is real problem the editor disappeare and keep logging ArgumentOutOfRange

 

11- now select the "Root" again and revert changes from prefab

12- delete prefab and repeat from 6 till 10 , every thing is fine

 

i gess this problem from prefab

 

Regards.
Title: Re: What kind of meaning is this error?
Post by: Alex Chouls on February 05, 2012, 01:14:27 AM
Great repro steps - thanks!

Was able to repro here, and am looking into it now...
Title: Re: What kind of meaning is this error?
Post by: dasbin on February 05, 2012, 10:47:40 PM
I have this same bug, and cannot select the state (in order to even delete it).

I did not create it the same way. It was caused by simply pasting a copied Get Velocity action into a state.
Title: Re: What kind of meaning is this error?
Post by: Alex Chouls on February 05, 2012, 11:23:52 PM
dasbin, is the FSM a prefab or prefab instance?
Title: Re: What kind of meaning is this error?
Post by: dasbin on February 06, 2012, 02:38:05 PM
It was a Prefab Instance that I was modifying independently, but I had just used the "Apply to Prefab" button immediately before this bug showed up.
Title: Re: What kind of meaning is this error?
Post by: dasbin on February 06, 2012, 05:37:03 PM
Huh, it just happened again, but in different circumstances. A State I had added a few minutes ago just "corrupted" itself and is no longer selectable because of this error. The corruption actually happened during Playing (testing) within the editor, and was still corrupt upon stopping.
Again it was inside a Prefab Instance.

I have an idea, though. I have noticed a very regular recurring bug where sometimes variables themselves get corrupted. Every few hours, while working, a PlayMaker variable will suddenly have a blank name, not due to anything I did. It will spontaneously disappear from all the states it exists in, but the variable still exists. If you try to select it as a variable within an Action, it immediately de-selects itself.
 Perhaps this is sometimes causing a Prefab Instance state to become corrupted as a whole?

Here is the exact error.
Code: [Select]
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
System.Collections.Generic.List`1[UnityEngine.Object].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.FsmEditor.CheckReloadActions (HutongGames.PlayMaker.FsmState state)
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 ()
Title: Re: What kind of meaning is this error?
Post by: Alex Chouls on February 06, 2012, 10:54:43 PM
I've tracked down a tricky bug with prefab instances that is probably causing these problems. Fix will be in the next beta build...