The Oolite Extended Project - Fork, no oxp

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

Moderators: winston, another_commander

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

Re: ..

Post by Lestradae »

@pmw57:
pmw57 wrote:
I am working on that part now, as we speak. How do you want this to work. For each of the A to L stations (being the first of the three chars) what bounty increase do you want. +5 for A, +30 for B, etc...
Wow, that's quite the teamwork! :D

OK:

A & B: Do nothing

C: Raise player bounty 5 points per jump if (see McLane's post) * the jump actually arrives in another system and not interstellar space

D: Raise player bounty 20 points per jump * (-> see above)

E: Lower player bounty 3 points per jump *

F: Raise player bounty 40 points per jump *

G: Lower player bounty 6 points per jump *

H: Raise player bounty 70 points per jump *

I: Do nothing

J: Lower player bounty 12 points per jump *

K & L: Lower player bounty 6 points per jump *

@McLane:

Suggestions taken aboard. Will soon test - when pmw57's translation is done - how anarchies and the crime lord player stations interact ...

Cheers everyone

L
pmw57
---- E L I T E ----
---- E L I T E ----
Posts: 389
Joined: Sat Sep 26, 2009 2:14 pm
Location: Christchurch, New Zealand

Re: ..

Post by pmw57 »

Lestradae wrote:
@pmw57:
pmw57 wrote:
I am working on that part now, as we speak. How do you want this to work. For each of the A to L stations (being the first of the three chars) what bounty increase do you want. +5 for A, +30 for B, etc...
Wow, that's quite the teamwork! :D

OK:

A & B: Do nothing

C: Raise player bounty 5 points per jump if (see McLane's post) * the jump actually arrives in another system and not interstellar space

D: Raise player bounty 20 points per jump * (-> see above)

E: Lower player bounty 3 points per jump *

F: Raise player bounty 40 points per jump *

G: Lower player bounty 6 points per jump *

H: Raise player bounty 70 points per jump *

I: Do nothing

J: Lower player bounty 12 points per jump *

K & L: Lower player bounty 6 points per jump *

@McLane:

Suggestions taken aboard. Will soon test - when pmw57's translation is done - how anarchies and the crime lord player stations interact ...

Cheers everyone

L
The translation is done - but don't get excited! Testing is underway.

The testing at this stage is that the jog doesn't throw javascript errors, and that I can play HoOpy. After that it'll be handed over for a general inspection.
A trumble a day keeps the doctor away, and the tax man;
even the Grim Reaper keeps his distance.
-- Paul Wilkins
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

..

Post by Lestradae »

The whole OSE-XML.plist? :shock:

Too late, I'm already impressed.

And inspect it I will. Thanks muchly for your work already :D

L
pmw57
---- E L I T E ----
---- E L I T E ----
Posts: 389
Joined: Sat Sep 26, 2009 2:14 pm
Location: Christchurch, New Zealand

Re: ..

Post by pmw57 »

Lestradae wrote:
The whole OSE-XML.plist? :shock:

Too late, I'm already impressed.

And inspect it I will. Thanks muchly for your work already :D
You're very welcome.

There was a lot of repetition in there of course, and the tough stuff like respawning ships, well - regular expressions are a wonderful tool for reformatting those.

Anyway, as soon as I find a place where a HoOpy Casino should be, and play a game of it with the updates script, it'll be winging its way on to you.

Gotta first get my priorities straight though, where's my free drinks!
A trumble a day keeps the doctor away, and the tax man;
even the Grim Reaper keeps his distance.
-- Paul Wilkins
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

Re: ..

Post by Lestradae »

pmw57 wrote:
where's my free drinks!
You're not living next to vienna, are you?

Otherwise you'd not find your way home again after getting what you asked for above :twisted:
pmw57
---- E L I T E ----
---- E L I T E ----
Posts: 389
Joined: Sat Sep 26, 2009 2:14 pm
Location: Christchurch, New Zealand

Re: ..

Post by pmw57 »

Lestradae wrote:
pmw57 wrote:
where's my free drinks!
You're not living next to vienna, are you?

Otherwise you'd not find your way home again after getting what you asked for above :twisted:
Sadly no, New Zealand is my habitat, but I'll think of you if I ever do find my way near where you are.
A trumble a day keeps the doctor away, and the tax man;
even the Grim Reaper keeps his distance.
-- Paul Wilkins
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

..

Post by Lestradae »

Do that, just in case it ever really happens, the free drinks seriously won't be far behind :D
Chaky
Deadly
Deadly
Posts: 213
Joined: Sat Aug 15, 2009 6:15 am

Post by Chaky »

Tell you what.. I'll upload my translation of OSE-XML.plist for comparison.


Edit: And here it is! I might upload few translated files more in a near future.

The translation seems OK, but I don't guarantee it. All it takes is one rouge <key> to make the translation gibberish.
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 »

Err, it's still not optimized, and it's still in legacy script format.
Though it's easier to read, once Oolite loads the .plist in memory there's absolutely no difference between the one you just posted, and the one originally inside OSE.


Lestradae, I'd hold out for the js conversion! :)
Last edited by Kaks on Fri Oct 02, 2009 11:57 am, edited 1 time in total.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: ..

Post by Commander McLane »

Lestradae wrote:
... Lower player bounty <insert number here> points per jump ...
I assume you are taking measures to make sure that it doesn't end up below 0?
pmw57
---- E L I T E ----
---- E L I T E ----
Posts: 389
Joined: Sat Sep 26, 2009 2:14 pm
Location: Christchurch, New Zealand

Re: ..

Post by pmw57 »

Commander McLane wrote:
Lestradae wrote:
... Lower player bounty <insert number here> points per jump ...
I assume you are taking measures to make sure that it doesn't end up below 0?
Yes thank you. My recent exposé of the commodity screens has opened me up to that possibility.

Before the bounty adjustment is added, the bounty plus the adjustment is checked to see that they fall below zero. If they do, it's just zeroed instead.
A trumble a day keeps the doctor away, and the tax man;
even the Grim Reaper keeps his distance.
-- Paul Wilkins
pmw57
---- E L I T E ----
---- E L I T E ----
Posts: 389
Joined: Sat Sep 26, 2009 2:14 pm
Location: Christchurch, New Zealand

Post by pmw57 »

Well for what it's worth the conversion has taken place.

My knowledge of how missions are supposed to be scripted ranges from light to variable, so I've only had intermittent success in starting hOopy.

Better results have been had with other things, like adding ships. The values have all been made consistent.

If for example a ship appears in system in a system that's tech level 8 or more, the comparion isn't made with > 7 but instead with >= 8. However, if the javascript number for the techLevel is off-by-one from the in-game display, that idea might need to adjusted.

Likewise, it's silly to check if a random number is greater than 65. That has a 35% chance, so instead check if it's less than 35 and the code is more understandable.

Code: Select all

if (system.techLevel >= 8 && Math.random() * 100 < 65) {
	system.legacy_addSystemShips('clipper-rescueship', 1, 0.9);
}
Anyway, it's after 3am and my brain is running somewhat slower by now, so please take the ose.js script and let me know how the mission screens can be fixed.

This is my first foray into scripting for oolite, so there is going to be vast amounts of in-game techniques that I'm missing out on. Stop sniggering in the back, I can see your shoulders shaking! The script can't be all that bad :?

http://www.box.net/shared/dodzb27djm
A trumble a day keeps the doctor away, and the tax man;
even the Grim Reaper keeps his distance.
-- Paul Wilkins
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

.

Post by Lestradae »

Hi guys,

Thank you all very much for your input!

@Chaky:

You did translate it to OpenStep, not java script! So I will use the java script version, of pmw57! :(

@Kaks:

The info that legacy scripts are that much slower is a very relevant one in my opinion, especially today where the game contents get bigger and bigger and more complex at that. Perhaps I am the last one to really get this, but would it not make sense then to translate to java script the oxp scripts that are still legacy and then deprecate scripts in legacy code completely? Just my 0.2Cr.

@Commander McLane:

Thanks for the tip. The below zero thing is one that I have overlooked on numerous occasions now, last time when giving some ships the possibility for optional passenger cabins at sale, which had less than 5 tons cargo space ... it pays to keep an eye on such things 8)

@pmw57:

All hail the hero of the java script! From idea to actual first translation beta it took him what? Four hours? To translate a 15000 lines legacy script :shock:

Someone here from New Zealand? Buy the guy a drink, and a stiff one at that! :D

I will this evening go through the OSE-XML.plist and its OSE.js translation step by step and no doubt come up with loads of questions here, also playtest if everything works. Until then,

cheers everyone

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

Nice job pmw57,

Only the clipper job your could have done easier: just download the latest version 1.1. That one already contains a js translation:

Code: Select all

this.shipExitedWitchspace = function()
{
    if(!system.isInterstellarSpace && system.techLevel > 7 && Math.random() > 0.35)
    {
        system.legacy_addSystemShips("clipper-rescueship", 1, Math.random()*0.4 + 0.5);
    }
} 
It actually does a bit more than the original script: it prevents ships being added in interstellar space. That is a bug that is often present in scripts.
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 »

The info that legacy scripts are that much slower is a very relevant one in my opinion, especially today where the game contents get bigger and bigger and more complex at that. Perhaps I am the last one to really get this, but would it not make sense then to translate to java script the oxp scripts that are still legacy and then deprecate scripts in legacy code completely?
Once the next stable release comes out, we might well deprecate legacy scripts, but at least until then, no. All oxps that used to run ok on the last stable version (1.65) should still run ok with the next stable version too. Besides, one of the reasons Oolite 1.73 & before are still test releases is that the js scripting environment isn't yet finalised, even though it's already faster than the old one.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Post Reply