playMaker

Author Topic: Error Loading Action in the build but not in the editor.  (Read 3205 times)

BGL

  • Playmaker Newbie
  • *
  • Posts: 4
Error Loading Action in the build but not in the editor.
« on: November 18, 2013, 07:58:24 AM »
Hi, I wrote a custom action and realize that changing serialized fields in it can behave differently in respect of where do you add/remove a field.
ALL WHAT FOLLOW IS TRUE IF YOU DON'T UPDATE THE SCENE WHERE YOU USED THE MODIFIED ACTION (Open and save even if in unity the scene is not flagged as modified with the *; saving by Unity command line will not update the scene).
Moreover Playmaker behave differently if you just play in the editor or run a build; for instance in the build you can get errors or something broken, that simply works fine in the editor.
The error is something like:
"Error Loading Action: GameObject: FSM: State: MyAction: myField
Argument is out f range.
Parameter name: index
>UnityEngine.Debug.LogError(Object)
HutonGames.PlayMaker.ActionData.CreateAction(FsmState, Int32)
HutonGames.PlayMaker.ActionData.LoadActions(FsmState)
..."

Here some use case I reproduced.
If you ADD a field before others, you will get an error and following fields will not work.
If you ADD a field as the last public one in your class, you will get an error, but all will work like before (at least if you null check the new field before using it).
If you REMOVE  a field before others, you will get NO error and following fields will not work.
If you REMOVE the last public field in your class, you will get NO error but all will work like before.

I guess is a serialization problem, but my question is: could PlayMaker behave in the same way in the editor and in the build, helping people to early find problems?

Thanks

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Error Loading Action in the build but not in the editor.
« Reply #1 on: November 18, 2013, 10:45:21 AM »
Playmaker does extra checking/updating of changed actions in the editor. These checks are removed from builds for performance reasons.

You should get Playmaker console warnings when actions have changed and the FSMs need to be re-saved. Perhaps these are not obvious enough...?

I'm also considering enabling the update checks in builds, and having extra high-performance dlls available for those who want to squeeze a little more performance out of the system and don't mind any extra work needed...

BGL

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Error Loading Action in the build but not in the editor.
« Reply #2 on: November 18, 2013, 11:31:50 AM »
Thanks for the answer, but I don't get or at least haven't seen any warning.
I can understand that you want to avoid some check in the release build, but other than warning, probably is better to have in the editor the same behaviour that will happen with the build when an error occurs, don't try to fix the error silently in the editor but in the build.
Why do you not flag the scene as changed when you recognize actions changes , so the user understand that something changed and will save, even if he doesn't recognize it was for a Playmaker serialized actions update.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Error Loading Action in the build but not in the editor.
« Reply #3 on: November 18, 2013, 01:51:49 PM »
I'm note sure why the FSMs aren't marked dirty when updating the action data... I'll look into it...

I'll also check the warnings. Are you looking in the Playmaker Editor Log? (PlayMaker > Editor Windows > Editor Log).

BGL

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Error Loading Action in the build but not in the editor.
« Reply #4 on: November 19, 2013, 02:56:34 AM »
Yes, there is a warning "New parameter: myComponent (set to default value)".
Another problem is that if the PlayMakerEditor window is closed, nothing get updated in the scene.
In my company we have a build process that build the application using Unity command line (without opening editor interface), so we need some static script to recognize if PlayMaker need to update a scene and one to actually update if so.
Or a script that open all scenes and force PlayMaker to update all FSM in it.
We can't open manually 20 scenes, open PlayMakerEditor, check the log and save the scene if there is a log about changed actions. Please help us!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Error Loading Action in the build but not in the editor.
« Reply #5 on: November 19, 2013, 07:52:02 AM »
Hi,

 You should use uTomate for this, it has A LOT of raw power for such procedures:

http://u3d.as/content/ancient-light-studios/u-tomate-automation-solution/4rA
http://forum.unity3d.com/threads/178219-uTomate-The-automation-solution-for-Unity3D!

Contact tem to see if your workflow can be automated with uTomate, I am pretty sure they will be interested in your case and have some solutions for you.

I use it for all the assets I create for the Addons section of the wiki, just for packaging and be sure that I don't forget a file or mess up.

bye,

 Jean