• 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

Enabling an option on a count condition

SomeAuthor

New member
Hello,

I am adding some campaign stuff to a set of data files (all my changes are in an .aug and a .dat file).

Basically, I define a new unit; the user will add one of this unit to his roster, and everything related to the campaign is part of this unit. Let's call the unit "treasury".

One of these things are "campaign points". Users can earn these points during gameplay, and will then simply increase the option/stat "campaign points" of the treasury.

Now, I want to enable (ungrey/show) some option A of the treasury only if there are 5 or more campaign points in the treasury.

How do I do this?

I fooled around a lot with exclusions and live tags, but simply could not get it to work. What is the usual way to do this?

Thanks!
 
Last edited:
First, add a tag in your augmentation file, called "points5" or something similar. Then, in the option eval script for the "campaign points" option, do something like:

Code:
if (this.selection >= 5) then
  perform parent.assign[somegroup.points5]
  endif

This will assign the "points5" tag to the unit when you've selected 5+ points.

Then, set the live expression of option A to:

Code:
val:somegroup.points? >= 5

This means "check the points tag - if it has a value of >= 5, make the option live". You can add similar "points10" or "points15" tags if you want to control other options the same way with more points. (Option A must have a larger priority than the points option for this to work).

Hope this helps!
 
Thank you.

After my post, I wrapped my mind around the tag concept (sometimes it helps to RTFM ;) ), which made everything so much easier.
 
Back
Top