Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Player big ships - possible workaround

General discussion for players of Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Cmdr. Maegil
Sword-toting nut-job
Sword-toting nut-job
Posts: 1294
Joined: Tue Feb 27, 2007 10:28 pm
Location: On the mend in Western Africa

Player big ships - possible workaround

Post 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:
You know those who, having been mugged and stabbed, fired, dog run over, house burned down, wife eloped with best friend, daughters becoming prostitutes and their countries invaded - still say that "all is well"?
I'm obviously not one of them.
User avatar
Mauiby de Fug
---- E L I T E ----
---- E L I T E ----
Posts: 847
Joined: Tue Sep 07, 2010 2:23 pm

Re: Player big ships - possible workaround

Post 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.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: Player big ships - possible workaround

Post 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.
User avatar
JazHaz
---- E L I T E ----
---- E L I T E ----
Posts: 2991
Joined: Tue Sep 22, 2009 11:07 am
Location: Enfield, Middlesex
Contact:

Re: Player big ships - possible workaround

Post by JazHaz »

I didn't think it was possible for a script to change the player's ship?
User avatar
Cmdr. Maegil
Sword-toting nut-job
Sword-toting nut-job
Posts: 1294
Joined: Tue Feb 27, 2007 10:28 pm
Location: On the mend in Western Africa

Re: Player big ships - possible workaround

Post 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.
You know those who, having been mugged and stabbed, fired, dog run over, house burned down, wife eloped with best friend, daughters becoming prostitutes and their countries invaded - still say that "all is well"?
I'm obviously not one of them.
User avatar
Cmdr. Maegil
Sword-toting nut-job
Sword-toting nut-job
Posts: 1294
Joined: Tue Feb 27, 2007 10:28 pm
Location: On the mend in Western Africa

Re: Player big ships - possible workaround

Post 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
You know those who, having been mugged and stabbed, fired, dog run over, house burned down, wife eloped with best friend, daughters becoming prostitutes and their countries invaded - still say that "all is well"?
I'm obviously not one of them.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Player big ships - possible workaround

Post 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")
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2321
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Player big ships - possible workaround

Post 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?
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2020
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: Player big ships - possible workaround

Post by maik »

Code: Select all

system.mainStation.dockPlayer()
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: Player big ships - possible workaround

Post 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.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Player big ships - possible workaround

Post 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.
User avatar
Cmdr. Maegil
Sword-toting nut-job
Sword-toting nut-job
Posts: 1294
Joined: Tue Feb 27, 2007 10:28 pm
Location: On the mend in Western Africa

Re: Player big ships - possible workaround

Post 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.
You know those who, having been mugged and stabbed, fired, dog run over, house burned down, wife eloped with best friend, daughters becoming prostitutes and their countries invaded - still say that "all is well"?
I'm obviously not one of them.
Post Reply