Here is what I'm trying to use.
Code: Select all
<diff>
<replace sel="/aiscript[@name='engineer.ai']/attention[@min='unknown']/actions">
<actions>
stuff
</actions>
</replace>
</diff>
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
Code: Select all
<diff>
<replace sel="/aiscript[@name='engineer.ai']/attention[@min='unknown']/actions">
<actions>
stuff
</actions>
</replace>
</diff>
Code: Select all
<diff>
<replace sel="/aiscript[@name='engineer.ai']/attention[@min='unknown']/actions">
<actions>
<show_help force="true" custom="'my stuff should be doing stuff'" />
stuff
</actions>
</replace>
</diff>
Code: Select all
<wait exact="$repairfrequency">
<interrupt>
<conditions>
<check_any>
<event_object_destroyed group="$operationalelements" />
<event_object_destroyed group="$damagedelements" />
<event_unit_destroyed object="this.container" category="unitcategory.welder" />
</check_any>
</conditions>
<actions>
<!-- recalculate repair per second -->
<do_if value="event.name == 'event_object_destroyed'">
<append_to_list name="$wreckedelements" exact="event.object" />
<show_help force="true" custom="event.object.knownname + ' destroyed, adding to list of wrecked objects - current count: ' + $wreckedelements.count"/>
</do_if>
<do_elseif value="event.name == 'event_unit_destroyed'">
<set_value name="$repairratefactor" operation="subtract" exact="event.param2 + (event.param2 * this.combinedskill / 25)" />
</do_elseif>
</actions>
</interrupt>
</wait>