(WIP) Elite Trader

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
Reval
---- E L I T E ----
---- E L I T E ----
Posts: 402
Joined: Thu Oct 29, 2020 3:14 am
Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.

Re: (WIP) Elite Trader

Post 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.
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
User avatar
Reval
---- E L I T E ----
---- E L I T E ----
Posts: 402
Joined: Thu Oct 29, 2020 3:14 am
Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.

Re: (WIP) Elite Trader

Post 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.
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
dybal
---- E L I T E ----
---- E L I T E ----
Posts: 499
Joined: Mon Feb 10, 2020 12:47 pm

Re: (WIP) Elite Trader

Post 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
User avatar
Reval
---- E L I T E ----
---- E L I T E ----
Posts: 402
Joined: Thu Oct 29, 2020 3:14 am
Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.

Re: (WIP) Elite Trader

Post 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.
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2676
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: (WIP) Elite Trader

Post 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).
User avatar
Reval
---- E L I T E ----
---- E L I T E ----
Posts: 402
Joined: Thu Oct 29, 2020 3:14 am
Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.

Re: (WIP) Elite Trader

Post 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?
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2676
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: (WIP) Elite Trader

Post 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.
User avatar
Reval
---- E L I T E ----
---- E L I T E ----
Posts: 402
Joined: Thu Oct 29, 2020 3:14 am
Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.

Re: (WIP) Elite Trader

Post 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?
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2676
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: (WIP) Elite Trader

Post 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.
User avatar
Reval
---- E L I T E ----
---- E L I T E ----
Posts: 402
Joined: Thu Oct 29, 2020 3:14 am
Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.

Re: (WIP) Elite Trader

Post 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...
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
User avatar
Reval
---- E L I T E ----
---- E L I T E ----
Posts: 402
Joined: Thu Oct 29, 2020 3:14 am
Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.

Re: (WIP) Elite Trader

Post 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.
Last edited by Reval on Thu Nov 12, 2020 6:16 pm, edited 2 times in total.
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
User avatar
montana05
---- E L I T E ----
---- E L I T E ----
Posts: 1166
Joined: Mon May 30, 2016 3:54 am
Location: lurking in The Devils Triangle (G1)

Re: (WIP) Elite Trader

Post 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.
Scars remind us where we've been. They don't have to dictate where we're going.
User avatar
Reval
---- E L I T E ----
---- E L I T E ----
Posts: 402
Joined: Thu Oct 29, 2020 3:14 am
Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.

Re: (WIP) Elite Trader

Post 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. :)
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
User avatar
Reval
---- E L I T E ----
---- E L I T E ----
Posts: 402
Joined: Thu Oct 29, 2020 3:14 am
Location: At home in the Xexedi Cluster, driving an FE Asp II, Laenina's Flux.

Re: (WIP) Elite Trader

Post 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.
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
User avatar
Cholmondely
Archivist
Archivist
Posts: 4997
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: (WIP) Elite Trader

Post by Cholmondely »

Darkside Moonshine Distillery adds in Witchfire Whisk(e)y
Fuel Tweaks adds in Quirium Fuel
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Post Reply