Senior Member
Volunteer Data File Author
Join Date: Mar 2005
Posts: 345
|
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? |
#11 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
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:
|
|
#12 |
Senior Member
Volunteer Data File Author
Join Date: Mar 2005
Posts: 345
|
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 |
#13 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
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:
|
|
#14 |
|
|