Updates ======= v7.5.12, 5 May 2025: - Tweak: Reworked the data structure again to minimise it further. Data on station-station trades have been removed. Only station-ship trades are retained, recoded, and used in the analytics. Previously, trade data is stored at both the ship that performed the trade and at its parent station. - Bug-fix: Some analytics were still not being shown. Bug caused by the previously doubling of the data at both the ship and at the station levels. Bug found when the data structure was reworked.
Compatibility with mods that use G-Workaround/Right-click API: I have found that mods that use G-workaround/Righ-click API (GW/RCAPI) are not compatible with UI Extensions (UIX). When I first built UIX, SirNukes had just released his Mod Support APIs with its own Interact Menu (i.e. the right-click menu) API. (And GW/RCAPI didn't seem to have been maintained.) So, I built UIX off SirNukes stuff rather than GW/RCAPI. But the development of GW/RCAPI has since been taken up by a new modder. I just gotta find a way (some time, really ) to make UIX compatible with mods that use GW/RCAPI.
A clarification: GW/RCAPI is incompatible only with UIX when a mod loads UIX's changes to the Interact Menu. Mods that don't load UIX's changes to the Interact Menu should* be compatible with GW/RCAPI. The only two mods that load UIX's changes the Interact Menu are: Trade Analytics mod and Waypoint Field for Deployments mod. All my other mods "should" be compatible with GW/RCAPI.
Updates ======= v7.5.11, 26 Apr 2025: - Tweak: Reworked the data storage of the mod. In my game from 2021 in which I have 45 stations, the stored data of 1059 trade records was trimmed down to 899 trade records. 53 trade records were removed because one of the trading partners has been removed from the game. 107 records were consolidated into one. Previously, trades were stored at both trading partners data storage.
Updates ======= v7.5.101, 18 Apr 2025: - Bug-fix: Forces removal of data of destroyed traders and stations. Their data (although intact even if the trader or station has been destroyed) was preventing the analytics to display simply because the trader has been destroyed.
Updates ======= v7.5.10, 12 Apr 2025: - New feature: Repairs of ships at the player's wharves and shipyards are now included in the analytics. The analytics do not list what wares they used for repairs (because I don't know how to find that yet). Instead it just shows the ship and its faction that was repaired.
Updates ======= v7.5.09, 08 Apr 2025: - Bug-fix: Some analytics data were not getting shown. - Note: Analytics on sold ships from shipyards and wharves are not yet listed. Only production wares are.
Updates ======= v7.5.07, 29 Mar 2025: - Bug-fix: Delay the render of the analytics panel until the data is ready. This was the cause of the menu eventually breaking. - Tweak: Russian localisation. Thanks, Alexander! - Bug-fix: The mod-specific debug logging was likely left on after the last update. This will disable it, if it wasn't already disabled manually in the mod's Extension Options.
I can confirm that switching to an ultrawide resolution breaks the transaction log rendering.
For the dev's attempts at troubleshooting, my debug output when failing to create a transaction log at ultrawide resolutions:
[General] 123.18 ====================================== [=ERROR=] 123.18 F:/SteamLibrary/steamapps/common/X4 Foundations/(): (from presentation 'ui/widget/presentations/widget_fullscreen/widget_fullscreen.bgf') GetOptionalIntegerArgument(): invalid parameters. Given integer value is negative, but requested value is unsigned. Returning defaultvalue. [General] 123.18 ====================================== [General] 123.18 ====================================== [=ERROR=] 123.18 stack traceback: [C]: in function 'TraceBack' P:\SVN\temp\helper.lua:4802: in function 'createDescriptor' P:\SVN\temp\helper.lua:3744: in function 'display' [string "ui/addons/ego_detailmonitor/menu_transactionl..."]:133: in function 'createFrame' [string "ui/addons/ego_detailmonitor/menu_transactionl..."]:86: in function 'onShowMenu' P:\SVN\temp\helper.lua:1284: in function <P:\SVN\temp\helper.lua:1187> [C]: in function 'pcall' P:\SVN\temp\widget_fullscreen.lua:17955: in function 'CallEventScripts' P:\SVN\temp\widget_fullscreen.lua:2365: in function <P:\SVN\temp\widget_fullscreen.lua:2348> [General] 123.18 ====================================== [General] 123.18 ====================================== [=ERROR=] 123.18 Frame content of type 'table' was not created successfully! Aborting display of frame! [General] 123.18 ====================================== [Scripts] 123.18 *** Context:md.kuertee_trade_analytics.OnTransactionLogOpen<inst:209f2b1>: event_ui_triggered event.param: TransactionLogMenu event.param2:
I'm still having trouble the the Transaction Log not opening. Previously if I reloaded a save or did /reloadui, I could get it to start working again, but now it never works. I'm on v7.1.16 and X4 7.10.
Updates ======= v7.5.05, 18 Mar 2025: - Tweak: Update trade.find.commander script to allow traders to sell produced wares when ware shortages can't be fulfilled.
Updates v7.5.04, 14 Mar 2025: - Bug-fix: "By Trading Ship" filter wasn't working. - Bug-fix: Better clean-up of invalid data at every game load. - Bug-fix: Language files had incorrectly numbered text entries. - Bug-fix: French language files had missing text entries.
I'm trying to use this mod to compare the mining efficiency for ships assigned to one of my stations in terms of units delivered per hour, but I'm not having much success.
The reason why is that if I use "group by hour", the transactions with the station are not split out into hourly chunks, which is what I expected:
The ship definitely has been mining for more than one hour.
Also, if I set the filter to "mining", there is nothing for that ship:
I would expect some data since the ship is definitely mining.
Perhaps I'm misunderstanding how this is meant to work?
Unfortunately, data over time per ship per trading partner isn’t that accurate. Total data at any time is.The problem is that the base game only tracks player trades with other factions - not player trades with their own player faction.
The mod keeps this data in the save file. And to minimise that data (which is large even with this minimisation), the mod keeps only the total of trades of one ship per trading partner. E.g. there is no historical data of trades of player-ship-a with player-station-b, but there is total data of those trades.
I.e. data of trades of player-ship-a with player-station-b consists of: (1) total ware count traded, (2) total of transaction, (3) number of trades, and (4) last transaction time.E.g. the trade of player-ship-a with player-station-b 3 hours ago will be overwritten, but with the updated totals, by their trade of 2 minutes ago.
As for the mining data not showing up … that could be a bug. I’ll have a look. Can you check the analytics of the mining ship?
Right, okay, I guess that's not something I can do this way then. That's fine.
The analytics I showed above were for a mining ship. If I look at the analytics for the station the ship is a subordinate to, then I do see mining analytics for all its subordinates. It just doesn't show up for the individual ships, which might be working as intended.
Mind you, the units shown in the station analytics for the "ware" column look like they're invalid, because they're the same number for all ships and also they're negative.
169 comments
=======
v7.5.12, 5 May 2025:
- Tweak: Reworked the data structure again to minimise it further. Data on station-station trades have been removed. Only station-ship trades are retained, recoded, and used in the analytics. Previously, trade data is stored at both the ship that performed the trade and at its parent station.
- Bug-fix: Some analytics were still not being shown. Bug caused by the previously doubling of the data at both the ship and at the station levels. Bug found when the data structure was reworked.
I have found that mods that use G-workaround/Righ-click API (GW/RCAPI) are not compatible with UI Extensions (UIX).
When I first built UIX, SirNukes had just released his Mod Support APIs with its own Interact Menu (i.e. the right-click menu) API.
(And GW/RCAPI didn't seem to have been maintained.)
So, I built UIX off SirNukes stuff rather than GW/RCAPI.
But the development of GW/RCAPI has since been taken up by a new modder.
I just gotta find a way (some time, really ) to make UIX compatible with mods that use GW/RCAPI.
A clarification: GW/RCAPI is incompatible only with UIX when a mod loads UIX's changes to the Interact Menu.
Mods that don't load UIX's changes to the Interact Menu should* be compatible with GW/RCAPI.
The only two mods that load UIX's changes the Interact Menu are: Trade Analytics mod and Waypoint Field for Deployments mod.
All my other mods "should" be compatible with GW/RCAPI.
=======
v7.5.11, 26 Apr 2025:
- Tweak: Reworked the data storage of the mod. In my game from 2021 in which I have 45 stations, the stored data of 1059 trade records was trimmed down to 899 trade records. 53 trade records were removed because one of the trading partners has been removed from the game. 107 records were consolidated into one. Previously, trades were stored at both trading partners data storage.
=======
v7.5.101, 18 Apr 2025:
- Bug-fix: Forces removal of data of destroyed traders and stations. Their data (although intact even if the trader or station has been destroyed) was preventing the analytics to display simply because the trader has been destroyed.
=======
v7.5.10, 12 Apr 2025:
- New feature: Repairs of ships at the player's wharves and shipyards are now included in the analytics. The analytics do not list what wares they used for repairs (because I don't know how to find that yet). Instead it just shows the ship and its faction that was repaired.
=======
v7.5.09, 08 Apr 2025:
- Bug-fix: Some analytics data were not getting shown.
- Note: Analytics on sold ships from shipyards and wharves are not yet listed. Only production wares are.
=======
v7.5.07, 29 Mar 2025:
- Bug-fix: Delay the render of the analytics panel until the data is ready. This was the cause of the menu eventually breaking.
- Tweak: Russian localisation. Thanks, Alexander!
- Bug-fix: The mod-specific debug logging was likely left on after the last update. This will disable it, if it wasn't already disabled manually in the mod's Extension Options.
For the dev's attempts at troubleshooting, my debug output when failing to create a transaction log at ultrawide resolutions:
[General] 123.18 ======================================
[=ERROR=] 123.18 F:/SteamLibrary/steamapps/common/X4 Foundations/(): (from presentation 'ui/widget/presentations/widget_fullscreen/widget_fullscreen.bgf') GetOptionalIntegerArgument(): invalid parameters. Given integer value is negative, but requested value is unsigned. Returning defaultvalue.
[General] 123.18 ======================================
[General] 123.18 ======================================
[=ERROR=] 123.18 stack traceback:
[C]: in function 'TraceBack'
P:\SVN\temp\helper.lua:4802: in function 'createDescriptor'
P:\SVN\temp\helper.lua:3744: in function 'display'
[string "ui/addons/ego_detailmonitor/menu_transactionl..."]:133: in function 'createFrame'
[string "ui/addons/ego_detailmonitor/menu_transactionl..."]:86: in function 'onShowMenu'
P:\SVN\temp\helper.lua:1284: in function <P:\SVN\temp\helper.lua:1187>
[C]: in function 'pcall'
P:\SVN\temp\widget_fullscreen.lua:17955: in function 'CallEventScripts'
P:\SVN\temp\widget_fullscreen.lua:2365: in function <P:\SVN\temp\widget_fullscreen.lua:2348>
[General] 123.18 ======================================
[General] 123.18 ======================================
[=ERROR=] 123.18 Frame content of type 'table' was not created successfully! Aborting display of frame!
[General] 123.18 ======================================
[Scripts] 123.18 *** Context:md.kuertee_trade_analytics.OnTransactionLogOpen<inst:209f2b1>: event_ui_triggered event.param: TransactionLogMenu event.param2:
Can you try the 7.5.03 version, please?
I'm uploading it currently.'
Should be available within half an hour.
will look at it as soon as i can. been a bit busy with all these beta updates.
=======
v7.5.05, 18 Mar 2025:
- Tweak: Update trade.find.commander script to allow traders to sell produced wares when ware shortages can't be fulfilled.
v7.5.04, 14 Mar 2025:
- Bug-fix: "By Trading Ship" filter wasn't working.
- Bug-fix: Better clean-up of invalid data at every game load.
- Bug-fix: Language files had incorrectly numbered text entries.
- Bug-fix: French language files had missing text entries.
The reason why is that if I use "group by hour", the transactions with the station are not split out into hourly chunks, which is what I expected:
The ship definitely has been mining for more than one hour.
Also, if I set the filter to "mining", there is nothing for that ship:
I would expect some data since the ship is definitely mining.
Perhaps I'm misunderstanding how this is meant to work?
The mod keeps this data in the save file. And to minimise that data (which is large even with this minimisation), the mod keeps only the total of trades of one ship per trading partner. E.g. there is no historical data of trades of player-ship-a with player-station-b, but there is total data of those trades.
I.e. data of trades of player-ship-a with player-station-b consists of: (1) total ware count traded, (2) total of transaction, (3) number of trades, and (4) last transaction time.E.g. the trade of player-ship-a with player-station-b 3 hours ago will be overwritten, but with the updated totals, by their trade of 2 minutes ago.
As for the mining data not showing up … that could be a bug. I’ll have a look. Can you check the analytics of the mining ship?
The analytics I showed above were for a mining ship. If I look at the analytics for the station the ship is a subordinate to, then I do see mining analytics for all its subordinates. It just doesn't show up for the individual ships, which might be working as intended.
Mind you, the units shown in the station analytics for the "ware" column look like they're invalid, because they're the same number for all ships and also they're negative.