playMaker

Author Topic: Local variables shared between states?  (Read 1738 times)

mathius777

  • Playmaker Newbie
  • *
  • Posts: 38
Local variables shared between states?
« on: March 02, 2014, 07:40:45 PM »
Has anything like this been added yet? I saw this forum poist 2 years ago that spoke about a feature.

http://hutonggames.com/playmakerforum/index.php?topic=1723.0

I thought perhaps in all that time there would have been a solution. It would be REALLY nice to be able to share variables between states.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Local variables shared between states?
« Reply #1 on: March 03, 2014, 07:49:51 AM »
It's not implied that other hierarchical scripts/FSMs will be inheriting local variables. I think its better to default to this way but there are definitely some good reasons to have them shared on a case by case basis, I don't know if Alex has made any progress on this front though.

It would be cool to have a "Sync" option in the FSM tab or something that you could specify syncing local variables with other FSM's. There's all kinds of gotcha's and hazards in this but if done right could really make communication between more complex systems much simpler, especially AI. I have some FSM's that do nothing but work as liason's sharing variables between scripts and I know others often use a Proxy that keeps a ton of variables on an object so others can point to a common place to get the data.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Local variables shared between states?
« Reply #2 on: March 03, 2014, 11:56:27 PM »
Hi,
 
For this scenario, I use a "META fsm" at the top of that hierarchy and I keep these "local" variable all there. any fsm in that hierarche is given the "right" to get and set theses variables. It's of course arbitrary, but since you are the one developing it, it's ok to enforce that kind of rules.

bye,

 Jean