And now I've written my first very own small JS-script, translating the Thargoid Carrier's script into JS. It works (so far).
I have added something that was not there in the original script. If the player somehow has managed to dock with the Thargoid Carrier, he will be launched immediatly, at the end of the tunnel-effect (shipDockedWithStation-event), before even seeing the F5-screen.
Script looks like this:
Code: Select all
this.shipDockedWithStation = function()
{
if (player.dockedStation.shipDescription == "Thargoid Carrier")
{
player.launch()
}
}
Sometimes (obviously depending on the order in which the scripts are executed) also other scripts were mentioned with the same exception.[script.javaScript.exception.39]: ***** JavaScript exception: TypeError: player.dockedStation has no properties
[script.javaScript.exception.39]: /Applications/Spiele/Oolite 1.71.2/Oolite.app/Contents/Resources/Scripts/oolite-nova-mission.js, line 40.
I guess it is caused by my Thargoid Carrier-script being executed before the other scripts (in this case the oolite-nova-mission script). So all the scripts are activated when I'm docking (to be precise: at the end of the tunnel-effect). The rest of the scripts (except mine) just find out that they have nothing to do on a Thargoid Carrier, and that's it. However, the oolite-nova-mission-script gets executed after my script. So at the time it runs, my ship has already been launched again, therefore I am no longer docked, therefore the exception. This is my interpretation.
My question is: Is this problematic? Can it be harmful in any way? At least a player, when looking into his logfile (or stderr), might think something is wrong here and send an error report, which I would like to avoid if possible.
EDIT: Oh, and once I also got this (unfortunately I forgot how). Anyway, nobody should accuse me of not following the polite request :
[general.error.inconsistentState]: ERROR: status is STATUS_DOCKED, but dockedStation is nil; treating as not docked. This is an internal error, please report it.