Page 2 of 2
Posted: Mon Jun 01, 2009 8:42 pm
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.
Posted: Tue Jun 02, 2009 9:05 am
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.
Posted: Tue Jun 02, 2009 10:04 am
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.
Posted: Tue Jun 02, 2009 10:12 am
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..."
Posted: Tue Jun 02, 2009 10:17 am
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.
..
Posted: Tue Jun 02, 2009 10:17 am
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.
Looking forwards to that!
Posted: Tue Jun 02, 2009 11:24 am
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?
Posted: Tue Jun 02, 2009 11:51 am
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.
Posted: Tue Jun 02, 2009 11:52 am
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.
Posted: Tue Jun 02, 2009 12:04 pm
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........
Posted: Tue Jun 02, 2009 12:09 pm
by another_commander
ClymAngus wrote:Sweet, so we're talking trying to do clever **** with java.
*cough*javascriptnotjava*cough*
Posted: Tue Jun 02, 2009 12:53 pm
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?
Posted: Tue Jun 02, 2009 1:44 pm
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
Posted: Tue Jun 02, 2009 3:36 pm
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.
Posted: Tue Jun 02, 2009 4:00 pm
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.