Talk:Oolite JavaScript Reference: System
I'd like to suggest a new system feature.
I see that interstellarspace cannot be altered. This prevents several proposed hacks to create customsystems outside of the documented range (0-254) per galaxy.
I propose a isCustomSystem to supplement the isInterstellarSpace flag.
If both flags are true, interstellar_space (eg uncharted space) can be altered by script.
If customSystem is not scripted, revert flag to false.
(But the flag should be set to true in the systemScript in the first place)
--Arexack 13:17, 7 August 2007 (BST)
addShips()
As per this post I'd like to propose the following parameters for a new addShips() method which will supersede all the legacy_foo() methods:
addShips(role, count, coordScheme, where, [radius], [witchspace cloud])
The first four parameters should be self-explanatory, they are the existing parameters of legacy_addShipsAt().
The optional parameter radius adds the ship(s) within the given radius around the given position, thereby including legacy_addShipsWithinRadius(). This also includes legacy_addShipsAtPrecisely(), if the radius is set to 0.
The optional parameter witchspace cloud determines whether or not the ship(s) appear(s) out of a blue sphere, as if exiting witchspace, or not. Currently the blue sphere is only drawn for legacy_addShips(). Default should be true.
The current legacy_addShips() would therefore become equivalent to addShips(role, count, "wpm", [0, 0, 0], 25600) or addShips(role, count, "abs", [0, 0, 0], 25600) respectively (or whatever currently defines the center and size of the spawning area), and thus be included as well.
The only method which is currently different from all the others, and cannot easily be included in a superseding method, is legacy_addSystemShips(), because it adds ships on the line between witchpoint and main station (as opposed to the line between witchpoint and planet). If we want to retain its functionality we can make it a seperate method: addSystemShips(role, count, position, [radius], [witchspace cloud])
The first three parameters again as currently found in legacy_addSystemShips(), and the optional parameters as above.
The legacy_spawnShip() method has become obsolete anyway, because its only purpose was to control the orientation of the spawned object, which under JavaScript can be much better achieved through a ship-script (never worked correctly anyway).
So we would have only one method (or possibly two, with addSystemShips()) instead of the six currently listed.--Commander McLane 12:53, 11 December 2008 (UTC)