AI Trading Assistant

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

Moderators: winston, another_commander

Post Reply
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: AI Trading Assistant OXP ver 1.9

Post by Wildeblood »

Styggron wrote:
However if as you said you can store the price paid by the player then you can have an extra column that said "price paid" without the automation of having anything in red or green text for don't sell or sell. This way the player can see what they paid for and compare it to the column the space station shows manually....... this would be extremely useful and the next best thing. :-)
Like this?

Image

Yes, it's possible and the next thing to do, but with Oolite 1.77 coming out yesterday the script needs a lot of re-writing, so version 1.10 for Oolite 1.76 will never be finished, and please don't hold your breathe waiting for Trading Assistant 2.0. :mrgreen:
User avatar
Styggron
Above Average
Above Average
Posts: 17
Joined: Sun May 27, 2012 12:09 am

Re: AI Trading Assistant OXP ver 1.9

Post by Styggron »

Yes exactly like that. PERFECT :-)

From your post I guess we won't be getting the 1.76.1 version nor the 1.77 one anytime soon then? :-(

Pity, it would make it the perfect trading OXP as it is really the only trading assistant there is. I guess It's back to writing the values on paper.

Looking forward to when it is available though :-)
Elite: C64 (Tape & Disk), Amiga, Atari ST, NES, Amstrad, BBC Micro
Elite II: Amiga, CD32, Atari ST, PC
Elite III: PC (CD & Disc), French CD (Still sealed)
Oolite 1.77, Frontier GL, FFE D3D, Pioneer (August 2014 Build)
Playing Elite since 1985.
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: AI Trading Assistant OXP ver 1.9

Post by Wildeblood »

You folks who've downloaded Trading Assistant version 1.9 in the last few days do all realize it won't work properly in Oolite 1.77? Specifically liquor/wines, gem-stones and alien items aren't noticed because of changes in Oolite.
Styggron wrote:
From your post I guess we won't be getting the 1.76.1 version nor the 1.77 one anytime soon then? :-(
Oh, I don't know. It's a bit messy, but seems to be working properly. I don't think I will be able to get it much better until people start using it and reporting the problems. If anyone would like to test it let me know, and I'll upload it.

Version 2 will work only with Oolite 1.77 or later - it will not work in Oolite 1.76.1.
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:

AI Trading Assistant OXP ver 2.0

Post by Wildeblood »

AI Trading Assistant version 2.0 for Oolite 1.77 is now available. A download link is on the wiki page.
User avatar
psuamier
Above Average
Above Average
Posts: 25
Joined: Sat Jan 12, 2013 1:15 pm
Location: Germany

Re: AI Trading Assistant 2 for Oolite 1.77

Post by psuamier »

Thank you for the new version! I didn't realise that the old version is not that suitable for 1.77.

Seems you're not alone with a simple trading tool available. That one probably cannot be used with your assistant (except if the small extra column is configurable).
CMDR: suamor - Space Trader and Explorer - Founding member of the Elite
Elite Dangerous Beta Tester
User avatar
Massively Locked
Dangerous
Dangerous
Posts: 84
Joined: Tue Nov 20, 2012 12:20 pm

Re: AI Trading Assistant 2 for Oolite 1.77

Post by Massively Locked »

Hi- think I ran into a small bug. If I launch (F1) directly from the Commodities screen, the HUD doesn't switch back to my normal one.
Image
This is Trading Asst 2.0, Oolite 1.77, Win XP.
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: AI Trading Assistant 2 for Oolite 1.77

Post by Wildeblood »

Massively Locked wrote:
Hi- think I ran into a small bug.
Yikes! Hardly a small bug. Two questions:- What HUD were you expecting to see - a switching one, where the docked HUD is different to the in-flight one? Did this happen after you'd been flying about, or only after loading a saved gamed?
User avatar
Massively Locked
Dangerous
Dangerous
Posts: 84
Joined: Tue Nov 20, 2012 12:20 pm

Re: AI Trading Assistant 2 for Oolite 1.77

Post by Massively Locked »

I use Captain Beatnik's HUD (non-switching as far as I know). This was immediately after loading a saved game. Haven't tried it after flying around causing mischief.
Wildeblood wrote:
Yikes! Hardly a small bug.
:) It's small in that I just have to remember to switch to another screen (like my ship's status) before launching.
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: AI Trading Assistant 2 for Oolite 1.77

Post by Wildeblood »

Would you post your Latest.log file, please?

Nuts! Confirmed this bug.
Last edited by Wildeblood on Mon Jan 14, 2013 5:30 am, edited 1 time in total.
User avatar
Massively Locked
Dangerous
Dangerous
Posts: 84
Joined: Tue Nov 20, 2012 12:20 pm

Re: AI Trading Assistant 2 for Oolite 1.77

Post by Massively Locked »

Code: Select all

Opening log for Oolite version 1.77 (x86-32) under Windows 5.1.2600 Service Pack 2 32-bit at 2013-01-13 23:20:20 -0500.
2 processors detected.
Build options: spoken messages, mass/fuel pricing.

Note that the contents of the log file can be adjusted by editing logcontrol.plist.

23:20:20.171 [dataCache.rebuild.explicitFlush]: Cache explicitly flushed with shift key. Rebuilding from scratch.
23:20:20.281 [display.mode.list.native]: Windows native resolution detected: 1280 x 1024
23:20:21.328 [joystick.init]: Number of joysticks detected: 0
23:20:21.328 [rendering.opengl.version]: OpenGL renderer version: 2.0.6120 ("2.0.6120 WinXP Release"). Vendor: "ATI Technologies Inc.". Renderer: "RADEON XPRESS Series x86/SSE2".
23:20:21.328 [rendering.opengl.extensions]: OpenGL extensions (90):
GL_EXT_abgr, GL_ARB_texture_env_crossbar, GL_S3_s3tc, GL_ATIX_texture_env_combine3, GL_ARB_shadow, GL_EXT_texture_edge_clamp, GL_EXT_separate_specular_color, GL_EXT_blend_minmax, GL_EXT_texture_object, GL_ARB_texture_env_add, GL_EXT_texture_cube_map, GL_EXT_texture_env_dot3, GL_ARB_texture_env_dot3, GL_ARB_shadow_ambient, GL_EXT_framebuffer_object, GL_EXT_blend_subtract, GL_SGI_color_matrix, GL_ATI_texture_mirror_once, GL_ARB_multitexture, GL_EXT_stencil_wrap, GL_ARB_texture_border_clamp, GL_NV_occlusion_query, GL_ARB_texture_env_combine, GL_EXT_texgen_reflection, GL_SGIS_texture_edge_clamp, GL_EXT_packed_pixels, GL_EXT_texture_env_add, GL_SGIS_texture_lod, GL_ARB_depth_texture, GL_ARB_transpose_matrix, GL_ARB_occlusion_query, GL_NV_texgen_reflection, GL_ARB_shading_language_100, GL_ARB_fragment_program_shadow, WGL_EXT_extensions_string, GL_EXT_rescale_normal, GL_ATI_fragment_shader, GL_ATI_texture_float, GL_EXT_secondary_color, GL_SUN_multi_draw_arrays, GL_ARB_texture_mirrored_repeat, GL_EXT_draw_range_elements, GL_EXT_texture_lod_bias, GL_EXT_texture_filter_anisotropic, GL_ATIX_vertex_shader_output_point_size, WGL_EXT_swap_control, GL_SGIS_texture_border_clamp, GL_SGIS_generate_mipmap, GL_ARB_texture_rectangle, GL_ARB_point_sprite, GL_EXT_texture_compression_s3tc, GL_ARB_vertex_shader, GL_ARB_vertex_buffer_object, GL_WIN_swap_hint, GL_ARB_shader_objects, GL_ARB_vertex_blend, GL_EXT_texture_mirror_clamp, GL_EXT_vertex_shader, GL_ATI_separate_stencil, GL_SGIS_multitexture, GL_EXT_texture_rectangle, GL_ARB_fragment_shader, GL_EXT_texture3D, GL_EXT_fog_coord, GL_ARB_window_pos, GL_HP_occlusion_test, GL_EXT_point_parameters, GL_ARB_fragment_program, GL_EXT_texture_env_combine, GL_ARB_vertex_program, GL_EXT_bgra, GL_ARB_texture_cube_map, GL_ARB_point_parameters, GL_EXT_compiled_vertex_array, GL_EXT_vertex_array, GL_ATIX_texture_env_route, GL_ARB_multisample, GL_ARB_draw_buffers, GL_EXT_multi_draw_arrays, GL_ATI_draw_buffers, GL_ARB_texture_compression, GL_EXT_blend_func_separate, GL_ATI_texture_env_combine3, GL_ARB_texture_float, GL_EXT_shadow_funcs, GL_EXT_clip_volume_hint, GL_EXT_blend_color, GL_NV_blend_square, GL_ATI_vertex_streams, GL_ATI_envmap_bumpmap
23:20:21.359 [rendering.opengl.shader.support]: Shaders are supported.
23:20:21.421 [dataCache.rebuild.explicitFlush]: Cache explicitly flushed with shift key. Rebuilding from scratch.
23:20:21.437 [searchPaths.dumpAll]: Unrestricted mode - resource paths:
    Resources
    ../AddOns
    ../AddOns/Accessories-2.1.oxp
    ../AddOns/BattleDam(univrs)-1.oxp
    ../AddOns/BGS-A1.6.oxp
    ../AddOns/BrkEnergyUnit-1.1.oxp
    ../AddOns/BrkEngines-1.1.oxp
    ../AddOns/BrkHUD-1.2.oxp
    ../AddOns/BrkLifeSupSys-1.1.oxp
    ../AddOns/BrkShieldGen-1.2.oxp
    ../AddOns/BrkTorusDrv-1.1.oxp
    ../AddOns/BrkWitchDrv-1.3.oxp
    ../AddOns/CabalComLib-1.7.oxp
    ../AddOns/CB_HUD_MrkII-1.1.oxp
    ../AddOns/DelightfulDocking.oxp
    ../AddOns/DistSunsGlxy1-0.7.oxp
    ../AddOns/EscapePods-1.01.oxp
    ../AddOns/FuelStation-1.34.oxp
    ../AddOns/GrfNoShdrShps-0.95.oxp
    ../AddOns/GrittyCoriolis.oxp
    ../AddOns/IceAsteroids-2.1.oxp
    ../AddOns/Kestrel&Falcon-1.71.oxp
    ../AddOns/NavBuoy-1.0.1.oxp
    ../AddOns/OXPConfig-2.2.4.oxp
    ../AddOns/PoliceScnrUpg-1.3.1.oxp
    ../AddOns/RandShpNames-1.2.oxp
    ../AddOns/RealisticDamage-1.oxp
    ../AddOns/Terrapin.oxp
    ../AddOns/TradingAsst-2.oxp
    ../AddOns/TrafficControl-1.11.oxp
    ../AddOns/WelcomeMat-1.12.oxp
    ../AddOns/YellOoCabs-2.oxp
23:20:21.515 [shipData.load.begin]: Loading ship data.
23:20:23.781 [script.load.world.listAll]: Loaded 38 world scripts:
    AI Buying Advisor 2.0
    AI Selling Advisor 2.0
    AI Trading Assistant 2.0
    Battle Damage 1.0
    BGS-M 1.6
    Breakable_Energy_Unit 1.1
    Breakable_Engines 1.1
    Breakable_HUD_IFF_Scanner 1.2
    Breakable_Life_Support_System 1.1
    Breakable_Shield_Generators 1.2
    Breakable_TorusDrive 1.1
    Breakable_WitchDrive 1.3
    Cabal_Common_Briefing 1.7
    Cabal_Common_Comms 1.7
    Cabal_Common_Functions 1.7
    Cabal_Common_Keyboard 1.7
    Cabal_Common_MissionHandling 1.7
    Cabal_Common_Music 1.7
    Cabal_Common_Overlay 1.7
    Cabal_Common_OXPStrength 1.7
    Cabal_Common_SpecialMarkets 1.7
    FuelStation-Setup 1.33
    oolite-cloaking-device 1.77
    oolite-constrictor-hunt 1.77
    oolite-contracts-cargo 1.77
    oolite-contracts-helpers 1.77
    oolite-contracts-parcels 1.77
    oolite-contracts-passengers 1.77
    oolite-nova 1.77
    oolite-thargoid-plans 1.77
    oolite-trumbles 1.77
    OXPConfig 2.2.4
    Police_Scanner_Upgrade 1.3.1
    randomshipnames 1.2
    realisticDamage.js 1.00
    Stars 0 0.7
    TrafficControl 1.1
    Welcome Information Script 1.12
23:20:27.828 [startup.complete]: ========== Loading complete in 7.62 seconds. ==========
23:20:34.593 [script.load.world.listAll]: Loaded 38 world scripts:
    AI Buying Advisor 2.0
    AI Selling Advisor 2.0
    AI Trading Assistant 2.0
    Battle Damage 1.0
    BGS-M 1.6
    Breakable_Energy_Unit 1.1
    Breakable_Engines 1.1
    Breakable_HUD_IFF_Scanner 1.2
    Breakable_Life_Support_System 1.1
    Breakable_Shield_Generators 1.2
    Breakable_TorusDrive 1.1
    Breakable_WitchDrive 1.3
    Cabal_Common_Briefing 1.7
    Cabal_Common_Comms 1.7
    Cabal_Common_Functions 1.7
    Cabal_Common_Keyboard 1.7
    Cabal_Common_MissionHandling 1.7
    Cabal_Common_Music 1.7
    Cabal_Common_Overlay 1.7
    Cabal_Common_OXPStrength 1.7
    Cabal_Common_SpecialMarkets 1.7
    FuelStation-Setup 1.33
    oolite-cloaking-device 1.77
    oolite-constrictor-hunt 1.77
    oolite-contracts-cargo 1.77
    oolite-contracts-helpers 1.77
    oolite-contracts-parcels 1.77
    oolite-contracts-passengers 1.77
    oolite-nova 1.77
    oolite-thargoid-plans 1.77
    oolite-trumbles 1.77
    OXPConfig 2.2.4
    Police_Scanner_Upgrade 1.3.1
    randomshipnames 1.2
    realisticDamage.js 1.00
    Stars 0 0.7
    TrafficControl 1.1
    Welcome Information Script 1.12
23:21:27.781 [exit.context]: Exiting: Q pressed [Windows].
23:21:27.781 [gameController.exitApp]: .GNUstepDefaults synchronized.

Closing log at 2013-01-13 23:21:27 -0500.
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: AI Trading Assistant 2 for Oolite 1.77

Post by Wildeblood »

My fault, but I've no idea what I've done wrong. Could cleverer people comment on this please?

Code: Select all

/* ====================================================================================
			HUD CHANGE ON MARKET SCREEN
======================================================================================= */

this.guiScreenChanged = function(to, from)
	{
	if (guiScreen === "GUI_SCREEN_MARKET" && player.ship.docked && player.ship.equipmentStatus("EQ_AI_TRADING_ASSISTANT") === "EQUIPMENT_OK")
		{
		this.$originalHUD = player.ship.hud;
		if (player.ship.dockedStation.isMainStation) this.$tradingHUD = "trading-assistant-galcop-hud.plist";
		else this.$tradingHUD = "trading-assistant-hud.plist";
		this.$resetHUD();
		this.$costDisplayTimer = new Timer(this, $refreshCostDisplay, 0, 9);
		return;
		}
	if (from === "GUI_SCREEN_MARKET" && this.$originalHUD)
		{
		if (this.$costDisplayTimer)
			{
			this.$costDisplayTimer.stop();
			delete this.$costDisplayTimer;
			}
		player.ship.hud = this.$originalHUD;
		delete this.$originalHUD; 
		delete this.$tradingHUD; 
		return;
		}
	}

this.$resetHUD = function()
	{
	player.ship.hud = this.$tradingHUD;
	player.commsMessage("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",1);
	}
this.guiScreenChanged("GUI_SCREEN_MAIN", "GUI_SCREEN_MARKET") isn't happening when launching, or this.$originalHUD is being lost somehow, or doesn't work as I expect.

In my game I get the HUD switched by another script, but the $costDisplayTimer keeps running.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: AI Trading Assistant 2 for Oolite 1.77

Post by cim »

With the contracts code, I also reset the HUD on shipWillLaunchFromStation. I'll have a look at why the guiScreenChanged handler isn't firing, though.
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: AI Trading Assistant 2 for Oolite 1.77

Post by Wildeblood »

cim wrote:
I'll have a look at why the guiScreenChanged handler isn't firing, though.
This doesn't seem to work substituting viewDirectionChanged, either. I suspect the problem is my use of the existence of this.$originalHUD as a boolean?
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: AI Trading Assistant 2 for Oolite 1.77

Post by cim »

Wildeblood wrote:
I suspect the problem is my use of the existence of this.$originalHUD as a boolean?
That should be working - it should either be undefined (which will be counted as false) or a string (which will be counted as true), looking at that bit of script.

I suppose you could instead test to see if player.ship.hud was one of the two HUDs you were using.
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: AI Trading Assistant 2 for Oolite 1.77

Post by Wildeblood »

cim wrote:
Wildeblood wrote:
I suspect the problem is my use of the existence of this.$originalHUD as a boolean?
That should be working - it should either be undefined (which will be counted as false) or a string (which will be counted as true), looking at that bit of script.
Yes, that has always been my understanding, and it works when docked. I thought perhaps the variable type might have changed so that it wasn't always a string.
cim wrote:
I suppose you could instead test to see if player.ship.hud was one of the two HUDs you were using.
There are 37 HUD files in there. :mrgreen:

I've also added in an extra boolean this.$changedHUD = true and tested for that in guiScreenChanged, with the same buggy result.
Post Reply