[Release] In System Trader OXP 1.40!

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

Moderators: winston, another_commander

User avatar
GGShinobi
---- E L I T E ----
---- E L I T E ----
Posts: 291
Joined: Tue Dec 25, 2012 7:20 pm

Re: [Release] In System Trader OXP 1.0!

Post by GGShinobi »

spara wrote:
I'm just not sure that restocking the market on launch is the right way :?. Maybe some well thought in-system cargo contracts?
I also like the idea, this will make the systems feel "more alive". But I agree with spara, restocking upon launch feels a little artificial to me. Would "real-time" restocking be possible instead? So when other ships dock or launch, the supplies would sometimes change (might also drop since the other ships might also buy something), perhaps even taking the type of ship into consideration... (fighters rarely buy, traders often buy and sell, shuttles buy stuff that no trader would by because they sell it on the planet)... but I admit, this sounds complicated... :roll:

Or simulate "real-time-trading" by adding and removing some goods in irregular intervals...? :?: :)
忍 knowing that enough is enough, you'll always have enough.

Running Oolite 1.77 on Ubuntu Linux 12.04 LTS
User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

Re: [Release] In System Trader OXP 1.0!

Post by Dr.Tripsa »

The concerns over possible abuse (though really, if someone wants to abuse Oolite, they will)
are addressed in the 1.05 update. OP will be edited to reflect these changes soon.

There is a cost to constantly re-docking : You will get the attention of pirates!
Your well meaning friends at the station will poke their noses in your business, just until you "Get out a bit more".
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

Re: [Release] In System Trader OXP 1.0!

Post by Dr.Tripsa »

Version 1.10 Has bee released with some important changes (original post on this thread edited to reflect this)

in short:
1. You will now only get a new "menu" of sale items if it has been over an hour (game time) since you last got a fresh "menu" from a particular mainStation.
2. Pirate ambushes have been fixed.
3. Witty chatter has been moved to .plist
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
JeX
Competent
Competent
Posts: 54
Joined: Mon Jan 21, 2013 2:13 pm

Re: [Release] In System Trader OXP 1.0!

Post by JeX »

Dr.Tripsa wrote:
Version 1.10 Has bee released with some important changes (original post on this thread edited to reflect this)

in short:
1. You will now only get a new "menu" of sale items if it has been over an hour (game time) since you last got a fresh "menu" from a particular mainStation.
2. Pirate ambushes have been fixed.
3. Witty chatter has been moved to .plist
Awesome!
Downloading it as we speak. I really like the idea that you could get pirate attention, although my exploit statements itch in me. Can and will this somehow be exploited? :x

Because this is the internet and I feel the need to correct anything that can be perceived as denying facts, I would like to point out that you do not, in fact, spend 20 minutes on docking, only if you auto-dock. So redocking manually will take me less than 8 seconds since I will only need to launch, decrease speed to 0, turn around and fly the other way back into the station.

So: good that you decided to make the change in 1.11, I find it much more realistic. Although maybe an hour is a bit much? I dunno but maybe 10 minutes should be more than enough?
User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

Re: [Release] In System Trader OXP 1.0!

Post by Dr.Tripsa »

JeX wrote:
Dr.Tripsa wrote:
Version 1.10 Has bee released with some important changes (original post on this thread edited to reflect this)

in short:
1. You will now only get a new "menu" of sale items if it has been over an hour (game time) since you last got a fresh "menu" from a particular mainStation.
2. Pirate ambushes have been fixed.
3. Witty chatter has been moved to .plist
Awesome!
Downloading it as we speak. I really like the idea that you could get pirate attention, although my exploit statements itch in me. Can and will this somehow be exploited? :x

Because this is the internet and I feel the need to correct anything that can be perceived as denying facts, I would like to point out that you do not, in fact, spend 20 minutes on docking, only if you auto-dock. So redocking manually will take me less than 8 seconds since I will only need to launch, decrease speed to 0, turn around and fly the other way back into the station.

So: good that you decided to make the change in 1.11, I find it much more realistic. Although maybe an hour is a bit much? I dunno but maybe 10 minutes should be more than enough?
Not denying facts, just made what may be a false assumption that the 10min time jump that happens on launch also happened on docking, assuming there are other stations and trade oxps installed there should be plenty to do in that (game time ) hour :) and again, that's an hour game time (clock on the hud), not real time :)
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
JeX
Competent
Competent
Posts: 54
Joined: Mon Jan 21, 2013 2:13 pm

Re: [Release] In System Trader OXP 1.0!

Post by JeX »

Dr.Tripsa wrote:
JeX wrote:
Dr.Tripsa wrote:
Version 1.10 Has bee released with some important changes (original post on this thread edited to reflect this)

in short:
1. You will now only get a new "menu" of sale items if it has been over an hour (game time) since you last got a fresh "menu" from a particular mainStation.
2. Pirate ambushes have been fixed.
3. Witty chatter has been moved to .plist
Awesome!
Downloading it as we speak. I really like the idea that you could get pirate attention, although my exploit statements itch in me. Can and will this somehow be exploited? :x

Because this is the internet and I feel the need to correct anything that can be perceived as denying facts, I would like to point out that you do not, in fact, spend 20 minutes on docking, only if you auto-dock. So redocking manually will take me less than 8 seconds since I will only need to launch, decrease speed to 0, turn around and fly the other way back into the station.

So: good that you decided to make the change in 1.11, I find it much more realistic. Although maybe an hour is a bit much? I dunno but maybe 10 minutes should be more than enough?
Not denying facts, just made what may be a false assumption that the 10min time jump that happens on launch also happened on docking, assuming there are other stations and trade oxps installed there should be plenty to do in that (game time ) hour :) and again, that's an hour game time (clock on the hud), not real time :)
Heh, then here's another horrible exploit I just thought of (although now we're getting into really exploiting game rules): sell all pylons and re-equip a couple of missiles. The game clock should be adjusted at least a couple of hours for this installation to your ship, and you can safely launch and manually re-dock to fill up your cargo hold once again.

I do admit that this really borders on cheating but the exploit is there. Thus I would still argue that you should make the counter count actual playing time rather than game-time and set the timer for 5 minutes until new stock is available, provided such a global variable exists that is. :)
User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

Re: [Release] In System Trader OXP 1.11!

Post by Dr.Tripsa »

really at that point, if someone is desperate enough to abuse it, they will... My balance is built in for 'fair use' players LOL
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

Re: [Release] In System Trader OXP 1.20!

Post by Dr.Tripsa »

Updated with some suggestions from spara in mind, see OP for details!

General summary:
Items now change periodically while in system and not docked.
Frequency depends upon how busy the system is, trader count.
(so eh... defending traders from pirates... good thing)
Only one class (randomly chosen) of commodity is cycled at a time!
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: [Release] In System Trader OXP 1.20!

Post by spara »

Dr.Tripsa wrote:
Updated with some suggestions from spara in mind, see OP for details!

General summary:
Items now change periodically while in system and not docked.
Frequency depends upon how busy the system is, trader count.
(so eh... defending traders from pirates... good thing)
Only one class (randomly chosen) of commodity is cycled at a time!
You're fast :D. Have to check it, when I got some spare time. Glad it's a weekend.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: [Release] In System Trader OXP 1.20!

Post by Wildeblood »

Dr.Tripsa wrote:
Items now change periodically while in system and not docked.
Frequency depends upon how busy the system is, trader count.

Code: Select all

		 //Change the timer.interval, based on system activity, TY Spara!
             if (system.countShipsWithPrimaryRole("trader") !== 0)
             {
			 // 1/traders * (30 + [0 - 30]) mins till next price and restock check
             this.timer.interval = Math.round((1 / system.countShipsWithPrimaryRole("trader")) * (1800 + (Math.random() * 1800)));
             }
Either I am overlooking something, or calling a slow function like system.countShipsWithPrimaryRole twice in succession is wrongness.

Code: Select all

		 //Change the timer.interval, based on system activity, TY Spara!
             var traders = system.countShipsWithPrimaryRole("trader");
             if (traders > 0)
             {
			 // 1/traders * (30 + [0 - 30]) mins till next price and restock check
             this.timer.interval = Math.round((1 / traders) * (1800 + (Math.random() * 1800)));
             }
User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

Re: [Release] In System Trader OXP 1.20!

Post by Dr.Tripsa »

No I didn't catch the double call there, thank you for your help.

Will release a fix (though I doubt it caused anyone any real issues) shortly.
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

Re: [Release] In System Trader OXP 1.21!

Post by Dr.Tripsa »

1.22 released, if you got 1.21 REPLACE IT!

it was broken.
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2691
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: [Release] In System Trader OXP 1.22!

Post by spara »

Sorry Dr.Tripsa :(. If I had realized, that you'll take those code snippets straight into your code, I would have been more pedantic.

As a rule of thumb, if there's more than one call to a function in your script, it pays off to make just one call and use a variable later on. And to my present understanding, in JS, local variables are the fastests ones.
User avatar
Dr.Tripsa
Dangerous
Dangerous
Posts: 84
Joined: Mon Apr 30, 2012 9:33 pm
Location: In your cargo bay, eating your chips.

Re: [Release] In System Trader OXP 1.22!

Post by Dr.Tripsa »

spara wrote:
Sorry Dr.Tripsa :(. If I had realized, that you'll take those code snippets straight into your code, I would have been more pedantic.

As a rule of thumb, if there's more than one call to a function in your script, it pays off to make just one call and use a variable later on. And to my present understanding, in JS, local variables are the fastests ones.

No problem Spara, It was late and I was interested in getting it done just to see it working.
As you can see it wasn't a direct 'copy' as I used it to redefine the timer.interval rather than set a whole new timer, which probably would have been even less efficient.

and by my estimation, Spara, there are plenty of pedantic personalities here already ;)
No, I'm not a Trumble... that's a speciest and offensive remark!
~munch~
What?.... I'm hungry.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: [Release] In System Trader OXP 1.22!

Post by Smivs »

Dr.Tripsa wrote:
...there are plenty of pedantic personalities here...
Not so much pedantic, but we can seem overly concerned with minute details or formalisms. :D
Commander Smivs, the friendliest Gourd this side of Riedquat.
Post Reply