Page 1 of 1

Player big ships - possible workaround

Posted: Wed Nov 16, 2011 5:57 pm
by Cmdr. Maegil
DISCLAIMER: this is NOT a standalone OXP, but a set of ideas for a workaround that if developed can be then added to individual big ship OXPs. The much desired garage OXP may or may not become a spinoff, but let's first see if this can work -at all-. I was reticent about bringing up this theme, as the idea goes against the "player=ship" dogma - its variations have been discussed to death, and buried, in several threads. Still, after some PMing I decided to beat up this dead cat just to see if it meows...

With the latest changes to the core and the advent of some new ingenious techniques in OXPing, I think that it may now be possible to succeed in swapping ships.

Make a carrier OXP and include:
- the same carrier model with a dormant AI;
- a small player shuttle with the same cargo capacity and price (an avatar to the carrier);
- a custom shipyard for the carrier with only either the carrier or the shuttle for sale;
- a piece of primeable equipment to activate the swap.

On activating the swap, it'd:
- spawn the carrier model on the player's location (remembering the coordinates) and instantly dock with it (as in the Save Anywhere OXP);
- offer only the avatar for sale (for 0Cr) on the customized shipyard;
- record all the equipment and cargo as mission data (somewhat as in the Feudal Systems OXP), and award it to the newly "bought" avatar.

The avatar could then be flown into any station (core or OXP) for whatever business the player has there, and then return to the carrier for the reverse operation (even if the game is saved at this point).
Should the player sell the avatar, the carrier outside would disappear (or not); what would happen if the player left the system or if the carrier is destroyed while the player is away shouldn't pose any problems...

Please dissect this proposal, and give feedback on why won't it work :roll:

Re: Player big ships - possible workaround

Posted: Wed Nov 16, 2011 6:06 pm
by Mauiby de Fug
There is, unless things have changed, no way to choose what ships will appear in a shipyard. All you can do is change the probability of how many times a ship will appear in the list of ships to choose from. The game then randomly chooses from that list.

Re: Player big ships - possible workaround

Posted: Wed Nov 16, 2011 6:08 pm
by Thargoid
The problem is you cannot guarantee what ships are available in the shipyard, other than by limitation of tech level. And even then you may just end up with an empty shipyard.

Similarly when you try and give the player their old ship back, whilst you have a note of what equipment it had, you can't guarantee that the ship itself will be presented as available for re-purchase.

The spawning and docking of the carrier is do-able though, that's in essence how Planetfall works.

Editted to add - Ninja'd by the squirrel, or possibly vice-versa.

Re: Player big ships - possible workaround

Posted: Wed Nov 16, 2011 6:11 pm
by JazHaz
I didn't think it was possible for a script to change the player's ship?

Re: Player big ships - possible workaround

Posted: Wed Nov 16, 2011 6:12 pm
by Cmdr. Maegil
Mauiby de Fug wrote:
There is, unless things have changed, no way to choose what ships will appear in a shipyard. All you can do is change the probability of how many times a ship will appear in the list of ships to choose from. The game then randomly chooses from that list.
I'm posting precisely because I think things might have changed enough... In any case,just over a year ago, Cmdr. McLane said he had created a TL 0 shipyard for his Cataclysm.oxp to grant the player a new ship.

Re: Player big ships - possible workaround

Posted: Wed Nov 16, 2011 7:38 pm
by Cmdr. Maegil
In the same thread, Kaks made things even simpler:
Kaks wrote:
You can select which ships are for sale at specific shipyards using conditions.
Something that just occurred to me is that if you fly a carrier and have the Save Anywhere OXP, you can effectively save... anywhere! :D

Re: Player big ships - possible workaround

Posted: Wed Nov 16, 2011 7:38 pm
by Eric Walch
Cmdr. Maegil wrote:
- spawn the carrier model on the player's location (remembering the coordinates) and instantly dock with it (as in the Save Anywhere OXP);
That is a bit outdated method. Since 1.73 we have the dockPlayer method. Much more reliable that how Save anywhere used to do it. And I often use it in to immediately dock at the main station when entering a new system when testing stuff :wink: .
(I have a nice console macro: ":dock")

Re: Player big ships - possible workaround

Posted: Wed Nov 16, 2011 8:30 pm
by Wildeblood
Eric Walch wrote:
Cmdr. Maegil wrote:
- spawn the carrier model on the player's location (remembering the coordinates) and instantly dock with it (as in the Save Anywhere OXP);
That is a bit outdated method. Since 1.73 we have the dockPlayer method. Much more reliable that how Save anywhere used to do it. And I often use it in to immediately dock at the main station when entering a new system when testing stuff :wink: .
(I have a nice console macro: ":dock")

Code: Select all

dockPlayer 
dockPlayer() : Boolean 

This method docks the player at the specified station. Returns false if docking fails, otherwise true.
Eric (or anyone else), please provide an example of its use. What exactly would I need to write in a world script to make use of this?

Re: Player big ships - possible workaround

Posted: Wed Nov 16, 2011 8:41 pm
by maik

Code: Select all

system.mainStation.dockPlayer()

Re: Player big ships - possible workaround

Posted: Wed Nov 16, 2011 11:28 pm
by Kaks
You could also use something like this:

Code: Select all

if (player.ship.target && player.ship.target.isStation) player.ship.target.dockPlayer();
or

Code: Select all

// list all local stations, dock with the last one added to the system.
this.localStations = system.filteredEntities(this,function(e){return e.isStation;});

if (this.localStations) this.localStations[this.localStations.length-1].dockPlayer();
About selecting ships for sale at a particular station, you can always set a specific ship as having 100% likelihood of being for sale, (in that case all equipment defined as optional will always appear - a long-standing quirk of the ship market that might be de-quirked in the future) and set conditions just so to stop all other ships from appearing.

Re: Player big ships - possible workaround

Posted: Thu Nov 17, 2011 11:15 am
by Switeck
The SuperHub station OXP contains another possible workaround -- it is so huge that pretty much every ship short of the Thargoid saucer can dock at it. It's possible to replace main stations with that, although that certainly changes the feel of the universe to do so.

Re: Player big ships - possible workaround

Posted: Thu Nov 17, 2011 1:05 pm
by Cmdr. Maegil
It'd seem I was right, and there are people already working on this - knowing you guys, probably someone is going to come up with a functional prototype before the weekend's over...

I've gotta love this board! :D :D :D 8)


I can't help with the coding itself, but I can throw some ideas into the grinder:

- I don't think it's possible to buy in-game other player ships to the carrier, they must be manually added to the shipyard to allow leaving the carrier in an iron ass - the readme should have instructions on on how to do so;
- when boarding the iron ass, the carrier's cargo and equipment shouldn't be awarded to the new ship, but stored;

- If the carrier is able to refuel other ships, should it be able to refuel itself? I think so, as if it's paid you could say it came from the storage tanks and the money is to refill them;

- there's already an OXP to hire escorts, so I guess it is possible to give the carrier a defence wing - the launching and retrieval might pose some difficulty, though;

- should the carrier follow the player around or stay put? I think it should try to follow if the player is at more than 10Km away. In any case, a compass beacon would be a good thing to have;

- maybe the Lifter or something similar could be put to use with NPC versions, coming to and fro the main station;

- more to come.