[MOD] Trade Menu Cargo Hold Filter (v1.05 compatible with patch 3.5x, 3.6x and 4.x)

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

blackmilan
Posts: 124
Joined: Sat, 22. Jan 11, 21:13
xr

[MOD] Trade Menu Cargo Hold Filter (v1.05 compatible with patch 3.5x, 3.6x and 4.x)

Post by blackmilan » Sun, 9. Nov 14, 13:46

This is a little UI mod. It adds a new filter to the trade menu which filters the trade list by the cargo type of the selected ship. If you click the button a second time it will only show wares in the trade list which are on board of the selected ship (or on its shopping list). Clicking it again will switch back to the cargo type filter.

If you have any questions or feedback please let me know.
  1. The new filter is set as default when you open the trade menu. You do not have to select the appropriate filter for each of your ships manually any more.
  2. If you have a ship like the Rahanas which can transport multiple cargo types (e.g. energy and container) you can see all corresponding wares in one list.
  3. Filtering by the cargo on board of the selected ship allows you to easily find the trade requests you can serve with your current cargo or to find further offers if you are collecting a certain ware.
  4. The ship details are now displaying the full system/sector/zone name instead of the abbreviation and I have made the cargo list a bit more readable. (Only in version v1.01, might be added again later)
Steam Workshop Alternative Download and Installation
  1. Follow the link below and select the file
  2. Click on the download button at the top of the window
  3. Unpack the ZIP archive and copy the folder "TradeMenuCargoHoldFilter" to the X-Rebirth "extensions" directory
Trade Menu Cargo Hold Filter (v1.05)

Trade Menu Cargo Hold Filter (v1.04)

Trade Menu Cargo Hold Filter (v1.01)


Version History

17-Jul-2022 Fixed broken download links and removed broken preview image

19-Dec-2015 v1.05 (compatible with patch 4.30 and newer) (published on Steam Workshop 29-Feb-2016)
  • Update to be compatible with the UI changes in patch 4.00 beta 4.
18-Apr-2015 v1.04 (compatible with patch 3.5x until patch 3.6x)
  • Added a new filter option to only show wares in the trade list which are on board of the selected ship (or on its shopping list).
10-Mar-2015 v1.03 (compatible with patch 3.5x until patch 3.6x)
  • Update to be compatible with the UI modding features changed in patch 3.5 RC 1.
08-Mar-2015 v1.02 (compatible with patch 3.50 beta 3)
  • Updated the mod to be compatible with the new UI modding features in patch 3.5 beta 3. This version will not work with any patch prior to 3.5 beta 3.
11-Nov-2014 v1.01 (compatible with patch 2.51)
  • Fixed a freeze which occured if there was no ship in the squad. In this case all available trades will be displayed now.
09-Nov-2014 v1.00 (compatible with patch 2.51)
  • Initial Release
Last edited by blackmilan on Sun, 17. Jul 22, 18:17, edited 28 times in total.

Vim Razz
Posts: 1842
Joined: Tue, 2. Nov 10, 02:20
x4

Post by Vim Razz » Mon, 10. Nov 14, 04:37

I've been using this all evening and it's a great addition.

It works fine with 3.00 b2, though it does overwrite the changes in the new menu. I haven't fully explored what the new 3.00 b2 colors and stuff actually indicate yet, but, you know... there's some new stuff in there that exists to look at at some point.

The only problem I could find so far is that it currently causes the game to freeze if the trade menu is opened when there are no ships in your squad.

From the error log:

[General] ======================================
[=ERROR=] Error while executing onEvent script for event: showTradingOffersMenu.
Errormessage: [string "ui/addons/detailmonitor/menu_trading_offers.lua"]:423: attempt to index a nil value
[General] ======================================


If you can get that straightened out, then that'd be awesome.

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Mon, 10. Nov 14, 08:13

Look's great, thanks!

Beta-testing the new beta so will wait a bit to try. Colour - wise in 3.00b2, there's a colour for wares that are illegal. I don't think it is responsive to license or system context but I've not full tested that.

swatti
Posts: 1278
Joined: Sun, 7. Dec 03, 12:03
x4

Post by swatti » Mon, 10. Nov 14, 11:37

Can you make a mod that filters OUT ships that can only carry "fuel" AKA: combat-ships? And fighters / ships with no cargo-hold.

blackmilan
Posts: 124
Joined: Sat, 22. Jan 11, 21:13
xr

Post by blackmilan » Mon, 10. Nov 14, 18:49

Vim Razz wrote:The only problem I could find so far is that it currently causes the game to freeze if the trade menu is opened when there are no ships in your squad.
Who is doing trade without ships? :D Actually I never thought of this scenario :oops: Thanks a lot for pointing that out. I will check that and provide an updated version.
Sparky Sparkycorp wrote:Look's great, thanks!
Thanks. I am hearing a lot of nice stuff about v3.0. I guess I will have to give it a try myself at some point in time and check out the new ui code.
swatti wrote:Can you make a mod that filters OUT ships that can only carry "fuel" AKA: combat-ships? And fighters / ships with no cargo-hold.
This is a nice idea. Though I am not sure, if it can be done with the current functionality in the trade menu.

blackmilan
Posts: 124
Joined: Sat, 22. Jan 11, 21:13
xr

Post by blackmilan » Tue, 11. Nov 14, 18:52

I have fixed the freeze which occured if there was no ship in the squad and uploaded the new version v1.01.

Trade Menu Cargo Hold Filter (v1.01)

Have fun!

PS: Updated the original post with the new version and a version history.
Last edited by blackmilan on Sun, 17. Jul 22, 18:19, edited 1 time in total.

User avatar
Earth Ultimatum IV.
Posts: 5280
Joined: Mon, 3. May 10, 14:39
x4

Post by Earth Ultimatum IV. » Tue, 11. Nov 14, 19:01

Could be added to original game. Wouldn't be a bad addition :)

blackmilan
Posts: 124
Joined: Sat, 22. Jan 11, 21:13
xr

Post by blackmilan » Wed, 12. Nov 14, 19:25

Thanks!

Feel free to suggest it to Bernd for the next update :)

Vim Razz
Posts: 1842
Joined: Tue, 2. Nov 10, 02:20
x4

Post by Vim Razz » Wed, 12. Nov 14, 19:33

blackmilan wrote:Who is doing trade without ships? :D
I break what I can. :wink:

The new version is working nicely so far.

HailedGorion
Posts: 38
Joined: Sun, 2. Jan 11, 18:35
x3tc

Post by HailedGorion » Thu, 13. Nov 14, 18:01

Would it be able to add filters for wares being offered/bought in a sector/system/galaxy?

I know we can check the distance to that trade to occur, but if I could see the offers coming from a sector/system/galaxy only, it would be much easier to visualize and make my plannings regarding building up the economy.

blackmilan
Posts: 124
Joined: Sat, 22. Jan 11, 21:13
xr

Post by blackmilan » Thu, 13. Nov 14, 19:31

Resolving the location of a trade is rather simple, in fact the code is already there to show the system, sector and zone at the bottom of the trade menu.

Code: Select all

local cluster, sector, zone = GetComponentData(trade.station, "cluster", "sector", "zone")
The thing that is more difficult (at least for me) is how one would tell the menu which system/sector/zone is of interest? There would either have to be some kind of list to select from or a textbox to enter the desired value (like the textbox on top).

Sparky Sparkycorp
Moderator (English)
Moderator (English)
Posts: 8074
Joined: Tue, 30. Mar 04, 12:28
x4

Post by Sparky Sparkycorp » Thu, 13. Nov 14, 19:40

Maybe colour-coding would be OK? Seems fine for NPC lists in the sidebar.

blackmilan
Posts: 124
Joined: Sat, 22. Jan 11, 21:13
xr

Post by blackmilan » Sat, 15. Nov 14, 12:15

I like the idea to filter by system/sector/zone and I think I have an idea how to make it work. I will try to add a new row below the current filters and put a text field there where the name can be entered (like the search box at the top) and put buttons next to it to tell it what to filter for (system/sector/zone or galaxy in case one wants to see everything).

HailedGorion
Posts: 38
Joined: Sun, 2. Jan 11, 18:35
x3tc

Post by HailedGorion » Sat, 15. Nov 14, 20:21

That would be great. It would make my life so much easier when looking for the wares needed to supply a specific station.

blackmilan
Posts: 124
Joined: Sat, 22. Jan 11, 21:13
xr

Post by blackmilan » Thu, 20. Nov 14, 18:30

HailedGorion wrote:Would it be able to add filters for wares being offered/bought in a sector/system/galaxy?
I had a look into the trade menu code to see how we could make it work and there is actually good news.

No need to mod anything, it is already built-in. :lol:

Did you ever use the textbox at the top of the menu? I thought it could only search for wares.

Guess what, beside wares it allows searching for zones, sectors, systems and even station and faction names can be used. :D
Last edited by blackmilan on Sun, 17. Jul 22, 18:20, edited 1 time in total.

HailedGorion
Posts: 38
Joined: Sun, 2. Jan 11, 18:35
x3tc

Post by HailedGorion » Thu, 20. Nov 14, 20:17

=O

And we did not know that!!!! =O =O =O

100hours + of gameplay and just now I get to know that!!!! lol

That shows that even after a long time of gameplay there is still things to be discovered xD

Thx for the info blackmilan

blackmilan
Posts: 124
Joined: Sat, 22. Jan 11, 21:13
xr

Post by blackmilan » Fri, 21. Nov 14, 18:01

I guess that belongs to the THINK part of the game :D

You know, sometimes I really miss the good old times, when computer games came with handbooks of 100+ pages where such things were explained ...

Just wondering how many more players out there have no idea ...

denison10
Posts: 27
Joined: Sun, 12. Oct 14, 01:57

Post by denison10 » Fri, 26. Dec 14, 11:56

I repaired it but do not know how to upload to the forum.

oliverjanda
Posts: 309
Joined: Sun, 14. Feb 10, 17:47
xr

Post by oliverjanda » Mon, 2. Mar 15, 12:56

Nice mod. Should be integrated into the game!
I hope you can make it compatible to 3.5 (if it isn't already).

btw: WTF there's really a textbox in the trademenu??? :lol:

blackmilan
Posts: 124
Joined: Sat, 22. Jan 11, 21:13
xr

Post by blackmilan » Sun, 8. Mar 15, 20:44

This mod is not quite dead yet thanks to the new UI modding features added with patch 3.5 beta 3. It has been completely rewritten and the download link for version v1.02 can be found in the first post.

Please note that the new version requires at least patch 3.5 beta 3. For everyone still using patch 2.51 version v1.01 is still available.

Download

Post Reply

Return to “X Rebirth - Scripts and Modding”