Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: roronoazaoxl on December 03, 2012, 07:07:40 AM

Title: Error loading action~~
Post by: roronoazaoxl on December 03, 2012, 07:07:40 AM
I have an aciton which has an FsmFloat member variable.

I used to assign this variable in it's declaration like this:

Public FsmFloat volum = 1f;

It works until I upgrade my game to Unity4.

I got lots of error in debug console like this:

Error loading action: Playbgmusic : FSM : trigger : PlayBackGroundMusic : volume
UnityEngine.Debug:Internal_Log(Int32, String, Object)
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:Init(MonoBehaviour)
PlayMakerFSM:Awake()

Then I move the assigment to Reset() Method like this:

    public FsmFloat volume;

    public override void Reset()
    {
        volume = 1f;
    }

But I still get this error after I build my game( this error never happen when I execute in editor

mode).

This problem make my game crash a lot. Is anyone have idea that happen here.

Thanks!
Title: Re: Error loading action~~
Post by: DARK_ETERNAL on December 05, 2012, 09:05:14 AM
The variable type and it's declaration aren't compatible.

'volume' is an FsmFloat variable, whilst '1f' is a Float. Try to set the Fsm variable value in your Reset() as this:

Code: [Select]
public override void Reset(){
  volume.Value = 1f;
}
Title: Re: Error loading action~~
Post by: roronoazaoxl on December 06, 2012, 02:52:08 AM
Thanks, I will try~~
Title: Re: Error loading action~~
Post by: Alex Chouls on December 07, 2012, 01:11:06 AM
If you're seeing action loading errors in the build, but not the editor, it's usually because actions have changed since FSMs that used them were last saved. Those FSMs need to be re-saved.

This is because of a performance optimization in Playmaker that works like this:

When action data is loaded in the editor, it tries to maintain parameters in actions that have changed. E.g., fields that existed previously keep their values and new fields get default values. When you re-save this FSM the action data is then consistent with the current version of the action.

However, when action data is loaded in a standalone build, Playmaker does not perform these checks - it assumes the data has been saved with the most current version of the action.

So if you have old prefabs using old versions of the action, or rarely loaded scenes which were last saved with old versions of the action, then you might see these kinds of errors.

I'm thinking about a better way to handle this, but haven't thought of anything yet... I'll put a suggested fix in the error message at least... :/
Title: Re: Error loading action~~
Post by: Marc Saubion on February 06, 2018, 06:41:33 AM
Hi.

Anything new about this?

I have the same issue but don't know how to save said FSMs and don't even know which one is causing the problem as the error message doesn't give enough intel.

Thanks

Quote
Error Loading Action: State 3 : HutongGames.PlayMaker.Actions.SendMessage : functionCall
System.ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
  at System.Collections.Generic.List`1[HutongGames.PlayMaker.FunctionCall].get_Item (Int32 index) [0x0000c] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633
  at HutongGames.PlayMaker.ActionData.GetFunctionCall (HutongGames.PlayMaker.Fsm fsm, Int32 paramIndex) [0x00000] in C:\Users\Alex\Documents\Unity\Playmaker\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1752
  at HutongGames.PlayMaker.ActionData.LoadActionField (HutongGames.PlayMaker.Fsm fsm, System.Object obj, System.Reflection.FieldInfo field, Int32 paramIndex) [0x001ed] in C:\Users\Alex\Documents\Unity\Playmaker\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1052
  at HutongGames.PlayMaker.ActionData.CreateAction (HutongGames.PlayMaker.Context context, Int32 actionIndex) [0x0024f] in C:\Users\Alex\Documents\Unity\Playmaker\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:939
Title: Re: Error loading action~~
Post by: jeanfabre on February 07, 2018, 04:31:17 AM
Hi,

 can you describe or even better copy paste the method you are trying to call using sendMessage and also how you have setup your action?

 Bye,

 Jean
Title: Re: Error loading action~~
Post by: thecosmicboy on February 26, 2018, 08:40:58 PM
https://pasteboard.co/H9vyb2q.png (https://pasteboard.co/H9vyb2q.png)

(http://blob:https://pasteboard.co/46ae69c3-ce71-45c6-8783-8c8c516c6a71)

Having the same problems myself, finding it hard to find the fsm's they are contained in from the errors in the console.
Title: Re: Error loading action~~
Post by: jeanfabre on February 27, 2018, 01:39:36 AM
Hi,

 this is typically a case where you are going through childrens of a gameobject that are getting deleted as you loop through them.

 so when you use the action ActivateGameObject, during the process ( even if instantaneous), something else in your logic is deleting the objects in the list that this action has to work with.

Can you confirm this?

 Bye,

 Jean

 
Title: Re: Error loading action~~
Post by: thecosmicboy on February 27, 2018, 11:04:10 AM
You're most likely right,

However i'm struggling the past few hours to find the culprit, as the states named are "state 1" and "state 2" i'm guessing its some test fsm i've imported into the project from an old package or something as I try to name all of my states on fsms that are finalised.

I've been going through all of my scenes (big project) one by one and trudging through the fsms inside the playmaker editor, doesnt help that prefabbed fsms aren't grouped together into one in the list, some scenes I have hundreds of duplicate fsms I am searching though trying to find this fsm.

Any tips on searching or finding fsms containing states with a specific name? or any other method of tracking this fsm down?

 
Title: Re: Error loading action~~
Post by: jeanfabre on February 28, 2018, 02:37:00 AM
Hi,

Yeah, this is missing currently in the PlayMaker toolbox. I have a work in progress on this which scan the whole project and turns it into am Xml description with everything, whicha llows you to do any kind of searches including finding state named xxx.

But currently, it's not available. I can give you access to the current state if you want.

 Bye,

 Jean
Title: Re: Error loading action~~
Post by: thecosmicboy on February 28, 2018, 11:03:43 AM
I was using the find action feature in the editor, specifically on actions showing errors in the console to narrow down fsm's but didn't have as much luch with it as I thought, it seemed to omit the fsm's causing the problem.

I eventually found the culprit through trial and error, some old gameobjects with old fsm's I had imported into the scene. These objects were disabled and never ran in playmode, i'm guessing that's why it would not display the fsm names in the console like the others.

Yes that tool will definitely be useful in future, thanks