make engineers repair engines and jumpdrive of captured ships
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
make engineers repair engines and jumpdrive of captured ships
as the title says: is it possible to make engineers repair engines and jumpdrives of my captured ships? if yes: can somebody tell me how its done?
The drone launcher is the only system that needs a decent chance to be repaired "from the inside".
The other systems (engines would probably be a priority) can live with a tiny chance to get any repairs done at all.
The other systems (engines would probably be a priority) can live with a tiny chance to get any repairs done at all.
Last edited by Gazz on Sat, 23. Nov 13, 19:57, edited 1 time in total.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
actually its a 10% chance per second that a random component goes from status wrecked (destroyed) to 1% hull (status damaged)Kierk wrote:from looking into the engineer.ai script it looks like even with 0 repair chance (no drones, no launcher) there is supposed to be a 1/100 chance per second that a repair tic will occur. Looking into changing that as part of hull engineers mod.
<do_if value="$wreckedelements.count gt 0" chance="10">
<set_value name="$restoreindex" min="1" max="$wreckedelements.count" />
<restore_object object="$wreckedelements.{$restoreindex}" hull="1" />
<add_to_group groupname="$damagedelements" object="$wreckedelements.{$restoreindex}" />
<debug_text text="'Restoring ' + $wreckedelements.{$restoreindex}.knownname" chance="$debugoutputchance"/>
<remove_value name="$wreckedelements.{$restoreindex}"/>
</do_if>
it would make more sense to first repair critical systems like engines/jumpdrive/dronelauncher instead of a random component
Yeah. If there is an engineer to repair things, they can be repaired. Or at least jury-rigged to get to the next space port.
No-drone repairs should definitely be possible but it should take considerable time for a system to re-activate.
I can also see a max % to which systems can be repaired without drones.
It's never a good idea to create a situation where a ship is permanently stuck.
No-drone repairs should definitely be possible but it should take considerable time for a system to re-activate.
I can also see a max % to which systems can be repaired without drones.
It's never a good idea to create a situation where a ship is permanently stuck.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
There is no sense crying over every mistake. You just keep on trying till you run out of cake.
i changed the engineer.ai.xml to increase the chance that a random component gets repaired.
<do_if value="$wreckedelements.count gt 0" chance="100">
<set_value name="$restoreindex" min="1" max="$wreckedelements.count"></set_value>
<restore_object object="$wreckedelements.{$restoreindex}" hull="1"></restore_object>
<add_to_group groupname="$damagedelements" object="$wreckedelements.{$restoreindex}"></add_to_group>
<debug_text text="'Restoring ' + $wreckedelements.{$restoreindex}.knownname" chance="$debugoutputchance"></debug_text>
<remove_value name="$wreckedelements.{$restoreindex}"></remove_value>
</do_if>
this should repair a random component every second, with a chance of 100%
but nothing happens
<do_if value="$wreckedelements.count gt 0" chance="100">
<set_value name="$restoreindex" min="1" max="$wreckedelements.count"></set_value>
<restore_object object="$wreckedelements.{$restoreindex}" hull="1"></restore_object>
<add_to_group groupname="$damagedelements" object="$wreckedelements.{$restoreindex}"></add_to_group>
<debug_text text="'Restoring ' + $wreckedelements.{$restoreindex}.knownname" chance="$debugoutputchance"></debug_text>
<remove_value name="$wreckedelements.{$restoreindex}"></remove_value>
</do_if>
this should repair a random component every second, with a chance of 100%
but nothing happens
right now, for capital ships and only captial ships it seems, if there are no repair drones onboard then there is no repairs done.
base repair rate = 10
repair rate modifier = (1 per drone on board ) + ( num of drones * 0 to 4 depending on engineering skill of engineer)
actual repair rate = (base repair) * (repair rate modifier) / ( num wrecked items ) * ( num damaged items )
thus if drones = 0 then end repair rate = 0 no matter the skill of the engineer
zero or one star and the engineer gives no bonus to repair rate modifier.
without modding, a capital without drones never repairs.
base repair rate = 10
repair rate modifier = (1 per drone on board ) + ( num of drones * 0 to 4 depending on engineering skill of engineer)
actual repair rate = (base repair) * (repair rate modifier) / ( num wrecked items ) * ( num damaged items )
thus if drones = 0 then end repair rate = 0 no matter the skill of the engineer
zero or one star and the engineer gives no bonus to repair rate modifier.
without modding, a capital without drones never repairs.
just uploaded a fix for the stuck issue when the ship does have drones but they're not working.
for the no drone case look at this part of the code
note that repair rate factor starts at 0 and has drone values added to it, no drones no adding. Then it gets multiplied by a skill factor, no help if its 0. Finally it checks if its 0 and if so aborts repair and goes to check on repair again.
replacing line 95
with
should give you a small chance for 0 drone engineers to fix components. Bigger the number higher the chance and faster the repairs.
for the no drone case look at this part of the code
Code: Select all
<set_value name="$repairratefactor" exact="0" />
<do_all exact="unitcategory.welder.maxmk" counter="$i">
<debug_text text="this.container.units.{unitcategory.welder}.mk.{$i}.count + ' welders mk ' + $i" chance="$debugoutputchance" />
<set_value name="$repairratefactor" operation="add" exact="this.container.units.{unitcategory.welder}.mk.{$i}.count * $i" />
</do_all>
<set_value name="$repairratefactor" operation="add" exact="$repairratefactor * this.combinedskill / 25" comment="skill factor between 1 and 5" />
<do_if value="$repairratefactor == 0">
<resume label="checkforrepair" />
</do_if>
replacing line 95
Code: Select all
<set_value name="$repairratefactor" exact="0" />
Code: Select all
<set_value name="$repairratefactor" exact="1" />
problem is that if repairratefactor is 0 it still wont repair.
look under the "do repair"
final repair rate for any damaged module is:
[baserate] * [repairratefactor] / sum of wrecked and damaged components
if repairratefactor = 0 then it will cycle through the repairs doing nothing and never leaving the repair process to check for components again.
look under the "do repair"
final repair rate for any damaged module is:
[baserate] * [repairratefactor] / sum of wrecked and damaged components
if repairratefactor = 0 then it will cycle through the repairs doing nothing and never leaving the repair process to check for components again.
Base repair-rate 0.1 per sec. Only engines & dronebay and only up to 10% hp
If engineer aboard WITHOUT drones, slightly increased repair-rate and priority to dronebay. Only up to 10% hp
Moddable / doable?
Also. If part is blown up, add a two min CD before the repair can start. By the time ive blown the engines its back to shooting the jumpdrive and then speed-shooting the engines again.
If engineer aboard WITHOUT drones, slightly increased repair-rate and priority to dronebay. Only up to 10% hp
Moddable / doable?
Also. If part is blown up, add a two min CD before the repair can start. By the time ive blown the engines its back to shooting the jumpdrive and then speed-shooting the engines again.
http://forum.egosoft.com/viewtopic.php?t=354081
This will do what you want.
Altho the first time youll blow up something, it might repair somewhat quickly (due to how inverted the repair time is for performance reasons in my script). But its only the first time, after that, it cannot rebuild / repair anything for the next ~30secs (exact value depend on engineer skills).
This will do what you want.
Altho the first time youll blow up something, it might repair somewhat quickly (due to how inverted the repair time is for performance reasons in my script). But its only the first time, after that, it cannot rebuild / repair anything for the next ~30secs (exact value depend on engineer skills).
The URV launcher should be able to be repaired by a ships engineer (get in a space suit, grab a welding torch and a wrench and get out there !). Perhaps it could be a 50% slower repair rate than a drone.
Similarly, ALL subsystems should be repairable by a spacesuited engineer, just at a much slower rate than by URV repair drones.
Perhaps in future the engineers could even have an additional skill for "Manual repairs" or something similar, to improve their repair rate in the absence of drones.
Similarly, ALL subsystems should be repairable by a spacesuited engineer, just at a much slower rate than by URV repair drones.
Perhaps in future the engineers could even have an additional skill for "Manual repairs" or something similar, to improve their repair rate in the absence of drones.