Cargo scooping suggestion

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Cargo scooping suggestion

Post by Cmdr James »

This is just an idea, Im not sure it is good.

move PlayerEntity calculateCurrentCargo into ShipEntity and change it to return current_cargo

change ShipEntity scoopUp line 6316 from

Code: Select all

	if ([cargo count] == max_cargo)  [shipAI message:@"HOLD_FULL"];
to

Code: Select all

		if ([self calculateCurrentCargo] >= max_cargo)  [shipAI message:@"HOLD_FULL"];

I think this will sort out some weird behavour that I have seen, such as getting a hold full if my cobra has 34t and I scoop 10kg of gold.

Also, I think it is possible to construct in an oxp, a cargo canister with, say 2t of commodity in. If you scoop that, we will go past max_cargo, and I think some seriously weird things may happen. I guess that we should issue a holds full if cargo == max_cargo, and if it is greater, to immediately dump whatever we just scooped, so that we never go above max.

This could be a start down the road to fixing bug 12373 maybe change PlayerEntityLegacyScriptEngine useSpecialCargo to fill the hold with cargo type="special" or something like that, a non tradable commodity?
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6885
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Post by Disembodied »

Cmdr James wrote:
I think this will sort out some weird behavour that I have seen, such as getting a hold full if my cobra has 34t and I scoop 10kg of gold.
I'm not sure this is officially weird: as far as I understand it, all scooped cargo is treated as being 1 ton, regardless of the actual weight, because it's all going straight through to the cargo bay. It's only when you dock that you can have a chance to repack, and take the kilos and grams of precious metals and gems out of the cargo bay and into the safe in the cockpit.
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

Yeah, thats true. It is 35 cargo containers, each of which can hold up to 1t isnt it :)

I thought I had had different behaviour if the gold was scooped in a position other than last, but I think from looking at the code that each scooping takes a storage space even if it is less than one t.
User avatar
Commander McLane
---- E L I T E ----
---- 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:

Post by Commander McLane »

Yes. And that's because in Oolite "tonnes" are not actually "tonnes", but rather "tuns". They don't refer to one metric ton of weight, but to the size of the cargo cannister (which are, if you look at their length, width and height, far bigger than to hold just one metric ton).

And the gold, platinum or gemstones you are scooping come in exactly the same cargo cannister as any other commodity. That means the cannister takes exactly as much space in your cargo bay than any other cannister: 1t, although it contains actually far less weight (some kilos or grams only).

If you buy gold, platinum or gemstones on a station you put it into the safe in your cockpit directly, without using your cargo bay at all. Therefore the kilos or grams of precious commodities don't prevent you to fill your cargo hold with exactly 35t of other stuff.

And, as Disembodied correctly wrote, as soon as you land you get the chance to repack your cargo bay, putting the gold in the safe and get rid of the monstrous containers it was stored in, thereby regaining the space in your cargo bay.
User avatar
Hoopy
---- E L I T E ----
---- E L I T E ----
Posts: 438
Joined: Wed Oct 03, 2007 8:54 pm
Location: Durham, England

Post by Hoopy »

so should you get a small amount for selling the excess cargo containers? Sort of like those places that pay a pound for old wooden pallets.

Thinking about it why is the gold in a container in the first place - shouldn't it be in the safe that got blown loose (assuming the pilot didn't take it with them in the escape capsule) when the ship was destroyed?

Then it would still take a whole space in the cargo bay but you could repack whilst docked.
User avatar
Commander McLane
---- E L I T E ----
---- 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:

Post by Commander McLane »

Hoopy wrote:
Thinking about it why is the gold in a container in the first place - shouldn't it be in the safe that got blown loose (assuming the pilot didn't take it with them in the escape capsule) when the ship was destroyed?

Then it would still take a whole space in the cargo bay but you could repack whilst docked.
Well, as I (and Disembodied earlier) wrote: You do repack whilst docked. Oh, and the resell-value of the containers is of course already reflected in the price calculation 8) (shameless lie, but how would you prove otherwise? :wink: ).

And if you install cargo_wreck_teaser.oxp, you get a variety of new containers, among them a special one for valuable items. I think that's as close as we can get to the ship's safe floating in space.
User avatar
Hoopy
---- E L I T E ----
---- E L I T E ----
Posts: 438
Joined: Wed Oct 03, 2007 8:54 pm
Location: Durham, England

Post by Hoopy »

good answer :)

I tried the cargo wreck teaser a while ago and didn't notice any real difference. Are the changes a bit subtle or was i just not looking properly?
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2882
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

The old version had some bugs, but the new one on the Wiki OXP page seems fine. The old types of cargo canisters are still present, but there are about 8 new types as well. Try lasering up a large frieghter and you should see some of the new cargo containers spilling out! It also renames some commodies, eg instead of just "Furs 1t" you may get "Remarkable Laveian Grub Hides" etc.
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.
User avatar
Hoopy
---- E L I T E ----
---- E L I T E ----
Posts: 438
Joined: Wed Oct 03, 2007 8:54 pm
Location: Durham, England

Post by Hoopy »

oh wow - i definitely didn't see anything like that. I'll go download it now :)
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

Hope you'll enjoy the show. :)

PM me if there are any obvious bugs.
Riding the Rocket!
User avatar
Hoopy
---- E L I T E ----
---- E L I T E ----
Posts: 438
Joined: Wed Oct 03, 2007 8:54 pm
Location: Durham, England

Post by Hoopy »

i was just readign something else which said cargo wrecks had a bug with AddShips instead of addShips. I changed that but it still didn't work. I guess i need to download the newer version?
User avatar
Hoopy
---- E L I T E ----
---- E L I T E ----
Posts: 438
Joined: Wed Oct 03, 2007 8:54 pm
Location: Durham, England

Post by Hoopy »

aha! that works! :)
Sent a PM with a little bug as well
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

Latest version is v1.3.1

I just tested it in 1.69.1 and the [%I] works perfectly.
Possibly the way text is expanded in 1.7 is the culprit.
I was correct about the missilepod: I left that for a next version.
Riding the Rocket!
User avatar
nijineko
---- E L I T E ----
---- E L I T E ----
Posts: 353
Joined: Wed Jul 04, 2007 3:37 pm
Location: two strange quarks short of a graviton....
Contact:

Post by nijineko »

i'll have to redownload this one then. ^^
arukibito ga michi wo erabu no ka, michi ga arukibito wo erabu no deshou ka?

Image
Play games. Win Amazon gift cards! Brag. Repeat.
Post Reply