Username:


Password:


Remember me


  • Find Us On Facebook



How can i change the maximum selection of an option

Have a question about how to do something in the datafiles? Ask it here, we'll help if we can. NOTE: We cannot teach you how to use ABCREATE or how our files work, we don't have the time.

How can i change the maximum selection of an option

#1  Postby hasturspawn » Tue Sep 11, 2007 3:07 pm

Hi,

i'm pretty new to programming and so did fare pretty well. There is one thing that i was not able to found. How to change the maximum number of selection for an option based on a unit size.

exemple: if the unit is between 1 and 9 models, only one option, and if 10 or above, 2 options... etc

thanks in advance
User avatar
hasturspawn
Recruit
Recruit
 
Posts: 1
Joined: Mon Aug 27, 2007 12:00 am

#2  Postby osman » Wed Sep 12, 2007 4:39 pm

This usually involves making a new 'unit stat', and a new 'exclusion group'. There are a few examples in the existing data files, but you have to start by editing your race's AUG file (not the DAT file). Add a new unit stat (myStat).

Then go to excl groups, and add a new group (myExclGrp), with a min of 0 (or whatever), and a max of @myStat.

Now, use myExclGrp as the exclusion group for your option link in the unit. In the pre-link script for the unit, set unit.basestat[myStat] to whatever the maximum should be, based on any logic at all.

Like (if you want to allow a second choice once there are at least 10 models in a unit):

if ( unit.count[effective] >= 10 ) then
unit.basestat[myStat] = 2
else
unit.basestat[myStat] = 1
endif
User avatar
osman
Recruit
Recruit
 
Posts: 6
Joined: Thu Aug 10, 2006 12:00 am


Return to Datafile Programming Support

Who is online

Registered users: No registered users

cron