commodity price

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
david todd
Harmless
Harmless
Posts: 1
Joined: Fri Apr 03, 2009 7:17 pm

commodity price

Post by david todd »

would it be possible for to mod oolite it so when you have bought a commodity and you look in the ships manifest it tells you what you paid for it and maybe which system you bought it in. I no i could use a pen and paper
Last edited by david todd on Sat Apr 04, 2009 4:27 pm, edited 1 time in total.
User avatar
CptnEcho
---- E L I T E ----
---- E L I T E ----
Posts: 536
Joined: Sun Oct 26, 2008 4:14 pm

Post by CptnEcho »

Or, you could write that information down into a notebook, travel & trade log, or even start your own transaction history via entries in your favorite speadsheet or database program.
"I shouldn't have taken off in this crate without more ammo..." Sergeant Knox - Star Blazers
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

There are other ways to get things, such as scooping cargo, or awarded by scripts (Ore Extracter oxp for example).

You may also have 35t of food, each one from a different place and different price , how would we display that?
Ebi
Competent
Competent
Posts: 40
Joined: Fri Jun 27, 2008 9:45 pm

Post by Ebi »

Cmdr James wrote:
There are other ways to get things, such as scooping cargo, or awarded by scripts (Ore Extracter oxp for example).

You may also have 35t of food, each one from a different place and different price , how would we display that?
The average price would be okay.
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 »

Ebi wrote:
Cmdr James wrote:
There are other ways to get things, such as scooping cargo, or awarded by scripts (Ore Extracter oxp for example).

You may also have 35t of food, each one from a different place and different price , how would we display that?
The average price would be okay.
Here!
https://bb.oolite.space/viewtopic.php?t= ... et&start=0
Ebi
Competent
Competent
Posts: 40
Joined: Fri Jun 27, 2008 9:45 pm

Post by Ebi »

Deja Vu - That strange feeling we sometimes get that we've lived through something before...
User avatar
CptnEcho
---- E L I T E ----
---- E L I T E ----
Posts: 536
Joined: Sun Oct 26, 2008 4:14 pm

Post by CptnEcho »

Amazing what the "search" feature of the forums might reveal, eh? :wink:
"I shouldn't have taken off in this crate without more ammo..." Sergeant Knox - Star Blazers
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 »

Let us not be uncharitable gentlemen. An old question is also an easy answer to the enlightened.

There are no points to be scored in the eternal search for knowledge. Only truth to be shown to the new by the old.
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

I dont think this is actually what the guy weas asking for anyway. He wanted to know how much he had paid, and therefore the amount to display should not be the average price overall, but rather the average price payed for the actual items in the hold.
Ebi
Competent
Competent
Posts: 40
Joined: Fri Jun 27, 2008 9:45 pm

Post by Ebi »

That was my understanding as well. I was talking of the average buy price.

There must be an internal representation of the cargo list. For instance:

c.av = (c.av * c.amnt + price * amnt) / (c.amnt + amnt);
c.amnt += amnt;

Hmm. what happens if you sell the item partially?

c.amnt -= amnt

That much is clear!

No wait! You need a separate amnt variable which is never decreased. c.buy_amnt rather than amnt.
Post Reply