Cmdr Wyvern wrote:No mission variable(s) used. It uses a list of repairable kit, and timers and percentage checks to do the fixing.
Then the critical question is (and this is what I wanted to say in my post): All timers are cleared and deleted when you quit Oolite. Is the one responsible for repairing the DCN itself automatically restarted by the script when you re-open your save-game later?
If not, then the DCN will never be repaired.
EDIT: Yes, that's exactly what I see in the script.
damageNodeTimer is started when the DCN gets damaged, and will repair it after some time. However, if you quit your current game and reload it again later, the DCN is already damaged while you're loading the game, therefore
damageNodeTimer is not started again, and therefore no repairs are done every again from that point onwards. So it's a bug in the script.
The fix is simple: just add the following code to the script:
Code: Select all
this.startUp = this.reset = function()
{
if(player.ship.hasEquipment("EQ_DCN_DAMAGED"))
{
this.damageControlTimer.stop(); delete this.damageControlTimer;
this.damageNodeTimer.start()
this.damageNodeTimer = new Timer(this, this.restoreNode, 0, 60)
}
}
This checks whether you loaded a commander with a broken DCN. If yes, the self-healing starts.
The alternative would be (and that's why I asked for a mission_variable) to set a mission_variable to true while the DCN is still out of work. Then you would have to check for this mission_variable on every restart of the game, and only delete it after the repair is finished. But of course you can just as well check for the presence of the broken DCN right away, like in my code.