Page 1 of 1
commodity price
Posted: Fri Apr 03, 2009 7:28 pm
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
Posted: Fri Apr 03, 2009 9:45 pm
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.
Posted: Sat Apr 04, 2009 10:17 am
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?
Posted: Mon Apr 06, 2009 4:36 pm
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.
Posted: Mon Apr 06, 2009 5:31 pm
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
Posted: Mon Apr 06, 2009 7:13 pm
by Ebi
Deja Vu - That strange feeling we sometimes get that we've lived through something before...
Posted: Tue Apr 07, 2009 10:36 am
by CptnEcho
Amazing what the "search" feature of the forums might reveal, eh?
Posted: Tue Apr 07, 2009 3:35 pm
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.
Posted: Tue Apr 07, 2009 4:30 pm
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.
Posted: Wed Apr 08, 2009 5:08 pm
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.