marketObserver_1.4 & AI Trading Assistant 2.2.4 incompatible

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

Moderators: winston, another_commander

Post Reply
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

marketObserver_1.4 & AI Trading Assistant 2.2.4 incompatible

Post 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 :?
User avatar
Solonar
Deadly
Deadly
Posts: 174
Joined: Sun Dec 04, 2011 4:04 am
Location: Galaxy 2 - Space Truckin

Re: marketObserver_1.4 & AI Trading Assistant 2.2.4 incompat

Post 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.
Image

SolarTech proudly presents the Plasma Turret Regulator Device Apparatus, aka the Turret Toggler
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: marketObserver_1.4 & AI Trading Assistant 2.2.4 incompat

Post 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?
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

Re: marketObserver_1.4 & AI Trading Assistant 2.2.4 incompat

Post 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
User avatar
Solonar
Deadly
Deadly
Posts: 174
Joined: Sun Dec 04, 2011 4:04 am
Location: Galaxy 2 - Space Truckin

Re: marketObserver_1.4 & AI Trading Assistant 2.2.4 incompat

Post 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
Image

SolarTech proudly presents the Plasma Turret Regulator Device Apparatus, aka the Turret Toggler
User avatar
GGShinobi
---- E L I T E ----
---- E L I T E ----
Posts: 291
Joined: Tue Dec 25, 2012 7:20 pm

Re: marketObserver_1.4 & AI Trading Assistant 2.2.4 incompat

Post 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:
忍 knowing that enough is enough, you'll always have enough.

Running Oolite 1.77 on Ubuntu Linux 12.04 LTS
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:

marketObserver 1.4 & AI Trading Assistant 2.2.4

Post 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.
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: marketObserver 1.4 & AI Trading Assistant 2.2.4

Post 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:
User avatar
Solonar
Deadly
Deadly
Posts: 174
Joined: Sun Dec 04, 2011 4:04 am
Location: Galaxy 2 - Space Truckin

Re: marketObserver 1.4 & AI Trading Assistant 2.2.4

Post 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.
Image

SolarTech proudly presents the Plasma Turret Regulator Device Apparatus, aka the Turret Toggler
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: marketObserver 1.4 & AI Trading Assistant 2.2.4

Post 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
Last edited by Wildeblood on Sat Feb 09, 2013 4:01 am, edited 1 time in total.
In your heart, you know it's flat.
User avatar
GGShinobi
---- E L I T E ----
---- E L I T E ----
Posts: 291
Joined: Tue Dec 25, 2012 7:20 pm

Re: marketObserver_1.4 & AI Trading Assistant 2.2.4 incompat

Post 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:
忍 knowing that enough is enough, you'll always have enough.

Running Oolite 1.77 on Ubuntu Linux 12.04 LTS
Post Reply