playMaker

Author Topic: No longer can access FSM due to crippling error  (Read 3521 times)

Krileon

  • Full Member
  • ***
  • Posts: 107
No longer can access FSM due to crippling error
« on: June 29, 2013, 11:52:36 AM »
I'm losing my mind with issues like this. I don't know what causes it, but it's crippling my progress. I can't access my FSM anymore. After going to the FSM I get the below when I immediately click any State in the FSM.

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.EditArray (UnityEngine.GUIContent label, System.Type elementType, 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/84669f285f6a667f/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

The FSM window then goes blank and console is loaded with dozens of the above. Please provide an immediate fix/workaround as my entire project is on hold due to this and planned to have a large chunk done this weekend.

Krileon

  • Full Member
  • ***
  • Posts: 107
Re: No longer can access FSM due to crippling error
« Reply #1 on: June 29, 2013, 11:56:48 AM »
Was able to resolve the issue by completely deleting PlayMaker, re-importing, then importing my Globals back in. The below is now shown.

Code: [Select]
Error Loading Action: Setup : Level End : New Time : HutongGames.PlayMaker.Actions.FormatString : variables
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.ActionData:CreateAction(FsmState, Int32)
HutongGames.PlayMaker.ActionData:LoadActions(FsmState)
HutongGames.PlayMaker.FsmState:LoadActions()
HutongGames.PlayMaker.Fsm:InitData()
HutongGames.PlayMaker.Fsm:Reinitialize()
HutongGames.PlayMakerEditor.FsmEditor:SelectFsm(Fsm)
FsmEditorWindow:OpenWindow(PlayMakerFSM) (at Assets/PlayMaker/Editor/FsmEditorWindow.cs:34)
FsmComponentInspector:OpenInEditor(PlayMakerFSM) (at Assets/PlayMaker/Editor/FsmComponentInspector.cs:308)
FsmComponentInspector:OnInspectorGUI() (at Assets/PlayMaker/Editor/FsmComponentInspector.cs:115)
UnityEditor.DockArea:OnGUI()

I don't understand how it can go from working fine, to suddenly not working fine; like something didn't save? I don't know. Any suggestions?

Krileon

  • Full Member
  • ***
  • Posts: 107
Re: No longer can access FSM due to crippling error
« Reply #2 on: June 29, 2013, 11:58:13 AM »
Aha, I see the issue. Format String lost its variables for whatever reason. Fixed the missing variables and seams to be ok now. Just wonder why I had to completely re-install PM to prevent it from crippling the UI of the FSM when clicking a State.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: No longer can access FSM due to crippling error
« Reply #3 on: June 29, 2013, 12:29:35 PM »
Not sure what would cause this. Do you still have a copy of the project in a broken state that you could send to me?

I'll take a look at the action and try and make it more fault tolerant...

Krileon

  • Full Member
  • ***
  • Posts: 107
Re: No longer can access FSM due to crippling error
« Reply #4 on: June 29, 2013, 12:40:09 PM »
Quote
Do you still have a copy of the project in a broken state that you could send to me?
Unfortunately no. I should've made a backup as soon as it happened to send to you. Will do so if it happens again.

I think a way of duplicating it is create an FSM that uses an Action that has a variable selector (like format string). Next give it 1 variable that points to an FsmVariable of some type. Now save it as a prefab and save the scene then close the PM editor. Next open it again, delete the variable, save the prefab, save the scene, close the PM Editor. Now open it again and click the State. This MIGHT cause it to happen as I believe is what I did to cause it (unintentionally lol).

Quote
I'll take a look at the action and try and make it more fault tolerant...
I think it's due to the GUI trying to format the variable display with a variable that doesn't exist. It seams to be more fault tolerant once I did a clean install of 1.6.1 (previously just updated existing 1.6.0 install). I had this happen in the past before, but can't recall what I did to fix it at that time. Anyway, keep up the great work; PlayMaker is fantastic despite the occasional hiccup, lol.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: No longer can access FSM due to crippling error
« Reply #5 on: June 29, 2013, 03:20:40 PM »
Actually 1.6.1 had a bug fix for possible NullReferenceExceptions with string fields, so that might explain the update fixing the problem...

Krileon

  • Full Member
  • ***
  • Posts: 107
Re: No longer can access FSM due to crippling error
« Reply #6 on: June 29, 2013, 05:35:53 PM »
Aha, that could be it. When I deleted PM then re-imported 1.6.1 the issue went away. I'll let you know if I see it again and will make a copy for you if it does.