playMaker

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

Mupp

  • Junior Playmaker
  • **
  • Posts: 69
    • View Profile
Get FSM variables locked to 1 FSM during runtime [SOLVED]
« on: January 22, 2019, 10:00:53 AM »
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, 03:35:59 PM by Alex Chouls »

djaydino

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

Can you show your fsm setup? video or images.

Mupp

  • Junior Playmaker
  • **
  • Posts: 69
    • View Profile
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #2 on: January 22, 2019, 12: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: 3645
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #3 on: January 22, 2019, 12: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

  • Junior Playmaker
  • **
  • Posts: 69
    • View Profile
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #4 on: January 22, 2019, 01:03:46 PM »
Great, sounds good.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3645
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #5 on: January 22, 2019, 07: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, 10:08:08 AM by Alex Chouls »

Mupp

  • Junior Playmaker
  • **
  • Posts: 69
    • View Profile
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #6 on: January 23, 2019, 06: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, 07:33:02 AM by Mupp »

Alex Chouls

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

Mupp

  • Junior Playmaker
  • **
  • Posts: 69
    • View Profile
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #8 on: January 23, 2019, 09:28:10 AM »
1.8.5 Havn't upgraded for a year or so.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3645
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #9 on: January 23, 2019, 10:06:56 AM »
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, 02:34:34 PM by Alex Chouls »

Mupp

  • Junior Playmaker
  • **
  • Posts: 69
    • View Profile
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #10 on: January 23, 2019, 10:19:39 AM »
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: 3645
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Get FSM variables locked to 1 FSM during runtime
« Reply #11 on: January 23, 2019, 02:36:40 PM »
Ok, please download again. Let me know if this fixes the issues you're seeing...

Mupp

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