Page 3 of 11

Re: (WIP) Elite Trader

Posted: Wed Nov 11, 2020 12:47 pm
by Reval
Many thanks, dybal. BTW, most of the glitches in the script (apart from the fact that one must save with an empty hold) have gone away now :) IOW, it works.

Re: (WIP) Elite Trader

Posted: Wed Nov 11, 2020 4:13 pm
by Reval
Can we treat playerShip.Manifest like an array?

I mean, supposing we want to read just the non-zero items into another array without enumerating every property (food,textiles,radioactives,slaves,liquors_wines..) by, say, using a var in a loop.

Or is there another way to do it anonymously?

In Pascal, for example, that would be something like

Code: Select all

for m := food to alien_items do 
because the commodities would be enumerated types.

Re: (WIP) Elite Trader

Posted: Wed Nov 11, 2020 5:15 pm
by dybal
Reval wrote: Wed Nov 11, 2020 4:13 pm
Can we treat playerShip.Manifest like an array?

I mean, supposing we want to read just the non-zero items into another array without enumerating every property (food,textiles,radioactives,slaves,liquors_wines..) by, say, using a var in a loop.

Or is there another way to do it anonymously?

In Pascal, for example, that would be something like

Code: Select all

for m := food to alien_items do 
because the commodities would be enumerated types.
Use playership.manifest.list, that's an array (read-only!) of objects

Re: (WIP) Elite Trader

Posted: Thu Nov 12, 2020 5:34 am
by Reval
Cheers.

Does Spara (or anyone) happen to know how I can check for the presence of Market Observer? I ask because, if MO is present, Elite Trader has to restrict the number of status messages so as not to overwrite the messages of that OXP. Were I to detect its absence, I would add an extra status or assessment line.

Re: (WIP) Elite Trader

Posted: Thu Nov 12, 2020 5:44 am
by spara
You need to check for the existencen of the assosiated world script. Check the name of the script from the oxp in question. You should find a simple example of such check from for example Wanted Posters oxp (or whatever it was called :D).

Re: (WIP) Elite Trader

Posted: Thu Nov 12, 2020 8:18 am
by Reval
dybal wrote: Wed Nov 11, 2020 5:15 pm
Use playership.manifest.list, that's an array (read-only!) of objects
OK. And if we could just confirm once and for all time that there is no way of retrieving the buy-prices of the items stored in this manifest, short of logging them in a saved game?

Edit: You know - for simplicity's sake, if the above does pertain, I think I might just give the player a token point if he sells with a full hold after game-load. Comments?

Re: (WIP) Elite Trader

Posted: Thu Nov 12, 2020 8:45 am
by spara
Reval wrote: Thu Nov 12, 2020 8:18 am
dybal wrote: Wed Nov 11, 2020 5:15 pm
Use playership.manifest.list, that's an array (read-only!) of objects
OK. And if we could just confirm once and for all time that there is no way of retrieving the buy-prices of the items stored in this manifest, short of logging them in a saved game?
How could there be? Those are the items stored in the ship hold and for example food there could be bought for 5 different prices from 5 different places. Or did I not understand your question correctly?

The only prices that can be read over saves are the prices in the current system.

Re: (WIP) Elite Trader

Posted: Thu Nov 12, 2020 8:49 am
by Reval
Um... Yes, I was referring to the player's (personal) buying history. It would be so neat if the buy-prices could be stored and aggregated by Oolite itself in the manifest.list objects. It would be just another property, after all. Eller hur?

Re: (WIP) Elite Trader

Posted: Thu Nov 12, 2020 8:57 am
by spara
Javisst. You're slowly converging to Market Observer :D. If you need those values, you need to keep track and store them yourself. That data is basically of no value to the core game, so that most likely the reason they are not stored.

Re: (WIP) Elite Trader

Posted: Thu Nov 12, 2020 9:09 am
by Reval
:) En koskaan! Must, must keep it simple ;) I'm going to call a halt pretty soon and release it. There's time to add bells and whistles in later versions. It's working to my satisfaction as it stands right now. Just a couple of finishing touches required...

Re: (WIP) Elite Trader

Posted: Thu Nov 12, 2020 12:27 pm
by Reval
Elite Trader, Version 0.1 Beta.

Anyone care to test it?

http://wiki.alioth.net/img_auth.php/e/e ... Trader.oxz

Bug reports welcomed.

Edit: From the summary:

Good Market trades count toward the Elite rating. Killings on the Market floor now earn equal cachet beside kills on the space-lanes. One killing is as valid as the other.

NB. This OXP takes no account of cargo contracts, special deals, scoops of drifting cargo in space, mined minerals, or of gems or precious metals. If it's not paid, the score's not made. If the game loads with full holds, the first score is missed.

TIP: If you do load the game with a full hold, just sell and re-buy before undocking.

Re: (WIP) Elite Trader

Posted: Thu Nov 12, 2020 1:54 pm
by montana05
Reval wrote: Thu Nov 12, 2020 8:49 am
Um... Yes, I was referring to the player's (personal) buying history. It would be so neat if the buy-prices could be stored and aggregated by Oolite itself in the manifest.list objects. It would be just another property, after all. Eller hur?
I do agree with spara, there is no importance for the core-game to log all prices a player bought goods. Are you aware that several OXP's add a lot of stations to every system ? All of them will have slightly different prices so if you intend to log all buyer-prices how you will do ? Average price per system or a single entry for every transaction ? Btw however you plan to solve it, you need to save every call for that, I would suggest to build an array.

Re: (WIP) Elite Trader

Posted: Thu Nov 12, 2020 1:57 pm
by Reval
All very, very true. Hence my decision not to take account of any of that. :)

Edit: I gladly leave the complexities to Spara and the excellent MO. :)

Re: (WIP) Elite Trader

Posted: Thu Nov 12, 2020 6:10 pm
by Reval
Does anyone happen to know the name of the OXP that adds new/extra commodities to the market screen? I'd like to test Elite Trader with those if possible.

Re: (WIP) Elite Trader

Posted: Thu Nov 12, 2020 6:36 pm
by Cholmondely
Darkside Moonshine Distillery adds in Witchfire Whisk(e)y
Fuel Tweaks adds in Quirium Fuel