• 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

tricky script question [fixed]

Taubay

Active member
Hi Guys

I have a question about creating a Minimax script for profiles

Basically the rule set I am working on has various profiles and the amounts of units that can be picked for some profiles is dependent on the amount of units selected in another profile

For example
I have a profile called core units, and the user can select between 2 and 4 units from this profile
I have a second profile called support that allows 0 – 2 units to selected for every 2 units selected in the core profile

i.e. if a user selects 2 core units, then 4 support units can be selected

So is there any way to count the number of units that have been selected in a profile as I can use that figure to set the @maxvalue in the minimax script

Cheers

Mike
 
untested:

var core as number
core = tagcount[profile.Core]
~use whatever tag group you're using to designate Core and Support units there.

core = core/2

~round down
core = round(core,0,-1)
~now, core = how many pairs of core units we've selected
core = core*2
~and now it's the maximum support choices allowed
@maxvalue = core


just make sure the profile tag group is accrued.
The minimum value is of course zero, but that can be set outside the script.
 
Back
Top