That same link (to marketObserver 1.5) is working fine now.GGShinobi wrote:Just tried to download, but I get an error claiming that the download has been removed...
Link used: https://www.box.com/s/u0hij6k0jzid4ujp2xi2
[Release] Market Observer
Moderators: winston, another_commander
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: [Release] marketObserver 1.5
Re: [Release] marketObserver 1.5
Affirmative. Mysteries of the internet...Wildeblood wrote:That same link (to marketObserver 1.5) is working fine now.GGShinobi wrote:Just tried to download, but I get an error claiming that the download has been removed...
Link used: https://www.box.com/s/u0hij6k0jzid4ujp2xi2
忍 knowing that enough is enough, you'll always have enough.
Running Oolite 1.77 on Ubuntu Linux 12.04 LTS
Running Oolite 1.77 on Ubuntu Linux 12.04 LTS
Re: [Release] marketObserver 1.5
I like the fix in this release. The market hud did stick for me one time, but changing screens corrected the issue rather than needing to restart the game.
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: [Release] marketObserver 1.5
Solonar, if it happens again please check your Latest.log file for a time-out error, like the ones in my message from January 20th on the previous page. I suspect this is the cause of your problem:-
I would try replacing that for loop with a single line:-
P.S. See pointer 'A', opening it in Windows Wordpad I see a stray character after the ||.
Code: Select all
this.$sweepMarketHud = function() {//restore hud & remove timer
if (this.$marketTimer != null ||Â player.ship.hud == this.$marketHud) { <------- A
var i;
var padding =" ";
this.$removeTimer();
for (i = 0; i <= this.$gathValues.length; i++) { <------------
player.consoleMessage(padding); <-------------
padding = padding + " "; <-------------
}
if (this.$restoreHud != this.$marketHud)
player.ship.hud = this.$restoreHud;
else //if something has gone wrong and restorehud is the same as markethud. Then fall back to fallbackhud
player.ship.hud = this.$fallBackHud;
player.ship.removeEquipment(this.$randomAdd);
}
}
Code: Select all
player.consoleMessage("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
Re: [Release] marketObserver 1.5
It might very well be this that's causing the problems and the reason I can't reproduce it as I had no problem earlier either. If this really solves it, I owe you a big one, Wildeblood, again. That stray char is weird, I'm using Geany on Linux and don't see a thing, neither with less or nano. Could be an encoding thingy?Wildeblood wrote:Solonar, if it happens again please check your Latest.log file for a time-out error, like the ones in my message from January 20th on the previous page. I suspect this is the cause of your problem:-
I would try replacing that for loop with a single line:-Code: Select all
this.$sweepMarketHud = function() {//restore hud & remove timer if (this.$marketTimer != null ||Â player.ship.hud == this.$marketHud) { <------- A var i; var padding =" "; this.$removeTimer(); for (i = 0; i <= this.$gathValues.length; i++) { <------------ player.consoleMessage(padding); <------------- padding = padding + " "; <------------- } if (this.$restoreHud != this.$marketHud) player.ship.hud = this.$restoreHud; else //if something has gone wrong and restorehud is the same as markethud. Then fall back to fallbackhud player.ship.hud = this.$fallBackHud; player.ship.removeEquipment(this.$randomAdd); } }
P.S. See pointer 'A', opening it in Windows Wordpad I see a stray character after the ||.Code: Select all
player.consoleMessage("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: [Release] marketObserver 1.5
Are you an Unamerican with one of those pesky foreign keyboards? (There's another one after the || on line 19, too.)spara wrote:Could be an encoding thingy?
I have a feature request for version 1.6 or later: I've never understood why you use a last in, first out list. I've never heard of anyone in real life calculating profit that way. Since they're fungible goods, the cost should be averaged, but I understand you don't want to do that.
If you view the trading process as a putting goods through your possession, the inventory should handled first in, first out, i.e. through-put. A more conservative approach, that avoids counting chooks before they hatch, is to always sell the highest cost goods first, and lower cost, more profitable inventory afterwards. That's what I'd like you to do.
Not in playerBoughtCargo, because the display would look broken, nor when leaving the market screen, because the player might return to the screen several times, but on shipLaunchedFromStation sort the arrays into descending order of cost. So that the next time you dock, the purchase prices displayed are the highest prices you've paid, rather than the most recent prices you've paid.
Re: [Release] marketObserver 1.5
Quilty . Let's see if I can make them visible to me, so I can remove them. I have always hated encoding things. In the past I wrote some mobile stuff (SMS & WAP & WEB) with Java and I had to use Finnish as it was for Finnish end users. My head was spinning with UTF and ISO-88591 etc. Happy that's in the past.Wildeblood wrote:Are you an Unamerican with one of those pesky foreign keyboards? (There's another one after the || on line 19, too.)spara wrote:Could be an encoding thingy?
I'm no economist, but to my understanding in the real world two methods are used for profit counting: average and FIFO. If someone knows better, correct me.Wildeblood wrote:I have a feature request for version 1.6 or later: I've never understood why you use a last in, first out list. I've never heard of anyone in real life calculating profit that way. Since they're fungible goods, the cost should be averaged, but I understand you don't want to do that.
So you're right, not done like that in the real world. Actually in the first version I had the whole log open like this 2x6.7 4x7.2 4x5.2 etc and the list was purged with FIFO principle. It was nice with my widescreen monitor, but when I shrinked it down, only the last one (left most) was visible . Purging from the one that was visible made sense then and I haven't thought it since.
This is a sensible idea and worth implementing.Wildeblood wrote:...So that the next time you dock, the purchase prices displayed are the highest prices you've paid, rather than the most recent prices you've paid.
Re: [Release] marketObserver 1.6
New version (1.6).
* Some reordering of execution and Wildebloods suggestion for fixing Solonar's "sticky hud" problem. Let's hope this helps.
* Implemented Wildebloods suggestion of ordering the purchace log. Now you sell the most expensive ones first. Makes more sense now.
* Some reordering of execution and Wildebloods suggestion for fixing Solonar's "sticky hud" problem. Let's hope this helps.
* Implemented Wildebloods suggestion of ordering the purchace log. Now you sell the most expensive ones first. Makes more sense now.
Re: [Release] marketObserver 1.6
Using trunk 5635 and Market Observer 1.6, the first time view took a few seconds to load but there were no display problems so far. The following appeared in the logs after the first time use and the long load time...
12:59:06.945 [script.javaScript.timeLimit]: ***** ERROR: Script "market_observer" ran for 4.58903 seconds and has been terminated.
12:59:06.945 [script.javaScript.stackTrace]: 0 (../AddOns/Market Observer 1.6.oxp/Config/script.js:288) <anonymous function>
12:59:06.946 [script.javaScript.stackTrace]: this: [Script "market_observer" version 1.6]
12:59:06.946 [script.javaScript.stackTrace]: 1 (../AddOns/Market Observer 1.6.oxp/Config/script.js:179) <anonymous function>
12:59:06.946 [script.javaScript.stackTrace]: this: [Script "market_observer" version 1.6]
12:59:06.946 [script.javaScript.stackTrace]: from: "GUI_SCREEN_SHORT_RANGE_CHART"
12:59:06.946 [script.javaScript.stackTrace]: to: "GUI_SCREEN_MARKET"
Re: [Release] marketObserver 1.6
Looks like it's just too heavy. I'll try to lightweight it a bit.Solonar wrote:Using trunk 5635 and Market Observer 1.6, the first time view took a few seconds to load but there were no display problems so far. The following appeared in the logs after the first time use and the long load time...
12:59:06.945 [script.javaScript.timeLimit]: ***** ERROR: Script "market_observer" ran for 4.58903 seconds and has been terminated.
12:59:06.945 [script.javaScript.stackTrace]: 0 (../AddOns/Market Observer 1.6.oxp/Config/script.js:288) <anonymous function>
12:59:06.946 [script.javaScript.stackTrace]: this: [Script "market_observer" version 1.6]
12:59:06.946 [script.javaScript.stackTrace]: 1 (../AddOns/Market Observer 1.6.oxp/Config/script.js:179) <anonymous function>
12:59:06.946 [script.javaScript.stackTrace]: this: [Script "market_observer" version 1.6]
12:59:06.946 [script.javaScript.stackTrace]: from: "GUI_SCREEN_SHORT_RANGE_CHART"
12:59:06.946 [script.javaScript.stackTrace]: to: "GUI_SCREEN_MARKET"
Re: [Release] marketObserver 1.6.1
New version 1.6.1. Optimized and lightweighted code as much as possible (within my limited skills ). Hopefully that's enough to make it work for Solonar and possibly others who are having trouble with it.
Re: [Release] marketObserver 1.6.1
Using trunk 5635 and Market Observer 1.6.1, the first time use and view of the commodities page displayed the market hud improper. The spaces reserved for the prices and the advertisements were present but were empty. Changing to other pages and them viewing the commodity page corrected the display of the market hud.
The following appeared in the logs at this time...
The following appeared in the logs at this time...
15:28:45.499 [script.javaScript.timeLimit]: ***** ERROR: Script "market_observer" ran for 3.86869 seconds and has been terminated.
15:28:45.499 [script.javaScript.stackTrace]: 0 (../AddOns/Market Observer 1.6.1.oxp/Config/script.js:182) <anonymous function>
15:28:45.499 [script.javaScript.stackTrace]: this: [Script "market_observer" version 1.6.1]
15:28:45.500 [script.javaScript.stackTrace]: from: "GUI_SCREEN_SHORT_RANGE_CHART"
15:28:45.500 [script.javaScript.stackTrace]: to: "GUI_SCREEN_MARKET
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: [Release] marketObserver 1.6.1
The missing advertisements are easily explained. When Spara addedSolonar wrote:The spaces reserved for the prices and the advertisements were present but were empty. Changing to other pages and them viewing the commodity page corrected the display of the market hud.
this.$setAds();
to the code just before uploading, he put it in the wrong place. Obviously he doesn't have ads on his personal version. Now the truth comes out, bwahaha! Code: Select all
this.guiScreenChanged = function(to, from) {
if (to == "GUI_SCREEN_MARKET" && player.ship.docked && guiScreen != "GUI_SCREEN_MISSION") { //swap to market hud
this.$checkMinMax = true;
this.$restoreHud = player.ship.hud;
player.ship.hud = this.$marketHud;
this.$startTimer();
}
if (from == "GUI_SCREEN_MARKET") { //restore hud
this.$setAds(); // <--------------------------------------!
this.$sweepMarketHud();
}
}
Code: Select all
if (to == "GUI_SCREEN_MARKET" && player.ship.docked && guiScreen != "GUI_SCREEN_MISSION")
Code: Select all
if (guiScreen === "GUI_SCREEN_MARKET" && player.ship.docked)
Re: [Release] marketObserver 1.6.1
Got me...almost . I set ads in startUp and after that every time exiting market screen. When hunting this one down I have taken every action possible (?) away from transition to market screen.Wildeblood wrote:The missing advertisements are easily explained. When Spara addedSolonar wrote:The spaces reserved for the prices and the advertisements were present but were empty. Changing to other pages and them viewing the commodity page corrected the display of the market hud.this.$setAds();
to the code just before uploading, he put it in the wrong place. Obviously he doesn't have ads on his personal version. Now the truth comes out, bwahaha!
That I put for Commodity Markets that puts up a mission screen when switching to market screen. Didn't want to switch hud on top that. Your line works as well of course. I'll change it, that's one expression less to evaluate.Wildeblood wrote:And what's this paranoia about mission screens?Code: Select all
if (to == "GUI_SCREEN_MARKET" && player.ship.docked && guiScreen != "GUI_SCREEN_MISSION")
Code: Select all
if (guiScreen === "GUI_SCREEN_MARKET" && player.ship.docked)
I made a couple of alterations further and sent a test version to Solonar, let's see what happens. I'm quite lost here as this oxp works for with no problem.
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: [Release] marketObserver 1.6.1
Here's one I got when I tried 1.6.1 this morning:-
11:40:43.013 [script.javaScript.exception.undeclaredVar]: ***** JavaScript exception (market_observer 1.6.1): ReferenceError: assignment to undeclared variable j
11:40:43.013 [script.javaScript.exception.undeclaredVar]: ../AddOns/marketObserver_1.6.1.oxp/Config/script.js, line 221.
IIRC, this is the first line of printValues where the var declaration is missing the 'j". But this is a new bug, when I added the j the display started working, but with the delays Solonar reports.
I wonder... (ignore what follows, it's just me thinking out loud)... is it because gatherMarketValues (?) is writing the array and printValues is reading the array at the same time...?
11:40:43.013 [script.javaScript.exception.undeclaredVar]: ***** JavaScript exception (market_observer 1.6.1): ReferenceError: assignment to undeclared variable j
11:40:43.013 [script.javaScript.exception.undeclaredVar]: ../AddOns/marketObserver_1.6.1.oxp/Config/script.js, line 221.
IIRC, this is the first line of printValues where the var declaration is missing the 'j". But this is a new bug, when I added the j the display started working, but with the delays Solonar reports.
I wonder... (ignore what follows, it's just me thinking out loud)... is it because gatherMarketValues (?) is writing the array and printValues is reading the array at the same time...?