Page 1 of 1

marketObserver_1.4 & AI Trading Assistant 2.2.4 incompatible

Posted: Thu Feb 07, 2013 4:29 pm
by Lestradae
Just wanted to report that marketObserver_1.4 & AI Trading Assistant 2.2.4 oxps have turned out to be incompatible on my system.

The market observer, if used together with the AI T Assistant, leaves its "trading hud" on after leaving the F8 screen, thereby spoiling the station screens and having no hud but the market one when leaving the station :?

Re: marketObserver_1.4 & AI Trading Assistant 2.2.4 incompat

Posted: Thu Feb 07, 2013 4:50 pm
by Solonar
I use only Market Observer 1.4 and sometimes the trading hud gets sticky for me also. I have to restart the game to unsticky it sometimes.

Re: marketObserver_1.4 & AI Trading Assistant 2.2.4 incompat

Posted: Thu Feb 07, 2013 9:16 pm
by spara
Lestradae wrote:
Just wanted to report that marketObserver_1.4 & AI Trading Assistant 2.2.4 oxps have turned out to be incompatible on my system.

The market observer, if used together with the AI T Assistant, leaves its "trading hud" on after leaving the F8 screen, thereby spoiling the station screens and having no hud but the market one when leaving the station :?
These two oxps clash hard, so they should not be used at the same time. Wildeblood mentions that in his readme, I should probably do so too. At least I'll have to add it to the wiki page.

Basically they both do the same job, but from very different angle. MarketObserver just observes trading and shows the data gathered to the player. It does not give any advices on trading or anything, just data. TradingAssistant on the other hand also collects data, but acts more like an advisor or assistant, giving player hints about trading. And in extreme, does the trading for you.

Both use the same kind of techniques in the market screen. Both do hud-switching and use console_messages to achieve overlay. That's why they clash.
Solonar wrote:
I use only Market Observer 1.4 and sometimes the trading hud gets sticky for me also. I have to restart the game to unsticky it sometimes.
Thanks for reporting. Hasn't happened to me, have to dig deeper. What hud are you using?

Re: marketObserver_1.4 & AI Trading Assistant 2.2.4 incompat

Posted: Thu Feb 07, 2013 10:43 pm
by Lestradae
spara wrote:
TradingAssistant on the other hand also collects data, but acts more like an advisor or assistant, giving player hints about trading. And in extreme, does the trading for you.
Since I found that out, this is the oxp of the two I am using. An AI does my trading ... I find that neat :D

Re: marketObserver_1.4 & AI Trading Assistant 2.2.4 incompat

Posted: Thu Feb 07, 2013 11:27 pm
by Solonar
spara wrote:
Solonar wrote:
I use only Market Observer 1.4 and sometimes the trading hud gets sticky for me also. I have to restart the game to unsticky it sometimes.
Thanks for reporting. Hasn't happened to me, have to dig deeper. What hud are you using?

I am using CRR HUD 1.0 2012-01-18

Re: marketObserver_1.4 & AI Trading Assistant 2.2.4 incompat

Posted: Fri Feb 08, 2013 1:41 am
by GGShinobi
Lestradae wrote:
spara wrote:
TradingAssistant on the other hand also collects data, but acts more like an advisor or assistant, giving player hints about trading. And in extreme, does the trading for you.
Since I found that out, this is the oxp of the two I am using. An AI does my trading ... I find that neat :D
Funny - for the same reason (it does the trading for you), I use Market Observer! :mrgreen:

marketObserver 1.4 & AI Trading Assistant 2.2.4

Posted: Fri Feb 08, 2013 2:42 am
by Wildeblood
spara wrote:
Basically they both do the same job, but from very different angle. MarketObserver just observes trading and shows the data gathered to the player. It does not give any advices on trading or anything, just data. Trading Assistant on the other hand also collects data, but acts more like an advisor or assistant, giving player hints about trading. And in extreme, does the trading for you.
So in fact, they don't do the same job, but are completely different. :D
spara wrote:
Both use the same kind of techniques in the market screen. Both do hud-switching and use console_messages to achieve overlay. That's why they clash.
That's why they clash, but it doesn't make them irreconcilable. The main source of incompatibility is that you butchered my beautiful, elegant HUD design and stuck advertisements all over it. :evil:
Well, the adverts don't cause a problem per se, but you left no room for comms messages to display.

Untested, but making them work together should be as simple as:-
1. over-writing Trading Assistant's resetHUD() function with a dummy function that doesn't do anything;
2. over-writing Trading Assistant's refreshCostDisplay() function with a dummy function that just calls the similar function in marketObserver;
3. stopping the timer(s) in marketObserver;
4. using a HUD with room for comms messages.

Point 4 is the problem: as I recall, in guiScreenChanged() you have a hard-coded player.ship.hud = "market_hud.plist", rather than a player.ship.hud = this.$marketHUD, so another script can't simply change that variable, but would have to over-write the whole guiScreenChanged() function (with a working, not just dummy, alternative).

P.S. I just had a look in marketObserver and I'm sceptical...

Code: Select all

this.$marketMessage = function() { //timer function for market screen
	if (guiScreen != "GUI_SCREEN_MISSION") {
		this.$gatherMarketInfo(false);
		this.$printValues();
		player.consoleMessage("\n\n");
	}
	else {
		this.$sweepMarketHud();
		return;
	}
}
- why exactly is $gatherMarketInfo(false) being called every eight seconds? I'm overlooking something there?

P.P.S. Bug report: in playerSoldCargo (and possibly elsewhere, too) you have:

Code: Select all

	if (this.$traderRankFeat) { //show profit, if trader rank is enabled
		this.$marketTimer.stop();
		this.$marketTimer.nextTime = clock.absoluteSeconds + 4;
		this.$marketTimer.start();
		this.$printValues();
		for (i = 0; i < 75; i++)
			tab = tab + " ";
		player.consoleMessage(tab+"Profit: "+formatCredits((this.$profit - prevProfit)/10, true, true )+"\n\n",3);	
		this.$setInstruction();
Always check a timer actually exists before stopping it, even if you "know" it exists.

At the moment, this.$marketTimer.stop(); is flummoxing my compatibility hack. If it weren't for that, it would work (perfectly?).

P.P.P.S. Okay, I've worked around it by pointing the timer at a dummy function. It's still a bug, though. Always check.

Uploading compatibility hack in a few minutes.

Re: marketObserver 1.4 & AI Trading Assistant 2.2.4

Posted: Fri Feb 08, 2013 5:57 am
by spara
Solonar wrote:
I am using CRR HUD 1.0 2012-01-18
Hm. :? That's a simple hud, should not cause any trouble. Does it misbehave after some specific switch? f8-f1 for example?
Wildeblood wrote:
So in fact, they don't do the same job, but are completely different. :D
:D Granted. I've been vague again. They both focus on trading and try to help the player.
Wildeblood wrote:
The main source of incompatibility is that you butchered my beautiful, elegant HUD design and stuck advertisements all over it. :evil:
It's the way of the world novadays. Nothings sacred anymore. There just isn't a place you can't stick an advert in. :lol:
Wildeblood wrote:
Well, the adverts don't cause a problem per se, but you left no room for comms messages to display.
Obviously. I'm not using comms, so that slot in you desing was screaming for something. Ads anyone? :)
Wildeblood wrote:
Point 4 is the problem: as I recall, in guiScreenChanged() you have a hard-coded player.ship.hud = "market_hud.plist", rather than a player.ship.hud = this.$marketHUD, so another script can't simply change that variable, but would have to over-write the whole guiScreenChanged() function (with a working, not just dummy, alternative).
I have said it before and I'll say it again. Thank you for reviewing my code. I'll change this, so it can be overridden by other oxps.
Wildeblood wrote:
...why exactly is $gatherMarketInfo(false) being called every eight seconds? I'm overlooking something there?
If I recall it right, this had something to do with Commodity Markets, that changes the prices on the fly. Not very clean, I admit. I'll check it when I have some spare time.
Wildeblood wrote:
...check a timer actually exists before stopping it, even if you "know" it exists.
Thanks for the heads up with these. I'm starting to get sloppy. :oops:
Wildeblood wrote:
Uploading compatibility hack in a few minutes.
Brilliant. Let's see if it still works after I have trained mine to behave. :mrgreen:

Re: marketObserver 1.4 & AI Trading Assistant 2.2.4

Posted: Fri Feb 08, 2013 6:01 am
by Solonar
spara wrote:
Solonar wrote:
I am using CRR HUD 1.0 2012-01-18
Hm. :? That's a simple hud, should not cause any trouble. Does it misbehave after some specific switch? f8-f1 for example?

It sometimes stickies when first viewing the commodities page, F8. It will show the hud but none of the graphics and then the hud will stay persistent even when viewing other pages and after launching from station. This behavior is infrequent and not difficult to manage for myself.

Re: marketObserver 1.4 & AI Trading Assistant 2.2.4

Posted: Fri Feb 08, 2013 7:07 pm
by Wildeblood
Wildeblood wrote:
Untested, but making them work together should be as simple as:-
1. over-writing Trading Assistant's resetHUD() function with a dummy function that doesn't do anything;
2. over-writing Trading Assistant's refreshCostDisplay() function with a dummy function that just calls the similar function in marketObserver;
3. stopping the timer(s) in marketObserver;
4. using a HUD with room for comms messages.
3. create a whole new set of highlight HUDs.

Brilliant new strategy: just leave the timers in both OXPs running, it doesn't seem to cause a problem. This makes for a much simpler script. If I'd known it was that easy, I'd have done it before today.

http://wiki.alioth.net/index.php/AI_Tra ... t#Download

Image

Re: marketObserver_1.4 & AI Trading Assistant 2.2.4 incompat

Posted: Fri Feb 08, 2013 9:48 pm
by GGShinobi
If you actually manage to get both oxp's truly compatible, then I'll add the Trading Assistant again! I like how he calls me "boss"! :lol: