Im going to do my own script about hull repairs
But I don't know how to deal with arrays in iterations and try to add elements in an external array
Code: Select all
...
...
...
<do_all exact="$npcs.count" counter="$i">
<set_value name="$npc" exact="$npcs.{$i}"/>
<set_value name="$engValue" exact="$npc.skill.engineering"/>
<set_value name="$morValue" exact="$npc.skill.morale"/>
<set_value name="$workForce" exact="$workForce + $engValue + $morValue"/>
...
...
...
OR
...
...
...
<set_value name="$workForceList" exact="[]"/>
<do_all exact="$npcs.count" counter="$i">
<set_value name="$engValue" exact="$npc.skill.engineering"/>
<set_value name="$morValue" exact="$npc.skill.morale"/>
<append_to_list name="$workForceList" exact="$engValue"/>
<append_to_list name="$workForceList" exact="$morValue"/>
...
...
...
<set_value name="$workForce" exact="$workForce / $npcs.count"/>
This value must be 17.3333...
Is this the correct syntax to get NPC skills ?
And how to additionate all elements in "$workForceList" ?