Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   Army Builder (http://forums.wolflair.com/forumdisplay.php?f=16)
-   -   tricky script question [fixed] (http://forums.wolflair.com/showthread.php?t=7618)

Taubay June 1st, 2008 06:41 AM

tricky script question [fixed]
 
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

Mathias June 1st, 2008 11:04 AM

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.

Taubay June 1st, 2008 12:29 PM

mate

thanks for that

I had to play around with it a bit but it works a treat now

Mike


All times are GMT -8. The time now is 09:49 AM.

Powered by vBulletin® - Copyright ©2000 - 2022, vBulletin Solutions, Inc.
wolflair.com copyright 1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.