• 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

Assigning tags dependent upon option

I have a unit with options for three Weapons: Gauss Rifle, Naginata or Sniper Rifle.

If the Gauss Rifle or Naginata are selected then the unit will be a compulsory choice and have a tag of type.Retainer

If the Sniper Rifle is selected then the unit will not be compulsory and thus cannot have the tag type.Retainer

At the moment the Sniper Rifle choice is a separate unit entry because I cannot figure out how to assign the type.Retainer tag when only the Gauss Rifle or Naginata options are selected. Or is it best to assign a unit tag of type.Retainer anyway, and try to delete it whenever the Sniper Rifle option is selected? And if that is the case then how do I go about it?

Thanks
 
you can use the Eval script of the options to add or remove tags:

Code:
var result as number
result = unit.assign[type.Retainer]

or

Code:
var result as number
result = unit.delete[type.Retainer]
 
Excellent. Many Thanks!

I volunteered to work on this data file with absolutely no knowledge of XML and managed to finish the file using the minimum amount of coding.

Now it's finished I've taken it upon myself to go through the file and try to simplify things for the users as much as possible - unfortunately that means a lot more coding for me!!

So thanks a lot for the quick and extremely helpful response!! No doubt there'll be more silly questions before I'm finished!
 
Back
Top