playMaker

Author Topic: Return value from FSM templates  (Read 2008 times)

nFighter

  • Beta Group
  • Full Member
  • *
  • Posts: 174
    • multiplayer adult fighting
Return value from FSM templates
« on: July 16, 2018, 10:25:54 AM »
Hey, fellas! It looks like I don't completely understand a workaround with FSM Templates.
I can expose variables from template so, I run the template with some input. But how to GET values from template back to the current state machine? (I understand it could be solved with global variables, but I'm trying to avoid millions of global vars)
indie developer of multiplayer adult fighting
http://nakedfighter3d.com

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Return value from FSM templates
« Reply #1 on: July 16, 2018, 12:55:45 PM »
Hi.
Maybe instead of getting them, use 'Set Fsm actions' to set the values on the current state machine and when done (if needed) use a send event.


Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3998
  • Official Playmaker Support
    • LinkedIn
Re: Return value from FSM templates
« Reply #2 on: July 16, 2018, 02:07:04 PM »
We're adding Output variables to templates in the next update.

PM me if you're interested in joining the beta group.

nFighter

  • Beta Group
  • Full Member
  • *
  • Posts: 174
    • multiplayer adult fighting
Re: Return value from FSM templates
« Reply #3 on: July 16, 2018, 04:21:37 PM »
Hi.
Maybe instead of getting them, use 'Set Fsm actions' to set the values on the current state machine and when done (if needed) use a send event.
But is that a way to check what StateMachine is "current" right now? I could run the FSM template from a lot of places... 

Anyway, I'm using a similar idea. "set FSM actions" on a "database" fsm object, and then taking the values from it. It's exactly like a global variables but a little bit cleaner...
indie developer of multiplayer adult fighting
http://nakedfighter3d.com

nFighter

  • Beta Group
  • Full Member
  • *
  • Posts: 174
    • multiplayer adult fighting
Re: Return value from FSM templates
« Reply #4 on: July 16, 2018, 04:22:14 PM »
We're adding Output variables to templates in the next update.

PM me if you're interested in joining the beta group.

Sounds interesting! I'm in!
indie developer of multiplayer adult fighting
http://nakedfighter3d.com

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Return value from FSM templates
« Reply #5 on: July 18, 2018, 04:55:37 AM »
We're adding Output variables to templates in the next update.

PM me if you're interested in joining the beta group.

Sounds interesting! I'm in!

Pm me with a google email address, we'll add you.

 Bye,

 Jean