Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Army Builder Forums > Army Builder

Notices

Reply
 
Thread Tools Display Modes
Taubay
Member
Volunteer Data File Author
 
Join Date: May 2008
Posts: 32

Old June 1st, 2008, 06:41 AM
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
Taubay is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old 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.
Mathias is online now   #2 Reply With Quote
Taubay
Member
Volunteer Data File Author
 
Join Date: May 2008
Posts: 32

Old 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
Taubay is offline   #3 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:06 AM.


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