• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Help wanted on unit/sub-unit army file writing problem

I am trying to write a set of files, and I'm running into a problem with one of the requirements.

One of the unit types can carry/possess a number of sub-units.

For example:
unit 1 may be able to carry 1 of sub-unit x, or y, or z, with x as default.

Unit 2 may be able to carry 6 of sub-unit x, y, or z in any combination, with x as default.

I want to be able to set the system up so that n of the default appears when the unit is selected.
If one of the other options is selected then that appears as sub-unit size 1 on the roster, and the default sub-unit is reduced by 1 automatically.
If a sub-unit size reduces to 0 it is removed from the roster, but can be reinstalled (at size 1) by reselecting it.

In this way the "proper" number of sub-units is reatined, and the roster appearance is O.K.

To add to the problems some of the sub-units take up double or triple slots. So in the example above, of Unit 2:
If sub-unit y takes up 3 normal slots, then Unit 2 could have:
6 of x,
2 of y,
6 of z,
or 1 of y + 2 of x + 1 of z.

Any help please?
 
Exclusion groups are made to give you the option selection behavior you want. You'll notice that in the edit link dialog, you can choose the amount each option takes out of each exclusion group.

You'll just put ranges on the options that select sub-units, ex: Min 0, Max 1.

So, your unit x option, when placed on unit 1, would use 1 from exclusion group "unit1", and when placed on unit 2, would instead use 1 from exclusion group "unit2". You would also make this option the remainder option for its exclusion group. Making the unit y option cost 3 is also easy.

Then, once you have your selection behavior implemented, just add the correct child entity to each of your options.

One note: you don't say if it's alright to have less than the max of your sub-units. If unit 2 is allowed to carry 5 units of x and nothing else, you'll have to have a dead option, called, say "Use less than the max" to get the behavior you want.
 
you can have the second unit decrease the count of the first unit and then hide the first one when it gets to count 0 - but as mghel says you haven't specified if the units can be less than the full count
 
Thanks for the input guys.
I think that has set me on the right path.

I did some experimentation last night, and managed to get close to the required behaviour by using the '@' character when setting up the exclusion group, and '#' in the option usage of the exclusion group.

When a sub-unit had to count twice was more of a problem, because 2# or #x2 doesn't work.
However putting # in the option, and then using a unit exclusion of # does give a double count. A bit of a kludge, but as long as it works...

I'm not sure whether taking less than the permitted total is allowed or not, but I think if the users are daft enough not to take everything they are allowed when it's free, then who am I to stop them.

Thanks for the help, it's got me out of a real hole.
 
Go into the edit link screen on the option that adds the unit - there's an exclusion groups listing on the right side. It shows each of the available exclusion groups, and their Min, Max, and the usage for this unit. If you've linked the option that adds your sub-units in as a range based link (Min 0, Max 3, for example), then putting in a usage of 2 will make it count double against your exclusion group.
 
Back
Top