playMaker

Author Topic: [SOLVED] Proper way to have playmaker FSMs in common subrepository  (Read 1352 times)

yesitsdave

  • Playmaker Newbie
  • *
  • Posts: 2
Hi

I have a subrepository containing a variety of libraries etc that are common between my games. It contains scripts, prefabs, scenes, etc. So it is in Assets/Common in multiple projects for example.

One of the things I have recently added is an overlay GUI which uses a playmaker FSM. This GUI is contained in its own scene so that it can be loaded into other scenes as needed across multiple projects by scripts.

I can't get the playmaker FSM in the scene to work in any project except the one it was created in though. First, the playmaker FSM script showed as missing, which I figured was due to different guids. After copying the meta files across for playmaker so that the guids are the same, it works, but the actual FSM does not show. If I try to edit it I get a long string of errors of the form

NullReferenceException: Object reference not set to an instance of an object
HutongGames.PlayMaker.FsmState.GetTransition (Int32 transitionIndex)
HutongGames.PlayMakerEditor.FsmSelection.set_ActiveFsm (HutongGames.PlayMaker.Fsm value)
HutongGames.PlayMakerEditor.FsmSelection..ctor (HutongGames.PlayMaker.Fsm fsm)
HutongGames.PlayMakerEditor.FsmSelectionHistory.GetSelection (HutongGames.PlayMaker.Fsm fsm)
HutongGames.PlayMakerEditor.FsmSelectionHistory.SelectFsm (HutongGames.PlayMaker.Fsm fsm)
HutongGames.PlayMakerEditor.FsmEditor.SelectFsm (HutongGames.PlayMaker.Fsm fsm)
HutongGames.PlayMakerEditor.FsmEditor.SelectFsm (UnityEngine.GameObject gameObject)
HutongGames.PlayMakerEditor.FsmEditor.OnSelectionChange ()
HutongGames.PlayMakerEditor.FsmEditor.OnEnable ()
FsmEditorWindow.Initialize () (at Assets/PlayMaker/Editor/FsmEditorWindow.cs:89)
HutongGames.PlayMakerEditor.BaseEditorWindow.OnGUI ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)



Perhaps I am going about this the wrong way? Ideally I don't want to have to export packages and reimport them as the idea is for all this stuff to work properly as a subrepository, getting updated in a normal vcs workflow. This works with everything except the FSM.

Any help is much appreciated.
« Last Edit: January 20, 2015, 12:57:35 PM by yesitsdave »

yesitsdave

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Proper way to have playmaker FSMs in common subrepository
« Reply #1 on: January 20, 2015, 12:56:23 PM »
Nevermind! It seems that what had happened was that I had saved the scene in the second project when the playmaker guids were not the same, thus corrupting some of the playmaker information in the scene I think as the script was listed as missing.

I went back to the good scene, copied meta files, and it all works now. Maybe a bit of a hack but everything seems fine.