• 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

Author Question - Army Builder for Firestorm Armada - Carrier Wings

veritechc

Member
Carrier wing Validation

I need to make a validation of fighter wings, called Fleet Wings, on any ship that can carry those wings.

Rules:

Any ship that carries wings has a Fleet Wing rating (FW)

That ship can have that number of wings or none.

If it does take wings it must have all the same kind of wings.

As far as I can tell I need a validation rule that looks at the FW rating of the ship and allows no wings to be a valid condition.

It also has to look at the FW rating and have that number of wings as valid.

Lastly it has to check the winds added and make sure they are all of the same type.

It would be useful if when you added wings it automatically added wings that were equal to the FW rating.

Here is the link to a minimal set of rules that anyone can download to help me with this.
http://www.theblackocean.com/resources/Firestorm/Army Builder/Firestormtest.zip

Thank you for your help!
 
Hello,

If I understand your need, the ship can have 0 or its Fleet Wing rating number of the same type of wings.


Did you try an option with Incr and size min/max settings ?

For this :
1. Create a group wingsNb with tags:1, 2, 3, 4, ...

2. Create an option with EVAL Script:
var val as number
var sel as string
sel = "wingsNb." & selection
val = unit.assignstr[sel]

SIZE Script:
@minimum = tagvalue[wingsNb.?]
@maximum = tagvalue[wingsNb.?]

with a CANDIDATE script filled with the wings type and * in child entity.


3. Link the option to every ship with both Incr and Max set to the Fleet Wing rating.

.def said:
<group id="wingsNb" width="5" name="Wings Number">
<value id="0"/>
<value id="1"/>
<value id="10"/>
<value id="2"/>
<value id="3"/>
<value id="4"/>
<value id="5"/>
<value id="6"/>
<value id="7"/>
<value id="8"/>
<value id="9"/>
</group>

.dat said:
<option id="AAShip" name="SHIPPPPPP" abbrev="" category="addships" priority="0" cost="0" unit="*">
<evaluate><![CDATA[var val as number
var sel as string
sel = "wingsNb." & selection
val = unit.assignstr[sel]]]></evaluate>
<sizelimit>@minimum = tagvalue[wingsNb.?]
@maximum = tagvalue[wingsNb.?]</sizelimit>
<candidate>validation.wings</candidate>
</option>

Link template for a Fleet Wing rating of 4:
.dat said:
<link option="AAShip" rangemax="4" rangeincr="4" index="0"></link>


The user can choose only one type of wings, and it is automaticaly set to the Fleet Wing rating number.

NOTE : If you can have 0, 1, 2, ..., Fleet Wing rating wings, just remove the Incr from the previous template.

Hope This helps,

Frédéric
 
Back
Top