Jump to content

Bag sort mod (to organize items in a bag of holding by category + alphabetize)? With a non-mod implementation I did in link


Recommended Posts

In playing, I tend to have many containers (the bottomless ones, or 999 slots) filled up with hundreds of items.

This obviously becomes a problem when trying to find a specific item; I couldn't find anything when searching for a mod that would organize the contents as described in the title, and when suggesting to the NearInfinity github that it may be a neat feature in that program, was dissuaded from extending it, so I put together this solution for my own usage:

https://github.com/ahungry/bgee-bag-sort/

At the moment it's written in nodejs, so a bit outside the standard BG modding eco-system (but should be cross-OS, although only tested on GNU/Linux, and pretty easy for most to set up node that would like to use it - no npm dependencies are required).  I chose this, as I'm pretty familiar with nodejs and the different file formats were available online (references in the source code), and I couldn't find a weidu scripting or AI scripting way to do this (although there probably is one,  but just shuffling bytes in a language I'm more familiar with seemed a bit easier than learning all of weidu scripting, having 0 exposure to it).

Would it be worth posting as a perma-link somewhere on this site? (Miscellaneous mods?)

It runs fairly quickly (less than 10 seconds to sort a ~500 item BoH, including uncompressing, sorting, recompressing a sav game file).

As noted in the linked README, back up your .sav game/folder if you plan to try it, however I haven't had any corrupt file issues (but this is only usable on a BGEE/EET install, or whatever else uses the same file formats - I didn't include the file formats/compatability for older versions of IE files).

 

 

 

Link to comment
On 1/4/2022 at 2:23 AM, ahungry said:

Would it be worth posting as a perma-link somewhere on this site? (Miscellaneous mods?)

Perma-link definitely. It's something between a mod and a tool though, I think. I can move the thread if you want.

It sounds nifty, I usually do not have that much items in the bags though. But I'm not really playing whole EET runs, so that might change if I do.

 

Link to comment

It may be possible to do it by modding the UI. It depends on which criteria you want to sort on as the UI doesn't have a direct access to the files, only to what the engine expose.

And it should be easier to do that for the bag, the inventory has more hardcoded stuff.

Edited by lefreut
Link to comment

Sorting the display of container contents is a rather easy, one line function.  However, keeping it sorted is another matter, as clicking on just about anything in that screen will reset the store table, so you might have to hijack the entire store screen, at least while IsContainer().

 

Link to comment

My main concern was keeping stores and containers sorted for personal use.  And adding some sort of UI text box to search for items that matched at least part of a text string.  "Bow" would match "crossbow" and "shortbow" and "longbow" and "bowl," for example.

Still, thankee for your help and input!

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...