playMaker

Author Topic: Errors on AfterSerialize  (Read 1775 times)

ben

  • Playmaker Newbie
  • *
  • Posts: 5
Errors on AfterSerialize
« on: July 13, 2018, 09:16:07 AM »
Hi,

We have an issue using playmaker 1.8.5.f8 with Unity 2017.4.1f1 :
On multiple actions on multiple FSMs (can be user-made or base Playmaker actions) there is this errors when a scene is loaded (in editor or runtime) :

Quote
Error Loading Action: XXX
System.ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
  at System.Collections.Generic.List`1[HutongGames.PlayMaker.FsmEnum].get_Item (Int32 index) [0x0000c] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633
  at HutongGames.PlayMaker.ActionData.GetFsmEnum (HutongGames.PlayMaker.Fsm fsm, Int32 paramIndex) [0x00000] in c:\Users\Alex\Documents\Unity\Playmaker\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1741
  at HutongGames.PlayMaker.ActionData.LoadActionField (HutongGames.PlayMaker.Fsm fsm, System.Object obj, System.Reflection.FieldInfo field, Int32 paramIndex) [0x00296] in c:\Users\Alex\Documents\Unity\Playmaker\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1059
  at HutongGames.PlayMaker.ActionData.CreateAction (HutongGames.PlayMaker.Context context, Int32 actionIndex) [0x00264] in c:\Users\Alex\Documents\Unity\Playmaker\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:934
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.ActionData:CreateAction(Context, Int32) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ActionData.cs:939)
HutongGames.PlayMaker.ActionData:LoadActions(FsmState) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ActionData.cs:768)
HutongGames.PlayMaker.FsmState:LoadActions() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:117)
HutongGames.PlayMaker.Fsm:InitData() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1707)
HutongGames.PlayMaker.Fsm:Reinitialize() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1655)
HutongGames.PlayMaker.Fsm:Preprocess(MonoBehaviour) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1576)
PlayMakerFSM:Preprocess() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:232)
HutongGames.PlayMakerEditor.PlayMakerBuildCallbacks:OnPostprocessScene() (at Assets/Other/PlayMaker/Editor/PlayMakerBuildCallbacks.cs:34)

Or this one :

Quote
Error Loading Action: XXX
System.ArgumentException: Object type YYY cannot be converted to target type: WWW
Parameter name: val
  at System.Reflection.MonoField.SetValue (System.Object obj, System.Object val, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) [0x000a0] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoField.cs:148
  at System.Reflection.FieldInfo.SetValue (System.Object obj, System.Object value) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/FieldInfo.cs:150
  at HutongGames.PlayMaker.ActionData.LoadActionField (HutongGames.PlayMaker.Fsm fsm, System.Object obj, System.Reflection.FieldInfo field, Int32 paramIndex) [0x007b8] in c:\Users\Alex\Documents\Unity\Playmaker\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1221

Or

Quote
UnityException: GetBool is not allowed to be called during serialization, call it from Awake or Start instead. Called from MonoBehaviour 'PlayMakerFSM' on game object 'Trigger_Fight_FSM (1)'.
See "Script Serialization" page in the Unity Manual for further details.
SyntaxTree.VisualStudio.Unity.Bridge.Configuration.GlobalConfiguration.get_SendConsoleToVisualStudio ()
SyntaxTree.VisualStudio.Unity.Bridge.Configuration.ActiveConfiguration.get_SendConsoleToVisualStudio ()
SyntaxTree.VisualStudio.Unity.Bridge.VisualStudioIntegration.OnLog (System.String message, System.String stacktrace, LogType type)
UnityEngine.Application.CallLogCallback (System.String logString, System.String stackTrace, LogType type, Boolean invokedOnMainThread) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/ApplicationBindings.gen.cs:565)
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.ActionData:CreateAction(Context, Int32) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ActionData.cs:939)
HutongGames.PlayMaker.ActionData:LoadActions(FsmState) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ActionData.cs:768)
HutongGames.PlayMaker.FsmState:LoadActions() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:117)
HutongGames.PlayMaker.Fsm:InitData() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1707)
PlayMakerFSM:OnAfterDeserialize() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:840)

Or

Quote
Door: FSM: XXX: FireCustomSoundEventOnTarget: Action has changed since FSM was saved. Could not recover parameters. Parameters reset to default values.
UnityEngine.Debug:LogError(Object, Object)
HutongGames.PlayMaker.ActionReport:LogError(PlayMakerFSM, FsmState, FsmStateAction, Int32, String, String) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ActionReport.cs:89)
HutongGames.PlayMaker.ActionData:LogError(Context, String) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ActionData.cs:1498)
HutongGames.PlayMaker.ActionData:CreateAction(Context, Int32) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ActionData.cs:913)
HutongGames.PlayMaker.ActionData:LoadActions(FsmState) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/ActionData.cs:768)
HutongGames.PlayMaker.FsmState:LoadActions() (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:117)

It seems to happen on random actions on gameobjects that are instance of a prefab. When reloading the same scene the same objects have the errors.
We have tried to call "Update All Loaded Prefab" or even call directly in code Reinitialize and many other accessible methods on FSMs but it does not fix the problem.

The only viable fix is to revert the gameobject to prefab (not always possible because sometime the instance are a bit different) or just recreate the actions.
But new errors come really often.

It always looks like there is some custom serialization made by Playmaker (not accessible) that tries to recreate actions but fail (because there is too many variables, or not good type etc...) which is weird because it happen on script that never changed variable count/order and on some object with an action but not on other objects with the same action.

Do you have any idea how to fix it? Or at least to hide this errors (which seems to have no impact other than making impossible to build in strict mode)?
« Last Edit: July 13, 2018, 09:29:14 AM by ben »

ben

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Errors on AfterSerialize
« Reply #1 on: July 17, 2018, 03:41:10 AM »
Nobody knows? or even repro this errors?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Errors on AfterSerialize
« Reply #2 on: July 30, 2018, 06:30:42 AM »
Hi,

 I haven't encountered this,

- Can you explain what you did to the project bbefore it reached that broken state?

- did you update Unity, PlayMaker?

if you have a back up from before this issue, what does it take to reproduce this?

your errors are really odd. I suspect a custom action is causing this issue.

 what is Object type YYY cannot be converted to target type: WWW, did you created an action called "XXX" ? can you share it ( pm me if you don't want this to be public)

 Bye,

 Jean


Bye,

 Jean

PollitronicDev

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Errors on AfterSerialize
« Reply #3 on: October 04, 2021, 11:18:34 AM »
Hello, I know this thread is a bit old but we found a way to reproduce this bug:

https://hutonggames.com/playmakerforum/index.php?topic=24291.0