Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Army Builder Forums > Army Builder
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
harkan
Senior Member
Volunteer Data File Author
 
Join Date: Mar 2005
Posts: 345

Old January 28th, 2006, 02:21 AM
solution that seems to be workable: within the aug file have created a unitstat called orLimit, created an exclusion called orLimit that runs 0 - @orLimit

With the unit, added a line to prelink 'basestat[orLimit] = count[model]'

Added the exclusion to the item of orLimit set to #

This all seems to work, however the other issue is that each vehicle has 9 bits of vehicle equipment which would seem to mean I am going to need 9 exlcusions - is there a way round this?
harkan is offline   #11 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old January 28th, 2006, 03:54 AM
First of all, I'm glad that you got this working. :-)

If you have 9 different things that you want to apply exclusions to simultaneously, I'm afraid you will need 9 different exclusion groups and 9 different unit stats to handle this situation.

One alternative you can try is to use the SizeLimit script. Since you are looking to constrain the count of a child item, this might be a better approach if you've got a bunch of stuff to restrict. The SizeLimit script needs to be attached to the OPTION that ties the child entity to the parent. It allows you to specify the minimum and maximum limits for the entity size, with the limits derived based on the nature of the parent entity. For example, parent unit X can have 2-5 of the child, while parent unit Y can have 1-3 of the child. This sounds like it's the behavior you are looking for, so I recommend giving it a try. :-)

And now I need to get to bed.....

Hope this helps,
Rob

At 03:21 AM 1/28/2006, you wrote:

Quote:
solution that seems to be workable: within the aug file have created a unitstat called orLimit, created an exclusion called orLimit that runs 0 - @orLimit

With the unit, added a line to prelink 'basestat[orLimit] = count[model]'

Added the exclusion to the item of orLimit set to #

This all seems to work, however the other issue is that each vehicle has 9 bits of vehicle equipment which would seem to mean I am going to need 9 exlcusions - is there a way round this?
rob is offline   #12 Reply With Quote
harkan
Senior Member
Volunteer Data File Author
 
Join Date: Mar 2005
Posts: 345

Old January 28th, 2006, 04:56 AM
sorted - cheers for the steer about the sizelimit!!!!!

Have added in a set of tags that run orCount1, orCount2, orCount3

Unit has a prelink script as follows:

var retval as number
retval = delete[orTagsDy.?]

if (count[model] = 1) then

retval = assign[orTagsDy.orCount1]
endif

if (count[model] = 2) then

retval = assign[orTagsDy.orCount2]
endif

if (count[model] = 3) then

retval = assign[orTagsDy.orCount3]
endif

Each applicable option has in the sizelimit script:

@maximum = this.tagvalue[orTagsDy.orCount?]

Now, as soon as the user adds another vehicle the tag is changed to reflect this, when adding the vehicle equipment they cannot add more than is in the squad - I can now do away with the long list of exclusions etc and also roll this script into other areas
harkan is offline   #13 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old January 28th, 2006, 11:43 AM
Excellent! That's exactly the type of solution that I was envisioning you could use!!! :->

One thing to be aware of as you propogate the solution elsewhere. Remember that using the PreLinks script like this will only work if the unit itself does not have behaviors that force an evaluation restart. If so, then you could have problems getting the behavior you ideally want. The details on this are outlined in the docs, but it's an important thing to remember.

If you ARE bit by the above limitation, you can put the exactly same logic below into an option and then attach the option to the unit with a priority of zero, making it happen before anything else. This will achieve the same net result and avoid any issues with the PreLinks restart.

I point this out simply because the 40K files are much more complex than most of games and are therefore likely to have a number of units that force an evaluation restart due to that complexity. Consider this a preemptive answer to a likely question. :-)

-Rob

At 05:56 AM 1/28/2006, you wrote:

Quote:
sorted - cheers for the steer about the sizelimit!!!!! [img]./modules/mdforum/images/smiles/icon_smile.gif[/img]

Have added in a set of tags that run orCount1, orCount2, orCount3

Unit has a prelink script as follows:

var retval as number
retval = delete[orTagsDy.?]

if (count[model] = 1) then

retval = assign[orTagsDy.orCount1]
endif

if (count[model] = 2) then

retval = assign[orTagsDy.orCount2]
endif

if (count[model] = 3) then

retval = assign[orTagsDy.orCount3]
endif

Each applicable option has in the sizelimit script:

@maximum = this.tagvalue[orTagsDy.orCount?]

Now, as soon as the user adds another vehicle the tag is changed to reflect this, when adding the vehicle equipment they cannot add more than is in the squad - I can now do away with the long list of exclusions etc and also roll this script into other areas [img]./modules/mdforum/images/smiles/icon_smile.gif[/img]
rob is offline   #14 Reply With Quote
Reply


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 11:22 AM.


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