Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Progress

General discussion for players of Oolite.

Moderators: winston, another_commander

zevans
---- E L I T E ----
---- E L I T E ----
Posts: 332
Joined: Mon Jul 06, 2009 11:12 pm
Location: Uncharted backwaters of the unfashionable end of the western spiral arm

Post by zevans »

I KNEW it was the flashers. Good work!

This goes to show that misdirection is the <key>. #derrenbrown
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 »

Cache flushing is now asynchronous.

Or, to be a bit more concrete, startup times (especially on a “warm” cache) and delays in docking are shorter, potentially by several seconds.
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 »

Wrongness redacted.
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 »

Added the AI command: setCoordinatesFromPosition.
Coordinates is a vector variable that is only used by AI scripting. With this command one can store the current position in Coordinates and later in the script return to that position with the already existing command setDestinationFromCoordinates.

Added the JS property coordinates as a read/write value to ship. That way you can set it to any calculated value and than instruct the ship with the AI command setDestinationFromCoordinates to set this value as destination. Before we had only the AI command setCoordinates: x y z. And that command could only be used with fixed values.
Last edited by Eric Walch on Sat Sep 26, 2009 12:25 pm, edited 2 times in total.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

Just for clarity, will coordinates be in abs values? Thinking back to the fun and games in the past of abs values that weren't.
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 »

Thargoid wrote:
Just for clarity, will coordinates be in abs values? Thinking back to the fun and games in the past of abs values that weren't.
I had updated the wiki page for clarification but it is a vector parameter, like position: this.ship.coordinates = ([x, y, z]). Only setting coordinates does nothing itself, like the other AI commands that change coordinates. It will be the setDestinationFromCoordinates that sets the real destination to that value. This is in line with all other AI commands that use that approach.
This will make thinks like flying into the external docks of the buoy repair station much easier to script.
Last edited by Eric Walch on Sat Sep 26, 2009 12:23 pm, edited 1 time in total.
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 »

I don’t like the name, it sounds like it’ll change the position of the ship or something. How about targetCoordinates or savedCoordinates?
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 »

Ahruman wrote:
I don’t like the name, it sounds like it’ll change the position of the ship or something. How about targetCoordinates or savedCoordinates?
I was also not thrilled of the name setCoordinatesFromPosition but it was consistent with the existing: setDestinationFromCoordinates. And both are mend to be used in conjunction with each other. The first storing the coordinates and the second, later in the code, using the coordinates again.

..... Wait, you mean the coordinate property. You are right. savedCoordinates will be a more descriptive name and give less association with the ships actual position. (targetCoordinates will give an association with destination).
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 »

Thargoid wrote:
Just for clarity, will coordinates be in abs values? Thinking back to the fun and games in the past of abs values that weren't.
They're in internal coordinate system, which means abs..

The abs were, it's the planets & suns that kept moving about. Almost like in RL! :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
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 »

Two more scripting changes today:
planet.setTexture('foo') is going to be deprecated in 1.74 - it's being replaced by the read / write planet.texture property. You can now check which texture was applied to a specific planet.
Planet.texture returns null if no texture was applied.


And there's a new collection of read only properties attached to the Oolite object now: Oolite.gameSettings.foo allows OXPs to find out which game features are enabled.

In no particular order, the settings that can be queried are:
Oolite.gameSettings.autosave, wireframeGraphics, procedurallyTexturedPlanets, speechOn, reducedDetailGraphics, shaderEffectsLevel, musicMode. While most of the settings are just on/off switches which make the gameSettings properties return either true or false, the last two gameSettings properties return strings describing the specific settings their corresponding options have been set to. The wiki will be updated with the new info in a little while...
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Kaks wrote:
And there's a new collection of read only properties attached to the Oolite object now: Oolite.gameSettings.foo allows OXPs to find out which game features are enabled.
Yes! Thanks a lot :-)
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, quite a few things have happened on the javascript side of things inside trunk:

ship.forwardWeapon, ship.aftWeapon, ship.portWeapon, ship.starboardWeapon

these read-only properties return the Equipment Type for the weapon installed, or null if no weapon is installed at the specified facing.
On a fresh Jameson, player.ship.forwardWeapon.equipmentKey will return
'EQ_WEAPON_PULSE_LASER'
As NPC ships can only mount forward and aft weapons, the port and starboard properties will always return null.

ship.missileCapacity - read-only property, the maximum amount of missiles that the ship can carry. For NPCs, that's always equal to the number of missiles on board.

ship.missiles[] - array, read-only: all equipped missiles, external tanks, etc... are contained within as Equipment Types.
On a fresh Jameson player.ship.missiles[0].description would produce
'Faulcon de Lacy HM3 homing missile, fast and accurate when used in conjunction with standard targeting scanners.'

ship.equipment[] - array, read-only: all equipemnt listed on the f5 screen, excluding the main weapons. Equipment Types, of course. On a fresh Jameson, ship.equipment.length would be 0. Each equipment type property accessed via ship.equipment[n].property

-------

ship.passengers[] - array, read-only: all passengers are contained within as passenger objects, with the following structure:{name:string, start:systemID, destination:systemID,eta:clockSeconds, premium:credits, fee:credits, startName:systemName, destinationName:systemName, etaDescription:string}

ship.contracts[] - array, read-only: all cargo contracts are contained within as cargo objects, with the following structure:{quantity:int, commodity:string, start:systemID, destination:systemID,eta:clockSeconds, premium:credits, fee:credits, startName:systemName, destinationName:systemName, etaDescription:string}

Two new function have also been added:
ship.addPassenger(name, start, destination, eta, fee), and
ship.awardContract(quantity, commodity, start, destination, eta, fee)

example of usage: player.ship.addPassenger('Foo',0,7,clock.seconds+7*24*3600,1500)

If in galaxy 1, adds Foo as a passenger going to lave, who espects to be there 7 days from now, and will pay around 1500 credits on arrival (Oolite rewards early arrivals, penalises late ones).

-------

And finally, a long overdue change to the way js interacts with the player's cargo. There's now a new Manifest object, that can either be accessed using player.ship.manifest, or by simply typing Manifest.

Manifest['foo']: read/write property.
Replace 'foo' with any of the standard commodity identifiers, which are the lower case versions of the standard commodity names - as seen on the F8 screen. For 'Food' use Manifest['food'], for 'Alien Items' Manifest['alien items'], 'Liquor/Wines' Manifest['liquor/wines'], etc...

there's also
Manifest.list[] - array, read-only, lists all cargo types present in the hold with their quantities: {commodity:stringIdentifier, quantity:int, unit:string, commodityName:string}

As a direct result of working in this area, there are a few deprecations:

ship.availableCargoSpace & ship.cargoCapacity are now deprecated, the properties to use are now

ship.cargoSpaceAvailable, ship.cargoSpaceCapacity & ship.cargoSpaceUsed (unchanged from before)

Also deprecated are

canAwardCargo & awardCargo.

To add 5 tons of food, you can now type Manifest['food'] += 5; once the cargo bay is full, no extra cargo will be added onboard. And here's how you remove 2 kg of gold: Manifest['gold'] -= 2;

I think this covers the lot. Hopefully I didn't miss anything! :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
pagroove
---- E L I T E ----
---- E L I T E ----
Posts: 3035
Joined: Wed Feb 21, 2007 11:52 pm
Location: On a famous planet

Post by pagroove »

Wow Kaks. You Dev's really have a heart for this game 8) I'm no real scripter but it looks like a lot of added possibilities. 8)
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
https://bb.oolite.space/viewtopic.php?f=4&t=13709
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 »

Kaks wrote:
ship.missileCapacity - read-only property, the maximum amount of missiles that the ship can carry. For NPCs, that's always equal to the number of missiles on board.

ship.missiles[] - array, read-only: all equipped missiles, external tanks, etc... are contained within as Equipment Types.
On a fresh Jameson player.ship.missiles[0].description would produce
'Faulcon de Lacy HM3 homing missile, fast and accurate when used in conjunction with standard targeting scanners.'
I am wondering why missileCapacity is inconsistant across different ships, when missiles seems to be the more appropriate method to use for both player ships and NPC ships as well.
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 »

With the new cargo options, the last showstopper for owning multiple ships has disappeared.

Very good :twisted:
Post Reply