playMaker

Author Topic: Get FSM variables locked to 1 FSM during runtime [SOLVED]  (Read 1771 times)

Mupp

  • Full Member
  • ***
  • Posts: 167
Get FSM variables locked to 1 FSM during runtime [SOLVED]
« 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?
« Last Edit: January 23, 2019, 05:35:59 PM by Alex Chouls »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #1 on: January 22, 2019, 12:46:06 PM »
Hi.
As far as i know, not.

Can you show your fsm setup? video or images.

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #2 on: January 22, 2019, 02:22:10 PM »
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.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #3 on: January 22, 2019, 02:45:27 PM »
Hi, I can repro here. It's a problem with caching. I'll post updated actions later today. Thanks for the detailed explanation!

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #4 on: January 22, 2019, 03:03:46 PM »
Great, sounds good.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #5 on: January 22, 2019, 09:23:40 PM »
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.
« Last Edit: January 23, 2019, 12:08:08 PM by Alex Chouls »

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #6 on: January 23, 2019, 08:44:42 AM »
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?
« Last Edit: January 23, 2019, 09:33:02 AM by Mupp »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #7 on: January 23, 2019, 10:34:55 AM »
What version of PlayMaker are you using?

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #8 on: January 23, 2019, 11:28:10 AM »
1.8.5 Havn't upgraded for a year or so.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #9 on: January 23, 2019, 12:06:56 PM »
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.
« Last Edit: January 23, 2019, 04:34:34 PM by Alex Chouls »

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #10 on: January 23, 2019, 12:19:39 PM »
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?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #11 on: January 23, 2019, 04:36:40 PM »
Ok, please download again. Let me know if this fixes the issues you're seeing...

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #12 on: January 23, 2019, 04:41:04 PM »
There we go, now everything works. Thanks a lot man.