Progress

General discussion for players of Oolite.

Moderators: another_commander, winston

User avatar
Cmdr. Maegil
Sword-toting nut-job
Sword-toting nut-job
Posts: 1294
Joined: Tue Feb 27, 2007 10:28 pm
Location: On the mend in Western Africa

Post by Cmdr. Maegil »

Ahruman wrote:
Cmdr. Maegil wrote:
Does this mean I can make the missile variants OXP work?
Dunno. What does it do? :-)

This. :?
(Oh, and by “now works” I meant “should now work”, I haven’t tested it yet.)
Oh!...
You know those who, having been mugged and stabbed, fired, dog run over, house burned down, wife eloped with best friend, daughters becoming prostitutes and their countries invaded - still say that "all is well"?
I'm obviously not one of them.
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 »

As far as I can see, that has no connection to shipyards whatsoever…
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6554
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

And as far as I can tell, it works already in 1.71.2 ;-)
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:

Post by Commander McLane »

Ahruman wrote:
Note to localizers: "equipment-not-available" = " (N/A)" has been replaced with "equipment-@-not-available" = "%@ (N/A)".
Noted (and implemented).
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 »

Working on splitting Split player JS object into two, player and player.ship. Tthe following properties and methods are still in player:
  • name
  • score
  • credits
  • alertCondition
  • alertTemperature
  • alertMassLocked
  • alertAltitude
  • alertEnergy
  • alertHostiles
  • trumbleCount
  • specialCargo
  • contractReputation
  • passengerReputation
  • increaseContractReputation()
  • decreaseContractReputation()
  • increasePassengerReputation()
  • decreasePassengerReputation()
  • commsMessage()
  • consoleMessage()
The following properties and methods have been moved to player.ship, along with everything inherited from Ship and Entity:
  • fuelLeakRate
  • alertCondition
  • docked
  • dockedStation
  • specialCargo
  • galacticHyperspaceBehaviour
  • galacticHyperspaceFixedCoords
  • awardEquipment()
  • removeEquipment()
  • hasEquipment()
  • equipmentStatus()
  • setEquipmentStatus()
  • launch()
  • awardCargo()
  • canAwardCargo()
  • removeAllCargo()
  • useSpecialCargo()
  • setGalacticHyperspaceBehaviour()
  • setGalacticHyperspaceFixedCoords()
The equipment-related ones will probably be moving up to Ship at some point.

This is the last major scripting-related change I expect to do before MNSR. I want to go over all the property and method names for consistency, though.

Edit: hmm, that was surprisingly easy. I wonder what I’m missing.
Last edited by JensAyton on Mon Jul 28, 2008 5:14 pm, edited 1 time in total.
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:
hmm, that was surprisingly easy. I wonder what I’m missing.
specialCargo. Probably a missing deletion in player.
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:
specialCargo. Probably a missing deletion in player.
Indeed. (Also, I’m working on compatibility forwarders. There are a lot…)
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 »

Because JavaScript 2.0/ECMAScript 4th Edition will have a built-in class named Vector, I am renaming Oolite’s JS Vector type to Vector3D. Vector will continue to work in 1.72 and probably 1.73, but will later be removed. Unlike other compatibility aliases, there will be no warning messages if you continue to use Vector; your code will just stop working in 1.74.
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 »

Added bounty back to player as well as player.ship, since it’s conceptually a character trait rather than a ship trait.
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 I understand correctly that the division into player and player.ship is the basis for owning more than one ship becoming possible, Ahruman? :shock:
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: ...

Post by JensAyton »

Lestradae wrote:
Do I understand correctly that the division into player and player.ship is the basis for owning more than one ship becoming possible, Ahruman? :shock:
No. The distinction doesn’t exist in the game code itself, only the scripting interface.
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 »

Ahruman wrote:
Because JavaScript 2.0/ECMAScript 4th Edition will have a built-in class named Vector, I am renaming Oolite’s JS Vector type to Vector3D. Vector will continue to work in 1.72 and probably 1.73, but will later be removed. Unlike other compatibility aliases, there will be no warning messages if you continue to use Vector; your code will just stop working in 1.74.
Additionally, I’m phasing out the ability to use lists of numbers instead of vectors or quaternions except in constructors, for forwards compatibility with the type system in JavaScript 2.0. (Anyone seeing a pattern here?) Hwever, you will still be able to use an array. Example:

Code: Select all

var v = new Vector3D(1, 2, 3);  // will continue to work
var u = v.add(4, 5, 6);         // will generate a warning and later an error
var w = v.add([7, 8, 9]);       // will continue to work
Thus, in future a vector expression will be any of:
  • A Vector3D
  • An Entity
  • An array of three numbers.
Similarly, a quaternion expression will be one of:Or, in JavaScript 2.0 terms:

Code: Select all

type VectorExpression = (Vector3D! | Array! | Entity!);
type QuaternionExpression = (Quaternion! | Array!);
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 »

Re-implemented SDL sound code to be more like Mac sound code, with code sharing advantages and bla bla. More importantly, the same sound can now be played on more than one channel at once on non-Mac systems. As a result, we no longer use two identical afterburner sounds.
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 »

Noticed that system.entitiesWithScanClass(), system.filteredEntities(), system.shipsWithPrimaryRole() and system.shipsWithRole() were all broken, and fixed them. Also added some nice JS console macros:
  • :nearest role – sets result to the closest ship with the specified role.
  • :tnearest role – sets the player’s target to the closest ship with the specified role. Example. :tnearest coriolis
  • :find expression – sets result to an array of entities matching expression, which is a predicate using the variable entity. For example, to find all planets, use: :find entity.isPlanet
  • :findS expression – similar to :find, but only looks for ships. Example: :findS ship.scanClass == "CLASS_BUOY"
  • :target expression – like :findS, but sets the player’s target to the closest found object.
These macros can be added to the console in 1.71.x with the following commands:

Code: Select all

:setM nearest this.result = system.shipsWithRole(PARAM, player)[0]
:setM tnearest player.target = system.shipsWithRole(PARAM, player)[0]
:setM find this.result = system.filteredEntities(player, function(entity) { return eval(PARAM); })
:setM findS this.result = system.filteredEntities(player, function(ship) { return ship.isShip && eval(PARAM); })
:setM target player.target = system.filteredEntities(player, function(ship) { return ship.isShip && eval(PARAM); }, player)[0]
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8501
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

Your continued tickling in the background is, as it always is, much appreciated, even by those of us who do not (yet) need to worry about such things!!
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
Post Reply