I just uploaded a new version 1.3 of UPS-courier. This one is not useful for normal players of Oolite 1.69 or older as it will do exactly the same as version 1.2.3. It will however work on 1.65
In this version two mission series (out of 5) are translated to Java Script. For the other missions the legacy script will be used. On 1.65 all missions will run under Legacy scripting. I think I have tested now all mission parts without bugs. Testers of Oolite 1.70 should use this so the new Java scripting system becomes really tested.
I explicitly say: this version will not work under 1.68 or 1.69 as these versions try to use the new scripting system but will encounter JS functions they were not implemented in those versions. If you do use them you will be briefed in a message how to solve the conflict.
As an addition for Oolite 1.70 users I have included an OXP that only runs with 1.70 and replaces the trader and miner AI's for one that does work under 1.70. (Miners finding rocks and traders deploying their escorts). I assume that for 1.71 this will be fixed in the code itself.
Goto:
UPS-Courier page
----
EDIT
Comment on the scripting is appreciated as I am new to JS and this script will be an example for others I think.
Rereading yesterday what Ahruman wrote some months ago in the mission offering topic, I changed the code handling. (Not yet in the uploaded version)
During the "tickle" I only checked for mission offers. I now completely removed the "this.tickle" and put all the offering checks in a new function: "this.ups_missionoffers = function()"
This new function I call in the "this.shipDockedWithStation" and at the end of "this.missionScreenEnded" when I handled the answers of previous screens. This last makes sure a second screen is immediately put up after the first on multiple screen messages. Just have to check if everything also works well with other system messages on docking. (scripted pilots, cargo/passenger messages, captured/rescued pilots etc)
The only thing I now miss is checking the offers immediately after loading a saved game. One has to launch and re-dock to get the offer when one was pending. In the old system I got a tickle after 10 seconds of waiting with a just loaded game. At the "this.reset" moment the loaded variables are still undefined and thus can not be used for this check. When timers get installed one can set a timer with this.reset. On second thought: "this is not relevant". I use special prepared saved games for mission testing that do the offer after loading. A normal player will never get the change to save a game before the offer comes so there won't be a pending offer in a saved game.