Dynamically choosing an attribute based on values...possible???
beaudoin_n
Member Posts: 184
Hi,
I am trying to save about a bezillion keystrokes with this cry for help.
I created attributes .. a lot of attributes with number coding
Is it possible in my object to have 2 attributes , a and b
assign them each a value
a=1
b=2
And then use that to incorporate in a rule
Rule
If game.ab = x then
this would translate to my game attribute called game.12
So the rule would become
if game.12 = x then
I hope i ask clearly and correctly.. sometimes i type as if i talked.. specially when in english.
Thanks again for your help.
I am trying to save about a bezillion keystrokes with this cry for help.
I created attributes .. a lot of attributes with number coding
Is it possible in my object to have 2 attributes , a and b
assign them each a value
a=1
b=2
And then use that to incorporate in a rule
Rule
If game.ab = x then
this would translate to my game attribute called game.12
So the rule would become
if game.12 = x then
I hope i ask clearly and correctly.. sometimes i type as if i talked.. specially when in english.
Thanks again for your help.
Comments
So a = 10, b = 2
rule if game.a + game.b (12) = x then
i would think this would work.
game.12
game.34
game.17
game.11
And i want to assign one of those based on the condition of a and b
so if a=1 and b=2 i want to assign game.12 to x
but if a=3 and b=4 i want to assign game.34 to x
or i want to have rules like
if game.12 > 99 display text bla
if game.12 = something then destroy
etc...
so since my group will want to check against this game.12 attribute when a=1 and b=2
I'd like to be able to go something like
game.'a''b'
or even
game.tata'a'bobo'b'
resulting in game.tata1bobo2
If you don't want to change 'a' into a ten's place edition of the value (i.e. maybe you already are using the one's place digit values all over in your project), you could just change the conditionals to something like:
if ((game.A * 10) + game.B) = 12 then...
Similar things are done to emulate a set of flags for an entity but they usually do it in Base 2 instead of Base 10 so you can use boolean logic for bit position testing and such.