UPDATED OXPS: Lave 1.70 & transports 2.45(new)

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

Moderators: another_commander, winston

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

UPDATED OXPS: Lave 1.70 & transports 2.45(new)

Post by Kaks »

They're now happy to work together!

version numbers are now

Lave.oxp v1.70 - didn't have a readme or version number, 1.70 sounded like a good version number :)
Compatible with Oolite v1.65 and above

[EDIT:]
transports.oxp v2.45
Compatible with 1.65 and above.

Now compatible with Oolite 1.71-trunk.
Woma's escorts now fully present & alert!
The elusive moray transport is working ok and - if you've got both Lave & transports, you should be able to spot 3 slightly different models.
The Coral Liner now comes in a gold livery (in transports.oxp) as well as the traditional blue(in Lave.oxp).

More details in the readme files.

Here are the download files:
- Lave.zip v1.70
- transports v2.45

I just put them both on a faster server, so they should be easier to get now.

Any feedback, positive or negative, greatly appreciated. :D
Last edited by Kaks on Sun Mar 30, 2008 6:30 pm, edited 10 times in total.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2839
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Good work fixing stuff up! :D Could you maybe add links to the Wiki OXP page though. You don't need to reupload stuff, but it would be handy if the Wiki OXP page could stay the source of the lastest links to OXPs as that way everything is in one place.

http://wiki.alioth.net/index.php/OXP. ATM someone looking on the OXP page would get the old version of Lave. The Template has a box for comments (or you can add another page to describe the OXP more fully if you like). So its just pasting out the Old Link and adding the new.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
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 »

transports.oxp v2.2 - transports.oxp now uses javascript and requires oolite 1.70.
1.70 is not fully working. Specially escorts are not working, therefor a 1.70 minimum version is not wise. The old and new scripting systems work perfectly together I noticed.

When both scripting systems are put inside, 1.65 will still use the legacy scripting system and from version 1.69 is will switch to the new scripting system. Until we have a flawless Oolite version, old OXP's should stay available for 1.65

My next UPS release will work that way. One mission series is already converted to JS and tested.
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 »

LittleBear: I wasn't feeling too confident about doing that directly, but if it's ok with you guys... :)

Eric Walch: I didn't know I could put the 2 scripts side by side without any problems. Thanks about that!

I'll put script.plist back, add the extra moray code in plist format, & will release that as version 2.3 asap.

I won't bother putting 2.2 in the wiki since it's not going to be of much use to anybody!

Cheers,

Kaks
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Eric Walch wrote:The old and new scripting systems work perfectly together I noticed.

When both scripting systems are put inside, 1.65 will still use the legacy scripting system and from version 1.69 is will switch to the new scripting system.
Wow. It’s almost like someone planned it that way. ;-)

(Actually, I think dajt did this. But if he hadn’t, I would have.)
User avatar
Star Gazer
---- E L I T E ----
---- E L I T E ----
Posts: 633
Joined: Sat Aug 14, 2004 4:55 pm
Location: North Norfolk, UK, (Average Agricultural, Feudal States,Tech Level 8)

Post by Star Gazer »

Ahruman wrote:
Eric Walch wrote:The old and new scripting systems work perfectly together I noticed.

When both scripting systems are put inside, 1.65 will still use the legacy scripting system and from version 1.69 is will switch to the new scripting system.
Wow. It’s almost like someone planned it that way. ;-)

(Actually, I think dajt did this. But if he hadn’t, I would have.)
Wow! You guys will have to watch it, we'll be losing you to Microsoft to help them rewrite their software to work together properly... :wink:
Very funny, Scotty, now beam down my clothes...
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 »

:)

Ok, uploaded transports v2.3! Will update the wiki entries asap.

@Eric Walch:

I had a quick test with the svn version of oolite, (1.71) & the escorts seemed to work ok, so I've enabled javascript to run on versions >= 1.71.

As it stands, versions that don't understand javascript run script.plist, but 1.69 & 1.70 (the other versions I've got) don't run anything.... Is there a way to make it run script.plist based on version number? Or a way to enable the plist script from within javascript? I looked for it, but I couldn't find anything...

Cheers,

Kaks
User avatar
Commander McLane
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Kaks wrote:I had a quick test with the svn version of oolite, (1.71) & the escorts seemed to work ok, so I've enabled javascript to run on versions >= 1.71.
That's a little bit dangerous, as 1.71 is not a published version, so for the time being it will run only on your machine and perhaps on another_commander's. Nobody else has it.

Okay, that's just unconvenient for the rest of the world, not dangerous.

The dangerous part of it is that we don't yet know what bugs 1.71 will have when it will be published. Perhaps escorts will be broken for some other reason as in 1.70? Perhaps Very likely something else will be broken that prevents transports from running on 1.71. We just don't yet know.

But we know the following as a general rule: With every new test release (at least since 1.65) some bugs were fixed, and some new bugs were introduced that hadn't been there before. So you better don't rely on any functionality of 1.71 before it's released.

"It's difficult to predict. Especially the future!" (credited to a couple of people)
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 morning, Commander!

The reason javascript is only enabled in an svn version is exactly to avoid exposing innocent members of the public to my slightly dangerous code! :)

There's nothing in the code that actually depends on 1.71. It's easy to remove the inconvenience & expose yourself to danger by editing the beginning of Config\script.js and change:

Code: Select all

let minOolite="1.71";
to the same version of oolite you're running. assuming you've got 1.69

Code: Select all

let minOolite="1.69";
will do the trick!

By the way, All the script does that might be buggy (ymmv!) is

Code: Select all

system.legacy_addSystemShips('liner',1,.92);
and all the ships with role 'liner' are supposed to have escorts. As Eric Walch said,
1.70 is not fully working. Specially escorts are not working, therefor a 1.70 minimum version is not wise.
The escorts problem is there regardless of whatever type of scripting you do. If you remove script.js from transports\Config then the masses would be exposed to that bug - which would be triggered by the code present inside script.plist.

But it's a good point, why penalize developers/adventurous people who've got v1.69 for a problem present in v1.70. Thanks Commander McLane. I'll update it so that - by default, creating ships with escorts will be disabled only in oolite 1.70

v2.4 coming up!!!

[EDIT:] Eric, please disregard my question regarding enabling/disabling script.plist from javascript. As I was answering Commander McLane I realized that I don't want oolite to run script.plist when I disable script.js. Everyone's a winner! :P
User avatar
Ark
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sun Dec 09, 2007 8:22 am
Location: Athens Greece

Post by Ark »

Nice job Kaks. :)
I am downloading them now. If i detect something is wrong I will inform you.

When I told you that the asteroids was a bad choice I did not expected all those. Don't misunderstand Commander McLane (I totally agree with his point of view). His intentions are good but sometimes he exaggerates.

Now that you have the Little Bear's permission go for it
:wink:

You can find the optimized script code (By commander Eric) in
http://www.aegidian.org/bb/viewtopic.php?t=4178
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 »

I've just uploaded transports.oxp v2.4.

This last version should be compatible out of the box with 1.68 & 1.69.1 as well.

The js script adds the morays in a more random fashion than the plist, other than that they're identical. Will be added to the wiki shortly.

@Ark:No worries, I perfectly understand Commander McLane's point of view.
When you told me I had messed it up, the Voices Inside My Head(tm) where shouting more or less what he wrote on his posts.
Minus the working search forum button thing, though... Stupid Voices!;)

Cheers,

Kaks
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 »

v2.41: one more for the road. Improved the spread of the Moray transporters, and sorted out potential namespace conflicts in javascript.

To enable this script in 1.70, comment out line 9 in Config/sctipt.js:

from

Code: Select all

this.badOolite=["1.70"]; 
to

Code: Select all

//this.badOolite=["1.70"]; 
The new download file is here.
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,

Nice work. What we need are some good examples of working JS. This one will help with this.
1.70 is not fully working. Specially escorts are not working, therefor a 1.70 minimum version is not wise.
When I said escorts are not working I didn't mend that it will crash or something. Under 1.70 the mothership is just not able to send the escorts to the attacker because the internal function "deployEscorts" is not working. So they are an easy pray for an attacker. On being attacked escorted traders do always a flee themself and trust on his escorts to defend him. Only when the last escort is killed he will start defending himself. This means even a commander James can shoot an escorted trader as he never will fire back, nor the escorts.

It is possible to fix this in the AI with additional commands but when 1.71 comes out nobody will use 1.70 anymore.

Normally the OXP should also have a pirate-victim-roles.plist to make that pirates see them as pray. But for this OXP it is just theoretical as this option is introduced in 1.70 were the escorts don't defend the mother. For 1.71 these ships will be included in the plist inside oolite itself.

I noticed that the version.plist will not open with my plist editor. Meaning it has buggy syntax. But you did it in ascii plist and this one should be in XML plist. The function of this plist is to let old Oolite versions know that this OXP is to new for them. And old oolite versions only know XML plist

Version testing seems to work for transports, but in general will not work for 1.68 and 1.69. Those two have a very early JS implementation and don't recognise everything. I noticed that the JS script in hyperradio is rejected with syntax errors and my JS implementation in UPS is also rejected on syntax errors with those two versions. So the code that does the checking does not even run. Both OXP's load errorfree and run on 1.70 though. Meaning my binary version will work on 1.65 onwards, but not on testversions 1.68 and 1.69 (But that shouldn't be a problem as they are just test versions)

Than there is still a logistic bug in the script.plist. A lot of OXP's have this bug. When you add something on a launch you must make sure it only happens once otherwise repeated launching will keep adding ships. There are several ways to test this, but in this case the best would be to add a local variable:

Code: Select all

        {
            conditions = (
                "status_string equal STATUS_LAUNCHING", 
                "systemGovernment_number greaterthan 4", 
                "d100_number greaterthan 80",
	        "local_transports undefined"
            ); 
            do = ("addSystemShips: liner 1 0.92", "addSystemShips: fueltransport 1 0.8", "set: local_transports SETUP"); 
        }, 
Only the first launch after loading a game the ships are added on launch. After that, the local variable is defined and will prevent further additions. after a jump, the ships are already there and should not be added anymore on a launch. local_variables have a bug under 1.69 but then the JS version takes it over from legacy scripting
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 »

Thanks, Eric! :)

Good job you looked at it. I'm going to change requires.plist to the proper format, and correct the logic fault in the scripts. I didn't think about the ships multiplying whenever you leave the station, so that problem is inside javascript too!

About version testing, I used my own function (this.canRun()) that, as far as I know, should be able to deal with all the javascript versions of Oolite. Glad to know it works as expected with 1.69! :D

oolite.version and related functions were introduced in 1.70, so there is no easy way to tell - from javascript - which pre-1.70 version of oolite you're running.
As I was checking transports.oxp, I had 1.68 exit on syntax errors because I was declaring variables using 'let' (the officially sanctioned way to do so from oolite 1.70 onwards).
Before 1.70, the only way to declare a javascript variable was to use the keyword 'var' instead.
Quite a lot of the javascript stuff used before 1.70 is now deprecated/changed in quite a fundamental way: events/entities/whatnots.
I'm really glad we don't have to support 1.68 & 1.69 in a major way in the future... :D
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 »

v2.43!

leaving a station doesn't keep adding ships, required.plist is in XML form, and made script.js more compatible with 1.68 & 1.69

Added link to the new version here.
Post Reply