View Single Post
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old February 28th, 2006, 05:16 PM
I'm referring to unit stats here - NOT tags. Every unit stat automatically has a tag assigned to reflect that value, but you can't modify those tags directly. You have to modify the unit stat, which will automatically modify the tag.

To assign a new unit stat value, you should use the "stat" target for the unit within a script. For example, you can say: "unit.stat[move] = 6". This will assign the value '6' to the "move" stat of the unit.

If you have implemented the size as a unit stat, then just change the value using the method above. If you have implemented it as just a tag, then you can replace the tag using the technique you outlined below.

-Rob


At 08:17 AM 2/28/2006, you wrote:

Quote:
Evalute scripts I'm getting better with. But how does one set a specific stat to a value? If a unit has a tag of size.sz1 and I want to change that to size.sz2, what is the syntax to do that in a evalute script?

Figured it out. For others trying that:

var size as number
size = unit.delete[size.?]
size = unit.assign[size.sz2]
rob is offline   #9 Reply With Quote