(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.
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.
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.
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:
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
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.
: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:
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!!