Further questions Engineer.ai script

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

Kierk
Posts: 115
Joined: Wed, 30. Oct 13, 16:38

Further questions Engineer.ai script

Post by Kierk »

Thanks to Jack08 I'm now sure my replaces are not merging with the main file. The UIData log tells me there are path errors.

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>
Any idea what I'm doing wrong?
Nebogloee
Posts: 69
Joined: Sat, 18. Aug 07, 00:15
x3tc

Post by Nebogloee »

You can also use "show_help" as a debug tool:

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> 
Kierk
Posts: 115
Joined: Wed, 30. Oct 13, 16:38

Post by Kierk »

Yeah, that is what Jack08 recommended. I finally figured it out, I was putting the show_help in parts that don't really help. Once I put it in the right spot in the repair loop it started showing up.

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>
I changed the debug output to a show_help output and it properly records when i destroy surface components on my Taranis.

Next I'm going to try to add the main ship's hull to the list of elements to repair and see if that takes.

Thanks for the help folks!

Return to “X Rebirth - Scripts and Modding”