View Single Post
Garfunkel
Senior Member
Volunteer Data File Author
 
Join Date: May 2005
Location: Grenoble, France
Posts: 167

Old February 2nd, 2012, 04:13 AM
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.

Quote:
Originally Posted by .def
<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>
Quote:
Originally Posted by .dat
<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:
Quote:
Originally Posted by .dat
<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
Garfunkel is offline   #2 Reply With Quote