Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Mupp on January 22, 2019, 12:00:53 PM
-
I have gotten this problem that seems to be that Get FSM variables is locked to get data from the first FSM it is set to during runtime.
I have a setup there I have 1 FSM for each stage with data. Then I do a stage transition by triggering a FSM that gets data from the correct stage FSM. I have the stage FSM name set in a string variable, however, no matter what the string changes to after the first time triggered, it will keep accessing the first FSM that was triggered and only that one. I have even tried to remove the string and enter the FSM manually but it doens't matter what the name is, it will only get data from the first one triggered.
So my question is if any of Get FSM variable types actions gets locked to 1 FSM during runtime?
-
Hi.
As far as i know, not.
Can you show your fsm setup? video or images.
-
Here is an image. In every state I get a variable from the stage FSM I use the StageNr variable as the name. It gets assigned the correct name every time so there is no problem there.
I've tried changing the name manually to different stage names and it works, the first time, so it gets data correctly. I even tried with a non existing name and got warnings that those variables doesn't exist as expected.
Here is what's strange though. If I do a stage trigger and then remove the StageNr variable and do a new stage trigger, you would expect it would look for a non existing FSM, but it doesn't. It gives no warnings and it does a normal stage transition, but of course to the same stage.
This makes me almost 100% certain the FSM name gets locked after the first time the Get FSM X is run.
-
Hi, I can repro here. It's a problem with caching. I'll post updated actions later today. Thanks for the detailed explanation!
-
Great, sounds good.
-
Please try the attached actions. BACKUP your project first!
This should fix caching issues when changing FSM name in Get/Set variable actions.
EDIT: Removing the attached actions since they are only compatible with 1.9.0. See below for fixed actions that should be compatible with older versions.
-
I tried these but I get 2 errors.
Assets/PlayMaker/Actions/StateMachine/BaseGameObjectFsmAction.cs(12,10): error CS0246: The type or namespace name `DisplayOrder' could not be found. Are you missing an assembly reference?
Assets/PlayMaker/Actions/StateMachine/BaseGameObjectFsmAction.cs(16,10): error CS0246: The type or namespace name `DisplayOrder' could not be found. Are you missing an assembly reference?
I fiddled a bit with the code and disabled those 2 lines and now it seems to work. Some things are working but I'm using Get FSM Variables which was not in the pack, so that's not working.
I guess I might gotten it from eco so I have to replace that unless there is something I can do with the code?
-
What version of PlayMaker are you using?
-
1.8.5 Havn't upgraded for a year or so.
-
This issue is actually fixed if you update to 1.9.0 (no need to import the package I posted). I recommend updating, but if you can't for some reason, here are the fixed get/set variable actions that *should* be compatible with 1.8.5 (but BACKUP first as always!)
EDIT: Removed the download. Download latest below.
-
Thanks a lot, those I have tested works as they should now. Great.
The pack did not include the Get FSM Variables action so I have to replace that, unless there is something I can do?
-
Ok, please download again. Let me know if this fixes the issues you're seeing...
-
There we go, now everything works. Thanks a lot man.