Addendum :
Changing the engineer check to 30s on my current gaming box (i7 6700k+980ti) i didnt see any spikes in cpu usage running vanilla 4.0b3 with this mod only active. Cpu use stayed at 6.5-7% for a full minute watching the taskmanager.
If anyone would like to test this out then replace AddSmallShipEngineers.xml contents :
Code: Select all
<?xml version="1.0" encoding="utf-8" ?>
<mdscript name="AddSmallShipEngineer" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
<cues>
<!-- main cue to add the engineer as create_ship will refuse this on non capital ship types -->
<cue name="Yorrick_AddEngineer" instantiate="true" namespace="this">
<conditions>
<event_cue_signalled/>
</conditions>
<actions>
<set_value name="$Ship" exact="event.param"/>
<do_if value="$Ship.engineer" negate="true">
<create_cue_actor name="$engineer" cue="this">
<!-- this controls visible or invisible engineer. Any faction but xenon makes the engineer a visible listed crew member -->
<select faction="faction.plutarch" tags="tag.engineer"/>
<!-- then set the computer/crewman to belong to the ships owner faction-->
<owner exact="$Ship.owner" />
</create_cue_actor>
<set_entity_type entity="$engineer" type="entitytype.engineer" />
</do_if>
<do_if value="$engineer?">
<assign_engineer object="$Ship" actor="$engineer" />
<do_if value="$engineer.container">
<start_script object="$engineer" name="'engineer.ai'" />
</do_if>
<!--<remove_cue_actor actor="$engineer" cue="this" />
<remove_value name="$engineer" />-->
</do_if>
</actions>
</cue>
<!-- cover existing games and job ship spawns -->
<cue name="Yorrick_AddEngineer_ExistingShips" instantiate="true" namespace="this">
<conditions>
<check_any>
<event_game_loaded />
<event_cue_signalled cue="md.Setup.GameStart"/>
</check_any>
</conditions>
<actions>
<debug_text text="'Starting timed cue for astromechs.'" filter="error" chance="100"/>
<set_value name="$NextCheck" exact="player.age+10s"/>
</actions>
<cues>
<cue name="Yorrick_AddEngineer_TimedCheck" checkinterval="30s">
<conditions>
<check_value value="$NextCheck lt player.age" />
</conditions>
<actions>
<debug_text text="'Testing timed cue for astromechs.'" filter="error" chance="0"/>
<find_ship groupname="$SMShips" multiple="true" class="[class.ship_s,class.ship_m]" space="player.galaxy"/>
<do_all exact="$SMShips.count" counter="$i" >
<do_if value="$SMShips.{$i} != player.primaryship">
<debug_text text="'calling cue to add astromechs.'" filter="error" chance="0"/>
<signal_cue_instantly cue="Yorrick_AddEngineer" param="$SMShips.{$i}"/>
</do_if>
</do_all>
<set_value name="$NextCheck" exact="player.age+30s"/>
<reset_cue cue="Yorrick_AddEngineer_TimedCheck"/>
</actions>
</cue>
</cues>
</cue>
</cues>
</mdscript>
For reference the current AI repairs to 60% base with 0 start engineer up to 90% with 5 star.