Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: 600 on June 03, 2021, 06:50:59 AM

Title: FSM Data Version 1 and 2
Post by: 600 on June 03, 2021, 06:50:59 AM
Hello, tried to submit this bug in Unity > Playmaker but didn't receive confirmation email, so posting it here too.
 (https://i.imgur.com/hgmekyv.jpg)

1) What happened

Variables and events reset to None after copy/paste states. Also in Editor mode you set all variables back and in Play mode they change to some other random variable found on the same FSM.

Screenshot
 (https://i.imgur.com/zCbsFra.jpg)

2) How can we reproduce it

It all happens when copy/paste states between FSMs with different DataVersion 1 or 2.

One example of errors I get in console for each variable:
Code: [Select]
Error Loading Action: Act 2 : HutongGames.PlayMaker.Actions.ActivateGameObject : activate
System.ArgumentOutOfRangeException: Non-negative number required.
Parameter name: count
  at System.Text.UTF8Encoding.GetString (System.Byte[] bytes, System.Int32 index, System.Int32 count) [0x0003a] in <4b86512bfcd1449dba2c62ce4e706e3a>:0
  at HutongGames.PlayMaker.FsmUtility.ByteArrayToFsmBool (HutongGames.PlayMaker.Fsm fsm, System.Byte[] bytes, System.Int32 startIndex, System.Int32 totalLength) [0x00000] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\FsmUtility.cs:418
  at HutongGames.PlayMaker.ActionData.GetFsmBool (HutongGames.PlayMaker.Fsm fsm, System.Int32 paramIndex) [0x00064] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1645
  at HutongGames.PlayMaker.ActionData.LoadActionField (HutongGames.PlayMaker.Fsm fsm, System.Object obj, System.Reflection.FieldInfo field, System.Int32 paramIndex) [0x000f1] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1056
  at HutongGames.PlayMaker.ActionData.CreateAction (HutongGames.PlayMaker.ActionData+Context context, System.Int32 actionIndex) [0x00260] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:955

I have a long running project and have many Data Version 1 FSMs, redoing to DataVersion2 manually is not an option.
Any way we could automate Data Version update?

Unity 2018.4 LTS and Playmaker 1.9.1p4, seen this in earlier PM versions too.

Thank you!
Title: Re: FSM Data Version 1 and 2
Post by: djaydino on June 04, 2021, 11:55:22 AM
Hi.
try updating to latest version 1st (as i mentioned on discord :) )


Let Me know when you tried the latest PM version :)
Title: Re: FSM Data Version 1 and 2
Post by: Alex Chouls on June 04, 2021, 02:02:56 PM
I've attached a modified PlayMakerProjectTools that you can try:
Main Menu >PlayMaker > Tools > Update All Loaded FSMs
Main Menu >PlayMaker > Tools > Update All FSMs in Build

This should update FSMs to the current data version. However I don't have any data version 1 FSMs handy to test with, so please backup your project first and make sure the updated FSMs work as expected. Let me know how it goes!
Title: Re: FSM Data Version 1 and 2
Post by: 600 on June 10, 2021, 02:26:06 AM
Hi, thank you for these!
Updated to p5 and tried the "Update All Loaded FSMs" and left it overnight and saw no progress, had to quit Unity to continue work.

(https://i.imgur.com/0YFA9Ei.jpeg)

Would it be possible to have progress shown in % maybe? Not sure if it hanged up or was actually doing something.

Didn't try "Update All FSMs in Build" yet, I assume I have to run them one after another right?
Title: Re: FSM Data Version 1 and 2
Post by: Alex Chouls on June 15, 2021, 01:18:46 PM
Were you using the modified script attached in the previous post?
If you want you can DM me a link to the project so I can test with it...
Title: Re: FSM Data Version 1 and 2
Post by: 600 on June 16, 2021, 05:36:30 AM
Yes I used the above package scripts.
I can't send the project, but will try to pack some Data1 FSMs for testing.

Thank you for the help!
Title: Re: FSM Data Version 1 and 2
Post by: 600 on June 30, 2021, 09:00:04 AM
Hi Alex,
DM sent with test project link.
Thank you!
Title: Re: FSM Data Version 1 and 2
Post by: 600 on August 03, 2021, 03:55:33 AM
bump :D