playMaker

Author Topic: local variable management within a state  (Read 4569 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
local variable management within a state
« on: May 13, 2012, 12:29:29 PM »
Hi,

 Within a state, you sometimes need to create several variables that really only exists for that particular state, and it is cumbersome and tedious.

 I think this can be improved by the Ui hint system and provide an additional small button on the right ( where you can toggle from a manual variable to the list of existing variable) and actually present the user with the ability to simply give a name to that variable placeholder, and this name he created simply is a local variable belonging and accessible only within that state, other actinos following the declaration do have access to it ( the variable could be listed with the rest, and followed with (local) just like global variables are followed with (global)

This way, we don't have to create all them variables at a fsm level, where they are really only used in a given State.


 I am aware this would add another level of complexity for beginners, and could add more confusion... But from a  daily bases/heavy usage of playmaker, this would really lift a big issue. I really weight the pros and cons of doing something in Playmaker because I do miss this ability to have to create all them variables for such a limited usage ( when I know it would be quicker to script it because of that limitation), first this make the variable ilst of a Fsm messy, and it becomes very tedious when you want to change the actual feature defines in that state, and delete obsolete variables, recreate new ones, test, find you need another way of doing it, etc etc... local variables would go away as soon as you remove the action, or actually select another variable in the related ui field.


 Bye,

 Jean

Jos Yule

  • Playmaker Newbie
  • *
  • Posts: 33
Re: local variable management within a state
« Reply #1 on: May 14, 2012, 01:03:05 PM »
+1

Might also be useful (and i know this adds complexity to the UI as well) to "promote" vars you have defined this way to FSM local vars, rather then just State Vars.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: local variable management within a state
« Reply #2 on: May 14, 2012, 04:10:54 PM »
Hi,

 Well, I did not go into much details about this, but really you could simply save at the end of the state action list, that local variable back into a normal variable, like save int to a fsm, action, you would just use that action,

https://hutonggames.fogbugz.com/default.asp?W90

and it could be use both ways, either to inject a variable value into a local variable or the opposite.

So your case would work totally out of the box, because the local variable concept would have to be implemented one level before the action, so for actions it would be completly transparent ( of course, I am not really of all the implication of this assumptions...)


 Bye,

 Jean

Jos Yule

  • Playmaker Newbie
  • *
  • Posts: 33
Re: local variable management within a state
« Reply #3 on: May 16, 2012, 09:40:04 AM »
Right right, didn't even think of the "Set Var" action, but that would totally work.

Nice.

merlinlain

  • Playmaker Newbie
  • *
  • Posts: 3
Re: local variable management within a state
« Reply #4 on: May 23, 2012, 12:47:11 AM »
+1  ;D

Disastercake

  • Full Member
  • ***
  • Posts: 101
  • www.disastercake.com
    • Disastercake
Re: local variable management within a state
« Reply #5 on: June 07, 2012, 09:26:29 PM »
I would have to add that to keep these less confusing they would need to reset their contents to their default values after leaving the state.

+1 to this. 

It does get annoying having to reset these variables constantly and manage them in complex FSMs. 
Soul Saga - Anime themed adventure RPG by Disastercake

http://www.disastercake.com