Been there . It's not that simple to say whether a trade is a good or bad. For scooped items all trades are kind of good. How about cargo contracts? If you damage some cargo and have to buy replacements, do you need to take those into account? How about buying something for a price above the average and selling it for even higher? In short, I don't see a way for a simple conditional mechanic on Traders' rating that would not do some sort of logging.
(WIP) Elite Trader
Moderators: winston, another_commander
(WIP) Elite Trader
[Moved from topic "Tinkerer's Workshop - OXP tweaking for fun and profit!"]
- Reval
- ---- 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: Tinkerer's Workshop - OXP tweaking for fun and profit!
Hmmm... Kiitoksia That's food for thought indeed. As I mentioned somewhere else I don't aim even to climb the foothills of the heights you've achieved with MO. It's something very much more basic - just a sop to the pride of us Grocers
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
- Reval
- ---- 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: Tinkerer's Workshop - OXP tweaking for fun and profit!
spara wrote: ↑Mon Nov 09, 2020 4:41 pmBeen there . It's not that simple to say whether a trade is a good or bad. For scooped items all trades are kind of good. How about cargo contracts? If you damage some cargo and have to buy replacements, do you need to take those into account? How about buying something for a price above the average and selling it for even higher? In short, I don't see a way for a simple conditional mechanic on Traders' rating that would not do some sort of logging.
Code: Select all
"use strict";
this.name = "Elite Trader (Milk Run)";
this.author = "Reval";
this.description = "A profitable trade scores toward Elite";
/* It can be as simple as this, and I think it should be:
killing a pirate is not a complex matter either...
This is for a single bulk buy/sell on the market-floor
on a typical Milk Run.
*/
this.playerSoldCargo = function(commodity, units, price) {
// selling preliminaries - update quantity and price
this.$etSoldUnits += units;
this.$etSoldPrice += price;
// see if we made a profit
this.$etMadeProfit = (this.$etSoldPrice > this.$etBoughtPrice);
if ((units > 2) && (!this.$etDone) && (this.$etBoughtUnits>0) && (this.$etMadeProfit)) {
// increment score on the above conditions
player.score ++;
player.consoleMessage("You made a killing!");
// for simplicity, only one score per station
// but allows for in-system inter-station activity
this.$etDone = true;
// for simplicity, after one sale, reset the buy values
this.$etBoughtPrice = 0;
this.$etBoughtUnits = 0;
}
}
this.playerBoughtCargo = function (commodity, units, price) {
// buying preliminaries - record quantity and price
this.$etBoughtUnits += units;
this.$etBoughtPrice += price;
// buy price for single commodity (simple)
// assumes player buys just once.
player.consoleMessage("In hold: "+this.$etBoughtUnits+" pods ( "+formatCredits((this.$etBoughtPrice*units)/10),true,true)+" )");
}
this.shipDockedWithStation = function(station) {
// clear flags and sold-quantities on docking
this.$etDone = false;
this.$etMadeProfit = false;
this.$etSoldUnits = 0;
this.$etSoldPrice = 0;
}
this.startUp = function() {
log(this.name, "Initialising OXP " + this.name);
// declare & initialize globals
this.$etDone = false;
this.$etMadeProfit = false;
this.$etSoldUnits = 0;
this.$etSoldPrice = 0;
this.$etBoughtPrice = 0;
this.$etBoughtUnits = 0;
}
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Sure it can be simple Just don't do any errors as a player. I mean, don't miss buy or change your mind during your station visit or anything. But yeah, that's probably roughly how I started envisioning MO's Traders' rating years ago and ended up with the current one after gazillion steps. The simpler you can make it, the better. Go for it.
- Reval
- ---- 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: Tinkerer's Workshop - OXP tweaking for fun and profit!
Cheers
There are obviously several little wrinkles to add to the code there. And I'm aware of the glitchy shortcomings of the script as it stands: For example, you must save the game with nothing in the hold. On startup, I will find a way to establish the manifest. It was just quick and dirty to demonstrate the point about simplicity. It works great alongside MO of course
There are obviously several little wrinkles to add to the code there. And I'm aware of the glitchy shortcomings of the script as it stands: For example, you must save the game with nothing in the hold. On startup, I will find a way to establish the manifest. It was just quick and dirty to demonstrate the point about simplicity. It works great alongside MO of course
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Yup. The saving part is probably the most notable wrinkle. Buy something expensive, save, load and sell to boost your rating. You probably need to save at least the units bought and the price payed. This is getting a bit off topic btw. Maybe you should make a thread for this?
- Reval
- ---- 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: Tinkerer's Workshop - OXP tweaking for fun and profit!
Would do if I knew how (phpBB-wise) - ie. moving the pertinent posts there with it too...
Perhaps someone more familiar with the ins-and-outs could oblige?
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Just start a new thread and ask another_commander to move the previous posts from this thread to the new thread.
Btw. The more I think about your simplified idea, the better it looks. I would even try to simplify it more. How about just looking at the balance when entering the market and leaving the market?
- Reval
- ---- 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: Tinkerer's Workshop - OXP tweaking for fun and profit!
Not sure I'm quite with you... You mean there are event handlers for entering and leaving the market?
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
There is an event handler for UI screen change with to and from information.
- Reval
- ---- 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: Tinkerer's Workshop - OXP tweaking for fun and profit!
Oh interesting. I shall Wiki that right now...
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
- Reval
- ---- 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.
(WIP) Elite Trader
another_commander, would you be kind enough to move recent posts pertaining to this from the Tinkerer thread to here? Maybe starting with the one where Spara quotes me and says "Been there . It's not that simple to say whether a trade is a good or bad."
Thanks in advance
Thanks in advance
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
- Reval
- ---- 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.
(WIP) Elite Trader
Thank you! But where's it gone? - It doesn't appear on any of my 'Quick links'. And the title is still "Re: Tinkerer's Workshop - OXP tweaking for fun and profit!" when shouldn't it be "(WIP) Elite Trader?"(Maybe this post will bump it)...
Edit: Ah wait - maybe I should change the title (can I do that?)
Edit2: Nope, still didn't do it.
Edit: Ah wait - maybe I should change the title (can I do that?)
Edit2: Nope, still didn't do it.
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.
-
- Quite Grand Sub-Admiral
- Posts: 6681
- Joined: Wed Feb 28, 2007 7:54 am
Re: (WIP) Elite Trader
Fixed.
- Reval
- ---- 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
Much obliged to you, a_c.
Spara, I wonder... could you elaborate a little on what you meant when you said "look at the balance" when entering or leaving the Market screen? Is there a pre-defined variable for the balance?
Dor 'call me Grocer' Reval (a Xexedian Laver) was always considered a little backward.