playMaker

Author Topic: 'Set Fsm String' in Sub FSM doesn't work locally...  (Read 1170 times)

Abelius

  • Junior Playmaker
  • **
  • Posts: 68
'Set Fsm String' in Sub FSM doesn't work locally...
« on: June 01, 2021, 08:45:08 AM »
Hi there,

As the title implies, I'm trying to set a local Fsm String var by using the Set Fsm String action, instead of the Set String Value.

I do this, because I want to run a loop to get those variable names (there are quite a lot), and then set their values according to the loop logic.

This works when used on a "proper" FSM, but not when used inside a Sub FSM.

Looking into the action code I can see it searchs for an FSM component (?), and then runs a FindVariable method, so finding by name is possible.

So, I guess a Sub FSM it's not really a full FSM that could be found, right? Therefore it's not possible to take this approach to find a local variable name in a SubFSM.

Is there an alternative way to reference the running SubFSM?

Thanks.
Unity 2019.4.9f1
Playmaker 1.9.7f1

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: 'Set Fsm String' in Sub FSM doesn't work locally...
« Reply #1 on: June 01, 2021, 09:17:03 PM »
Hi.
By Sub FSM do you mean templates used with Run fsm action?

I can't find any Sub FSM action or component.

Abelius

  • Junior Playmaker
  • **
  • Posts: 68
Re: 'Set Fsm String' in Sub FSM doesn't work locally...
« Reply #2 on: June 02, 2021, 05:58:35 AM »
Yup, that's it.

Edit: I've been using Run FSM for a while and observed some other side effects of doing so, like not been able to switch to the Variables tab without a ton of errors showing up on the console.

I'd also like to know why that happens (it makes troubleshooting variables in ran template FSMs much harder), but in this specific case my question is about how to "find" the ran template, so I could reference the local variables on it.

If that's even possible, that is.
« Last Edit: June 02, 2021, 07:22:06 AM by Abelius »
Unity 2019.4.9f1
Playmaker 1.9.7f1

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: 'Set Fsm String' in Sub FSM doesn't work locally...
« Reply #3 on: June 02, 2021, 10:30:28 AM »
Hi.
i don't think you can reference a run fsm.

What i do is use Set Fsm (int/float/etc.) action and set it on a variable where the run fsm is on, or on a certain  'Meta Data' gameobject/fsm

Then i can reference it from other fsms.