Is it possible to access object's instance variable by its name?
Say I have an object monster with instance variables param1, param2, param3, [...] param10
I want to do something like this
for x=1 to 10
monster.Variable("param" & loopindex) = random(1000)[/code:2fnu5ayr]
[code:2fnu5ayr]if monster.Shield>0 then MyVar="Shield"
else if monster.Armor>0 then MyVar="Armor"
monster.Variable(MyVar) = // some complex calculations here to apply damage to monster's shield or armor or base health[/code:2fnu5ayr]
I'm guessing there is no built-in functionality for this.. Maybe there is a plugin or some workaround?