Hi,
While this is perfectly fine to do, I strongly advice against this kind of design pattern, you are mixing two different context and it's dangerous and prone to massive headache and tricky bugs down the road.
what you want here is at the very least a hashtable ( using ArrayMaker) where you reference values against keys.
Your key is an totally part of your data. Trying to give you an example outside programming, it's like or family name which used to represent us, maybe what we do, where we live, our character, something that defined us so that other could reference us in a discussion, that was a long, long time ago, now our language as evolved and reached such a level of complexity that we have separated reference ( our family name) and how we are defined in society. Same with our name and nickname, it roots into something that defines us ( or we believe it does... depends your beliefs), but it really creates problem down the road because it's too restrictive...
It's like you would go to your local administration and wanted to chance your name to "PlayMaker Programmer", but is that enough to define you (
) no, you are also maybe a father, definitely a son or a daughter, you are maybe a sportsman, someone that play Chess, have a political preference, a religion, what should be your name then if your name defines what you are or what you do?
enters variable naming:
Variable Name: Variable Value
Name: Jean
Family Name: Fabre
Sex: Male
Job: The best in the world
Marital status: Married
nationality: French
yes, you should name your variable in plain english and in a meaningfull way, but remember, that when compiled or optimized, the name of the variable is compressed into a unique value because really it's a pointer, nothing else: typical example, javascript minification:
https://en.wikipedia.org/wiki/Minification_(programming)
We are simply lucky that inside PlayMaker, variables name are also treated as variable, because it's a framework that works on top of c#.
but, I hear you say: but then how can I programmatically find your name, I need to get the variable labeled "Name". well, one way is to hardcoded this in your logic, but then if you need flexibility, you then switch to a hashtable ( using ArrayMaker on the Ecosystem)
Key: value
"Name": Jean
"Family Name": Fabre
"Sex": Male
"Job": The best in the world
"Marital status": Married
"nationality": French
and the keys become something you can query, get a list of as strings, and get the value associated with that key. The Key become part of your data.
If you are ok with programming, you can also use Enum, which is a special c# type of variable which lets you create a list of references, which can then be used in your logic without fearing messing up with a typo, because with the hashtable above, you could mistype "Nationality" where it's without cap "nationality" and so your logic would not find the key and fail to give you the value you expected.
PlayMaker has an FsmEnum, and I created a wizard that lets you create enums without coding
http://hutonggames.com/playmakerforum/index.php?topic=14158.0To learn more about enums usage: check here for example
http://stackoverflow.com/questions/3519429/what-is-main-use-of-enumerationBye,
Jean