2 Ships

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

Well, another work around would be to have a variable that stores the number amount of cargo in each ship and have any that will not fit in a given model of ship stored in another variable.

A mission script could be used to manage the player's ship and inventory.

However, unless there's a way to determine how much of each type of cargo is stored in the player's ship, this is all moot.
User avatar
ClymAngus
---- E L I T E ----
---- E L I T E ----
Posts: 2514
Joined: Tue Jul 08, 2008 12:31 am
Location: London England
Contact:

Post by ClymAngus »

Ok there is a flaw here but couldn't we just hijack the station coding?

It's got a commodity list so you could store materials there, OK so it would be locked round one system not moble like GTA but that's reality for you (I never liked that anyway).

It's got a ship list that instead of being world perameter generated could be read into.

The only problem is keeping ongoing missions as you change ships.
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

I've been poking around the documentation, and cannot find any way to go around the fact that you can't determine how much of each type of cargo is in the player's ship. If we could do that, work-arounds for other problems could probably be made.

Not even storing it in the station's commodities list would work as we still can't determine how much of each cargo type is in the ship.

Unfortunate.
Dream as if you'll live forever
Live as if you'll die tomorrow
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

Could back-story it to say inter-ship transfers are not allowed due to Galcop cracking down on dodgy paperwork and smuggling...

If you change ships the hold must be empty and the ship has a clean manifest.

"It's the rules guv..."
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

Ah, a in-ooniverse excuse. Sounds plausible.

What does everyone else think?

I'm going to see if I can't put something together for this idea. I'll get back to you on this.
Dream as if you'll live forever
Live as if you'll die tomorrow
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

..

Post by Lestradae »

Nemoricus wrote:
I'm going to see if I can't put something together for this idea. I'll get back to you on this.
:D

Looking forwards to that!
User avatar
ClymAngus
---- E L I T E ----
---- E L I T E ----
Posts: 2514
Joined: Tue Jul 08, 2008 12:31 am
Location: London England
Contact:

Post by ClymAngus »

Nemoricus wrote:
I've been poking around the documentation, and cannot find any way to go around the fact that you can't determine how much of each type of cargo is in the player's ship. If we could do that, work-arounds for other problems could probably be made.

Not even storing it in the station's commodities list would work as we still can't determine how much of each cargo type is in the ship.

Unfortunate.
So we can't interrogate a text file, run it through some if statements checking for existing commodity values and if value > 0 add the new value to the existing one? So you dock, it auto dumps your cargo then you resupply from there with a new ship.

OK next question, which programming language? Are we talking pure c++ here? Is anything else compatable?
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

ClymAngus wrote:
OK next question, which programming language? Are we talking pure c++ here? Is anything else compatable?
Oolite is objective C, not C++. Objective C is similar enough to C++, but not the same. It is easy to do what you are talking about in objective C, in fact that is more or less how save-games work.

But what I think is needed is for this to be available in javascript which is the OXP language, and I am pretty sure this isnt available. Not because it is impossbile, but rather because actually we want the OXP to be reasonably sandboxed, and dont want them to have access to large parts of the OS or filesystem.
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

DaddyHoggy wrote:
Could back-story it to say inter-ship transfers are not allowed due to Galcop cracking down on dodgy paperwork and smuggling...

If you change ships the hold must be empty and the ship has a clean manifest.

"It's the rules guv..."
If you buy a new ship then the contents of the hold are currently transfered to your new ship, I believe.
User avatar
ClymAngus
---- E L I T E ----
---- E L I T E ----
Posts: 2514
Joined: Tue Jul 08, 2008 12:31 am
Location: London England
Contact:

Post by ClymAngus »

Sweet, so we're talking trying to do clever **** with java. Hmmmmm I see what you mean. It is something of a problem, I'm going to take a look through some books........
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Post by another_commander »

ClymAngus wrote:
Sweet, so we're talking trying to do clever **** with java.
*cough*javascriptnotjava*cough*
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

I've sorted out most of the problems that I can see at the moment.

However, I've hit a bit of a snag. I need to design a special station's shipyard so that ships that the player has purchased can be stored there.

Is it possible to change the tech level listed in a ship's entry via script? If so, how?

If that's possible, I think I have all of the obvious problems sorted out. Though, to be honest my plan is a bit of a trickery. There doesn't appear to be a way to do what I want in JavaScript directly, so I have to construct workarounds. Still, the net result should be that the player can change ships.

One last thing. Which ships are TL 1 in Oolite or in any OXP?
Dream as if you'll live forever
Live as if you'll die tomorrow
Screet
---- E L I T E ----
---- E L I T E ----
Posts: 1883
Joined: Wed Dec 10, 2008 3:02 am
Location: Bremen, Germany

Post by Screet »

Nemoricus wrote:
There doesn't appear to be a way to do what I want in JavaScript directly, so I have to construct workarounds.
Maybe it would be best to determine which functionality Oolite would need to provide to JS in order to make switching ships (probably in flight, thinking about the Nostromo and similar setups here) possible and then see if how tough it is to implement that functionality.

For example, the trunk version now supports fireECM. Previously, noone did think of player-autoECM although the NPCs does have it. It turned out to be no more difficult than bridging an oolite internal feature to JS.

Screet
User avatar
Nemoricus
---- E L I T E ----
---- E L I T E ----
Posts: 388
Joined: Mon May 18, 2009 8:51 pm

Post by Nemoricus »

Okay. The functionalities I need are:

1. The ability to change the player's ship via script.

Actually, that's about it. Everything else I have in mind is to deal with the fact that there's no way to switch a player's ship directly. Being able to get the cargo stored would be nice, though.

A quick note, though. My idea won't change a player's ship in flight. It's more of a garage that the player can store their ships in.

Changing it in flight is different and I haven't fully thought through what would be needed for that.
Dream as if you'll live forever
Live as if you'll die tomorrow
User avatar
ClymAngus
---- E L I T E ----
---- E L I T E ----
Posts: 2514
Joined: Tue Jul 08, 2008 12:31 am
Location: London England
Contact:

Post by ClymAngus »

another_commander wrote:
ClymAngus wrote:
Sweet, so we're talking trying to do clever **** with java.
*cough*javascriptnotjava*cough*
I don't think it cares. That said. If it works, I'll just call it "lovely, lovely blinding bit of ninja code." That should keep it sweet. :D
Post Reply