Member
Volunteer Data File Author
Join Date: May 2008
Posts: 32
|
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 |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,214
|
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. |
#2 |
Member
Volunteer Data File Author
Join Date: May 2008
Posts: 32
|
mate
thanks for that I had to play around with it a bit but it works a treat now Mike |
#3 |
|
|