playMaker

Author Topic: Selecting a state destroys playmaker  (Read 3405 times)

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Selecting a state destroys playmaker
« on: June 05, 2013, 02:59:51 AM »
Have been having this issue today where If I select a state it greys out the playmaker window and that FSM is now un touchable until I restart Unity ... but if I select it again the same thing happens :(

the error I'm getting is -

Code: [Select]
NullReferenceException: Object reference not set to an instance of an object

HutongGames.PlayMakerEditor.ActionEditor.EditFsmVar (System.Object fieldValue, System.Object[] attributes)

HutongGames.PlayMakerEditor.ActionEditor.GUIForFieldTypes (System.String labelText, System.Type type, System.Object fieldValue, System.Object[] attributes)

HutongGames.PlayMakerEditor.ActionEditor.EditField (System.Object obj, System.Reflection.FieldInfo field, System.String labelText, System.Type fieldType, System.Object fieldValue, System.Object[] attributes)

HutongGames.PlayMakerEditor.ActionEditor.EditField (HutongGames.PlayMaker.FsmStateAction action, System.Reflection.FieldInfo field)

HutongGames.PlayMakerEditor.ActionEditor.DrawDefaultInspector (HutongGames.PlayMaker.FsmStateAction action)

HutongGames.PlayMakerEditor.ActionEditor.OnGUI (HutongGames.PlayMaker.FsmStateAction action)

HutongGames.PlayMakerEditor.StateInspector.DoActionGUI (HutongGames.PlayMaker.FsmStateAction action)

HutongGames.PlayMakerEditor.StateInspector.DoActionsListGUI (HutongGames.PlayMaker.FsmState state)

HutongGames.PlayMakerEditor.StateInspector.DoActionsPanel ()

HutongGames.PlayMakerEditor.StateInspector.OnGUI ()

HutongGames.PlayMakerEditor.InspectorPanel.OnGUI (Rect area)

HutongGames.PlayMakerEditor.FsmEditor.OnGUI ()

FsmEditorWindow.OnGUI () (at Assets/PlayMaker/Editor/FsmEditorWindow.cs:93)

System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

It's like aids and it spreads to other states :S
« Last Edit: June 05, 2013, 03:37:31 AM by LampRabbit »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Selecting a state destroys playmaker
« Reply #1 on: June 05, 2013, 04:17:11 AM »
Hi,

 what action is on that state? it's using fsmvar, so it's likely that the code is not checking if the var is set or not. or maybe it's a list of var and the index is out of bounds.

bye,

 Jean

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Selecting a state destroys playmaker
« Reply #2 on: June 05, 2013, 04:31:13 AM »
It has 4 ArrayListGet action ... unfortunately I can't fix the issue as I can't select the state :P

I copied all the states and pasted them into another FSM and now another state (which didn't have ArrayListGet is doing the same thing) but it has an ArrayListremove action ... and when I delete it and paste it into another FSM it doesn't break. So at a pure guess its an array issue :S

« Last Edit: June 05, 2013, 04:48:09 AM by LampRabbit »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Selecting a state destroys playmaker
« Reply #3 on: June 05, 2013, 05:47:13 AM »
Hi,

I think I know the issue, it's the serialization of the action that is now obsolete, as it's likely happened after you updated arrayMaker and the action has changed it's public interface.

Could you send me the project, or just the scene? or is it too big?

bye,

 Jean

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Selecting a state destroys playmaker
« Reply #4 on: June 05, 2013, 06:06:52 AM »
Ill try to chop it down and send you the scene :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Selecting a state destroys playmaker
« Reply #5 on: June 05, 2013, 08:56:38 AM »
Hi,

 Can you download the latest ( I just updated), and see if it improves the situation?

https://hutonggames.fogbugz.com/default.asp?W715

bye,

 Jean

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Selecting a state destroys playmaker
« Reply #6 on: June 05, 2013, 08:20:50 PM »
Just updated to the latest but I still get the issue and this error message
Code: [Select]
ArgumentException: An element with the same key already exists in the dictionary.

System.Collections.Generic.Dictionary`2[FsmTemplate,System.String].Add (.FsmTemplate key, System.String value) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)

HutongGames.PlayMakerEditor.FsmEditorUtility.AddTemplateToCategory (.FsmTemplate template, System.String category)

HutongGames.PlayMakerEditor.FsmEditorUtility.CategorizeTemplates ()

HutongGames.PlayMakerEditor.FsmEditorUtility.BuildTemplateList ()

HutongGames.PlayMakerEditor.FsmEditor.OnProjectChange ()

FsmEditorWindow.OnProjectChange () (at Assets/PlayMaker/Editor/FsmEditorWindow.cs:338)

System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

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) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)

System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Applications/buildAgent/work/b59ae78cff80e584/mcs/class/corlib/System.Reflection/MethodBase.cs:115)

UnityEditor.HostView.Invoke (System.String methodName, System.Object obj)

UnityEditor.HostView.Invoke (System.String methodName)

UnityEditor.HostView.OnProjectChange ()

If you still want my scene I can send it to you.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Selecting a state destroys playmaker
« Reply #7 on: June 06, 2013, 01:07:00 AM »
Hi,

 yes please, that will help me

bye,

 Jean

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Selecting a state destroys playmaker
« Reply #8 on: June 06, 2013, 03:32:22 AM »
Hi Jean,

As discussed here is the file - If you select the state called "Setup_Arrays " on the Level_Manager gameobject parented to _Managers ("Game"FSM)

Hope that helps - I have rebuilt all of this and its working fine in my new scene but still an issue to be resolved fingers crossed :)

Removed file - let me know if you didn't get it Jean :)
« Last Edit: June 06, 2013, 04:04:00 AM by LampRabbit »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Selecting a state destroys playmaker
« Reply #9 on: June 07, 2013, 01:19:38 AM »
Hi,

 sorry, did not get it :) pm me the file, thanks.

bye,

 Jean