I ask because I use name like this:
if(src.HP<=src.MAXHP*0.8) //Changes src icon_state
src.icon_state="[src.name]_Wounded"
is this safe??
is there anything that changes the name variable?? I mean besides directly changing it myself.
I ask because I use name like this: if(src.HP<=src.MAXHP*0.8) //Changes src icon_state is this safe?? |
Dec 20 2016, 1:41 pm
|
|
I don't think you should have much problem doing that, but I'm wondering: why must name be prefixed there?
|
Because I have some buildings with varying degree of damage and I have named them like
Build01 Build01_Dmg1 Build01_Dmg2 Build02 Build02_Dmg1 .... so the name of the initial icon_state could be stored into name variable. Well I could also name Build01 to Build01_Dmg0 and just change the last number with string manipulation |