UPS-Courier

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

davcefai wrote:
You're a good man Commander Walch!
Thanks, but you also seem to be a fair pilot that has mercy with moonshining programmers. I see that "mission_ups_ecount = 1". Meaning you rescued such a programmer. Therefor my thanks.

"mission_ups_slaverescue = YES" , Also on behalf of all slaves: thank you. I see it has already fixed a system for the slavemissions. So be prepared for your first slave mission sending you to Qubeor. It just needs one more triggering event. But seeing your reputation you won't miss that.
User avatar
davcefai
---- E L I T E ----
---- E L I T E ----
Posts: 400
Joined: Sun Dec 03, 2006 9:07 pm

Post by davcefai »

The updated version worked. Recruits captured and I'm on my way to Quebor - a bit of a long way round 'cos I promised Little Bear I'd knock off this objectionable character quite a few jumps ago.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

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.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Today I uploaded version 1.3.2 op UPS courier.

Functional no changes to 1.2.x but now 4 out of 5 mission series are translated into Java script. All 4 translations are play-tested. The javapart is only usable from version 1.70 upwards. For normal players no need to update yet, but testers should download it to bugtest the JS implementation of Oolite.

UPS-Courier

Changes:
- Created a standard function for mission screen display.
- Excluded all tickle events for showing missionscreens. Leading to putting up multiple screens without any delay. (just one single tickle event left for a in-flight event)
- Added a sendScriptMessage event in one of the station AI's. This indeed gives very nice possibilities for the future. With this command you call a script function and in this way you can create your own AI commands.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Good to see those functions being used 'out there'! :)

Way to go javascript! :D
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Kaks wrote:
Good to see those functions being used 'out there'! :)
Way to go javascript! :D
Yes, when I saw that you are handling the missionscreen setup in a self-defined function I directly knew this was the right way to do things.

While writing the plist-script I often wished I could make use of functions. But while translating I just went on to translate things one-to-one. There was no time to think about changing a working structure. On that I look now.

e.g. leaving out the tickle event for mission offering as I did in the last version makes me dependent of getting a "missionscreenEnded" event when I skip setting up my own. Now I realise I need a backup system in this case. It could be the tickle event, but I think using a timer will do the same and will respond quicker as a arriving of tickle event could take up to 10 seconds.
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

[quote="Eric Walch"]Today I uploaded version 1.3.2 op UPS courier./quote]

AVG thinks it's a virus, something to do with the file being an incorrect size.
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

TGHC wrote:
AVG thinks it's a virus, something to do with the file being an incorrect size.
Strange. For me everything is alright. Downloaded it yesterday and checked (as always) for viruses. Maybe your download was not correct. Have you tried it again?
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

Downloaded again.
AVG bounced it again with the comment - "corrupted archive - wrong original size"

it was something like 722k of 755k.
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

TGHC wrote:
Downloaded again.
AVG bounced it again with the comment - "corrupted archive - wrong original size"

it was something like 722k of 755k.
Probably a bug in the wiki software. I first uploaded version 1.3. In wiki I have the opportunity to update the old version with a new one. Advantage of this method instead of completely uploading a new one is that the references within wiki to the file stay the same. It also changes my uploaded name to the name of the original one. Somehow wiki stores the original length for the file. (1.3 was 776 K and 1.3.2 is 788 k on my computer).

I have uploaded this way a lot and never found anything wrong. The files were always extractable. Getting this kind of messages is annoying. I just re-uploaded it as new file and change the references in the download area to the new file. It should be OK now.
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

It still bounces!!! but I've ignored the warning now though.

I notice that you've named it V1.32.zip now, thanks for your efforts, it may just be my system, no-one else seems to have had a problem.
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

Not only your problem

Post by Lestradae »

The newest version does not unpack correctly on my system too.

It does not find something and throws out four lines of "could not unzip blabla something missing".

I have Windows Vista, Pentium IV.
User avatar
davcefai
---- E L I T E ----
---- E L I T E ----
Posts: 400
Joined: Sun Dec 03, 2006 9:07 pm

Post by davcefai »

FWIW I successfully unzipped this file under Debian Linux.

I also redownloaded and unzipped it successfully using Winzip10 and Windows 2000 running in a Virtual Machine.

Could it be a Vista related problem?
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

I'm running XP
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

TGHC wrote:
It still bounces!!! but I've ignored the warning now though.

I notice that you've named it V1.32.zip now, thanks for your efforts, it may just be my system, no-one else seems to have had a problem.
Please download it again. I always zip my files with StuffIt. This is the most popular zipper for mac users I think. It ships with the Mac installation disk. But Mac OSX nowadays has itself an menu option to archive files. This also makes a zipfile. By using the same folder as before to zip, it created a 50 kb greater file. So they are different. Please also download this file (I called it version 1.3.2a) and see if this behaves better. When so, I'll switch to this zipper in future, if no difference I stay with the old method that makes smaller files. (The size difference it probably only the addition of mac related stuff).

I left both files for download this time.: UPS-Courier

Mac and windows use a different file structure and it always has been difficult to make an universal file. When fully windows compatible it will miss certain aspects on the mac. So there is extra information for the mac users. Not all window un-zippers seem to handle this extra information the same way.
Post Reply