could you not hold your other ships as "equipment" and when you cycle through and activate one (like you'd activate a pylon weapon, you change the player ship to that item and your current ship takes its place. the option to do this should only occur if you're docked at your home base of course.
The ship a player is flying is not changeable through JS.
While it is stored in the savefile, afaik all JS functions that deal with accessing files directly or executing an external program are not implemented in the JS library used by Firefox 4 and in oolite.
Currently there's NO WAY to change a player ship with ingame code.
how does the usual sell/buy procedure you use in the shipyard work, could you not spoof that to assign the ship change via a fake "buy" but store off the details of the "sold" ship?
As far as the garage/multiple ships idea goes, Smivs is correct. That's essentially impossible.
Wheres CSOTB... He loves it when someone says something is impossible
"Nothing's impossible 'til you're dead or stop trying." (or the money runs out!)
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.
how does the usual sell/buy procedure you use in the shipyard work, could you not spoof that to assign the ship change via a fake "buy" but store off the details of the "sold" ship?
That's basically what I wanted to do, but would still need some JS access to shipyard attributes (like the prices) and the ability to specify a specific ship to be available at a certain station's shipyard, again not currently accessible via JS. That last feature would be a good one to have in the game anyway - would open the door to have a rare/unique ship made available as certain stations as a mission reward.
I still say it is possible. Even though the shipyard module itself cannot be used, its very existence points to the ability to change ships with in-game code. Therefore, all one has to do is come up with a system whereby the ships saved, borrowing some methods from the shipyard (yet reinventing it...I'm pretty sure one can reassign the typical shipyard key to something else on a custom base.)
how does the usual sell/buy procedure you use in the shipyard work, could you not spoof that to assign the ship change via a fake "buy" but store off the details of the "sold" ship?
As long as the player re-buys the same shiptype, the game could re-add all the equipment to it that the player's previous ship had. It would be an ugly kludge though and would require also having nearly every ship-type available.
Again, that would be achieved by pulling the ship data off of the savefile and writing it to another file. A boolean variable would be added to the savefile to indicate whether the current ship has been docked before. The advantage to that is that, the player would not have to manually restore the equipment - its already there.
You can't read/write to files (other than the current save game file when you save), and also you can't guarantee given ships will (or won't) be available in the shipyard screen.
Both of those I think are going to give you practical headaches, unfortunately.
You can read and write files in any programming language. Limitations can always be circumvented given enough code. Even if the OXP itself can't read and write the file, it can be made to access another class.
And, again, I'm not using the shipyard itself. I'm borrowing some code.