Page 2 of 5
Re: "Personal Base" OXP Concept (Open to Ideas)
Posted: Tue Jun 14, 2011 10:50 am
by Lone_Wolf
Killer Wolf wrote: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.
Re: "Personal Base" OXP Concept (Open to Ideas)
Posted: Tue Jun 14, 2011 11:44 am
by Killer Wolf
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?
Re: "Personal Base" OXP Concept (Open to Ideas)
Posted: Tue Jun 14, 2011 2:33 pm
by CommonSenseOTB
Staer9 wrote:Mauiby de Fug wrote: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!)
Re: "Personal Base" OXP Concept (Open to Ideas)
Posted: Tue Jun 14, 2011 4:45 pm
by Capt. Murphy
Killer Wolf wrote: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.
Re: "Personal Base" OXP Concept (Open to Ideas)
Posted: Tue Jun 14, 2011 4:52 pm
by Dragonfire
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.)
Re: "Personal Base" OXP Concept (Open to Ideas)
Posted: Tue Jun 14, 2011 5:00 pm
by Mauiby de Fug
But it is not exposed to plists or javascript, meaning that it should not be possible in an oxp.
Re: "Personal Base" OXP Concept (Open to Ideas)
Posted: Tue Jun 14, 2011 7:58 pm
by Dragonfire
I never said one had to modify or access the shipyard itself. It IS viewable, thus I can borrow code from it to simulate a similar method.
What can I say? I love a good challenge, and I take the phrase "Its impossible" as license to do it.
Re: "Personal Base" OXP Concept (Open to Ideas)
Posted: Wed Jun 15, 2011 2:39 am
by Switeck
Unlike equipment, a ship cannot change its TL if set initially to TL99?
Re: "Personal Base" OXP Concept (Open to Ideas)
Posted: Wed Jun 15, 2011 4:55 am
by Capt. Murphy
@Switeck - Don't think so unless I've missed something in the JS documentation.
@Dragonfire - Good luck with the project, I'd be very happy to see if you work your away around the current limitations.
Re: "Personal Base" OXP Concept (Open to Ideas)
Posted: Wed Jun 15, 2011 5:29 am
by Dragonfire
Limitations are meant to be blown past...
Killer Wolf wrote: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?
Exactly my line of thinking!
Re: "Personal Base" OXP Concept (Open to Ideas)
Posted: Wed Jun 15, 2011 9:28 am
by Lone_Wolf
Good Luck with it, Dragonfire but i'll think you will to have to hack the sourcecode to achieve what you want.
Re: "Personal Base" OXP Concept (Open to Ideas)
Posted: Wed Jun 15, 2011 2:48 pm
by Switeck
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.
Re: "Personal Base" OXP Concept (Open to Ideas)
Posted: Wed Jun 15, 2011 4:09 pm
by Dragonfire
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.
Re: "Personal Base" OXP Concept (Open to Ideas)
Posted: Wed Jun 15, 2011 4:42 pm
by Thargoid
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.
Re: "Personal Base" OXP Concept (Open to Ideas)
Posted: Wed Jun 15, 2011 6:44 pm
by Dragonfire
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.
Sigh...I think I'm repeating myself now.