Engineers repair so:
Code: Select all
<set_object_hull object="$Defensible" exact="$Defensible.hullpercentage + $addedhullpercentage" />
...
<set_object_hull object="$CurrentElement" exact="$CurrentElement.hullpercentage + $addedhullpercentage" />
Code: Select all
<repair_object buildmodule="$BuildModule" sequence="$sequence" stage="$stage" hullfraction="$fraction" buildlimit="$buildlimit" updatebuild="true"/>
...
<repair_component buildmodule="$BuildModule" component="$component" hullfraction="$fraction" />
Code: Select all
<set_value name="$component" exact="event.param2.{1}" />
<set_value name="$sequence" exact="event.param2.{2}" />
<set_value name="$stage" exact="event.param2.{3}" />
<set_value name="$fraction" exact="event.param2.{4}" />
<set_value name="$buildlimit" exact="event.param2.{5}" />
News: changing this:
Code: Select all
<set_object_hull object="$Defensible" exact="$Defensible.hullpercentage + $addedhullpercentage" />
Code: Select all
<repair_component buildmodule="$Defensible" component="$Defensible" hullfraction="$Defensible.hullpercentage" />
which I think to mean that:debuglog wrote:[=ERROR=] Error in AI script engineer.ai on entity 0x4f640: Evaluated component 0x4f5e2 'Unknown Station' is not of class buildmodule
* Expression: $Defensible
changes in engineer.ai.xml are immediately active requiring no further in-game changes,
and that ships and stations need to be defined as buildmodules.
_____
and so as to not scare the tourists: this applies to a little experiment I'm doing prompted by an idea by a couple of folks here to make the engineers, particularly station-based engineers (all of them, including those working for NPC factions) use resources to initiate repairs. The file uploaded works as advertised in the OP.