• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Script assigned tags

harkan

Well-known member
Is there an easy way to add a tag that holds a value, i.e. chTrack.chCount5 or chTrack.chCount10, depednant upon the number on the squad instead of having to have a procedure that goes something like:

if (count[model] = 1) then

retval = unit.assign[chTrack.chCount1)
endif

....

if (count[model] = 5) then

retval = unit.assign[chTrack.chCount5)
endif

etc etc

For a small unit it is no great prob, but for the Chosen this can go up to 20+. The current solution adds a tag for each member but again I would prefer to not to have that many tags. Something like:

retval = unit.assign[chTrack.chCount*]

where the * could be the model count??
 
There is no way to do this using tags. However, the equivalent handling is automatically done for you whenever you use unit stats. For every unit stat, an appropriate tag group is defined, and a separate tag for each value of the stat is automatically generated on the fly by AB. When the stat value changes, the corresponding tag is changed. This means that whenever you set the stat value, a tag with the corresponding value is always present for the unit.

So the trick below is to define a private unit stat with the model count in it. You can then access the automatically maintained tag within the unit to perform tag expression tests on the value. This ought to yield exactly what you're looking for with a lot less hassle.

Hope this helps,
Rob

At 04:09 AM 2/9/2006, you wrote:

Is there an easy way to add a tag that holds a value, i.e. chTrack.chCount5 or chTrack.chCount10, depednant upon the number on the squad instead of having to have a procedure that goes something like:

if (count[model] = 1) then

retval = unit.assign[chTrack.chCount1)
endif

....

if (count[model] = 5) then

retval = unit.assign[chTrack.chCount5)
endif

etc etc

For a small unit it is no great prob, but for the Chosen this can go up to 20+. The current solution adds a tag for each member but again I would prefer to not to have that many tags. Something like:

retval = unit.assign[chTrack.chCount*]

where the * could be the model count??
 
Back
Top