I meant offering a non-witchspace capable ship for 0 credits. This would allow a player to run around in the system to buy a new ship, if that was necessaryCommander McLane wrote:We cannot "give" the player a ship. The player is his ship, the one that he has bought.Capt. James Maladorn wrote:Give them a rickshaw or something then?
i want a garage...
Moderators: winston, another_commander
- Capt. James Maladorn
- Average
- Posts: 8
- Joined: Wed Sep 26, 2007 6:46 pm
"Always Vigilant"
-
- ---- E L I T E ----
- Posts: 452
- Joined: Mon Mar 13, 2006 5:46 pm
- Location: St Petersburg, Russia
- Contact:
Haha, this may allow script an inprisonment in a Communist systemCapt. James Maladorn wrote:I meant offering a non-witchspace capable ship for 0 credits. This would allow a player to run around in the system to buy a new ship, if that was necessaryCommander McLane wrote:We cannot "give" the player a ship. The player is his ship, the one that he has bought.Capt. James Maladorn wrote:Give them a rickshaw or something then?
-
- Competent
- Posts: 47
- Joined: Sun Jan 20, 2008 3:51 pm
wrong! the player is a XML-file named PLAYERNAME.oolite-save, and has an entry for PLAYERNAME! so you can modify the ship-tag whenever you want WITHOUT modifying anything else!ArkanoiD wrote:We cannot "give" the player a ship. The player is his ship, the one that he has bought.
make a script for the station which
1) generates a mission_garage_[SYSTEM-NAME] variable with the players ship-desc
2) if there was an old ship:
2.1) sets the ship to the old garage entry
2.2) if not sets the ship to cobraMk3
3) shows the buy-ship-screen or the other-garages-screen where you see your other ships and where they live.
so you can have the one ship youre flying and one ship (per system) in the garage.
-
- Competent
- Posts: 47
- Joined: Sun Jan 20, 2008 3:51 pm
-
- Competent
- Posts: 47
- Joined: Sun Jan 20, 2008 3:51 pm
- Commander McLane
- ---- 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:
Might be doable in JavaScript (still haven't learned it, so I can't know), but JavaScript is a pretty new addition to the Ooniverse. It's even not finished yet. And the old plist-scripting-system had no means whatsoever to directly manipulate the save-file. So, if you don't edit your save-file with a text editor (which I, as I explained, do not support), the player is exactly one ship. It's still right.zimmemic25 wrote:wrong! the player is a XML-file named PLAYERNAME.oolite-save, and has an entry for PLAYERNAME! so you can modify the ship-tag whenever you want WITHOUT modifying anything else!ArkanoiD wrote:We cannot "give" the player a ship. The player is his ship, the one that he has bought.
*****
By the way: Are you aware of the possibility to edit your last post by klicking on the "EDIT"-button in the upper right corner? This gives you the opportunity to add something you have forgotten in the first place. You really don't need to post three times in a row, in order to explain just one thought. (Unless you desperately want to get a lot of posts and reputation to your name, of course. )
-
- Competent
- Posts: 47
- Joined: Sun Jan 20, 2008 3:51 pm
i think you can use "set: ship_desc" in plist?
i have the following script:
i dont understand the plist format, so could you translate this script?
then i could modify it for ship-setting
i have the following script:
Code: Select all
this.name = "Garage"
this.author = "Michael Zimmer"
this.copyright = "(C) 2007 Me."
this.description = "OXP for an one-ship-garage in every system";
this.version = "1.0 alpha 1"
this.STATUS_DOCKED = function()
{
var oldgarage="cobra3-player";
oldgarage=missionVariables["garage_"+system.ID+"_"+system.description+"_ship"]; //here we save the OLD garage ship
missionVariables["garage_"+system.ID+"_"+system.description+"_ship"]=player.shipDescription; // here we set the NEW garage ship (the player ship)
player.shipDescription=oldgarage; // here we load the OLD garage ship (the NEW player ship). this will NOT work!!! player ship is readonly.
}
i dont understand the plist format, so could you translate this script?
then i could modify it for ship-setting
- Commander McLane
- ---- 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:
No, you can't. The set:-method works only with mission_ or local_variables. Some of the internal variables can be set by special methods like setLegalStatus:, addFuel: or removeAllCargo, (see the Methods-document in the wiki for a complete list) but there is absolutely no way to address anything else.zimmemic25 wrote:i think you can use "set: ship_desc" in plist?
JavaScript is much more powerful in this respect, but there is no way to translate something like player.shipDescription into plist-syntax. Simply doesn't exist.
And it seems that even with JS you have hit the ground pretty soon:
As far as I understand this means that for the time being there won't be a garage without manual manipulation of the save-file (see back-thread; which, for me, isn't a viable option for something that should be easily usable by any player).this will NOT work!!! player ship is readonly.
-
- Competent
- Posts: 47
- Joined: Sun Jan 20, 2008 3:51 pm
- LittleBear
- ---- E L I T E ----
- Posts: 2879
- Joined: Tue Apr 04, 2006 7:02 pm
- Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.
You can mod save-file variables, just not that one! . Quite a few OXPs have been proposed that would involve borrowing a ship, the Garage is one but an inflitration mission where you have to use a Captured Thargoid Warship to slip past waves of Bugs would be another (and rather fun). Its easy enough to store the variable:- set: mission_my_garage_shipname [ship_name] and set: mission_my_garage_ship_planetstore [planetnumber], set mission_my_garage_ship_galaxystore [galaxynumber] would all currently work to record the fact that the player has "A Cobra Mk III stored at Lave in Galaxy 1). But you'd need a new command : awardShip: [mission_my_garage_shipname] to give the player back his Cobra III when back at Lave and chosing to take it out of storage.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
You need a lot more. With shipname you only save the name of the ship. But you should also store all the equipment the ship had. (that can be added with awardEquipment) And to be complete, even the fact if he had or had not trumbles on board.LittleBear wrote:But you'd need a new command : awardShip: [mission_my_garage_shipname] to give the player back his Cobra III when back at Lave and chosing to take it out of storage.
In JS it is maybe doable. JS gives some access to the code and it is probably possible to call the function that controls the buying of a new ship. (But don't ask me how, I don't know.)
Changing the save file makes no sense. When a script changes the save file, you don't see any changes and on the next change all the modifications are overwritten. Changing must happen in memory.
- LittleBear
- ---- E L I T E ----
- Posts: 2879
- Joined: Tue Apr 04, 2006 7:02 pm
- Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.
True Eric, but you could handle the equipment with test for equipment EQ_ENERGY_BOMB, found = set: mission_my_garage_didhaveebomb TRUE etc etc and the a mission_my_garage_reaward = TRUE, mission_my_garage_didhaveebomb = TRUE, awardEquipment: EQ_ENERGY_BOMB to give the right equipment back on taking the ship out of mothballs. Its only the giving the ship itself back that needs a new command. An awardShip would be handy as there are a lot of missions ideas that could use this. As for trumbles, well if you have stored your ship for valeting, the least you can expect it that they cleaned out all the pests whilst you were away!
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
- Disembodied
- Jedi Spam Assassin
- Posts: 6885
- Joined: Thu Jul 12, 2007 10:54 pm
- Location: Carter's Snort
- LittleBear
- ---- E L I T E ----
- Posts: 2879
- Joined: Tue Apr 04, 2006 7:02 pm
- Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.
Yep. But new items aren't made that often (Your missiles would transfer with you) and when a new item comes out its a 2 minute job to C&P another test in, so it wouldn't be too hard to keep the Garage.OXP updated. The garage would really have to terminate any trumble infestation in their own interests, otherwise there'd by no garage (or maybe even station) left when you returned in 6 months!
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
- Captain Hesperus
- Grand High Clock-Tower Poobah
- Posts: 2310
- Joined: Tue Sep 19, 2006 1:10 pm
- Location: Anywhere I can sell Trumbles.....
NNNNNOOOOOOooooooooooooooooooooo! And I thought you cared, LB! After the many times I have offered you rare Trumbles at cheaper than average rates, and THIS is how you repay me! <shakes head>LittleBear wrote:As for trumbles, well if you have stored your ship for valeting, the least you can expect it that they cleaned out all the pests whilst you were away!
My faith in Small Furry Ursines is solidly shaken.
Captain Hesperus
.....despondent to say the least
The truth, revealed!!