Hybrid Inventory [2018-12-13]


#1

Hybrid inventory is spiritual successor of my previous modification of inventory system - CataTweaks I made 3 and half years ago.

It consist of 2 main parts.

  1. It does allow to move items in and from a container, not just liquids as in vanilla.
  2. Some wearable items, that add inventory space were converted and serve as containers. Mainly backpacks.

These two parts together allows one of the most requested feature, ability to drop backpack (and all items in it) before a fight and picking it after a fight, without hassle of dealing with dropped crap all over the place, to become reality.

There are other possibilities, of course, like

  • better organize your loot into different containers
  • not only you can drop a backpack on your back before a fight, you can also drop that duffel full of stuff you were wielding and grab a katana instead… or rather wield that katana and drop the duffel in the process

Details how it works can be found in CataTweaks thread, as well as opinions of people who tried it at the time. There are some differences though.

  • no extra layer for backpacks
  • no balancing of various items
  • no labeling (i made a separate PR in the past, that was mainlined)
  • no new items
  • changed wearables do not split their volume between container space and general inventory space, I went full container space - it is easy to tweak split in the mod json files, and you are encouraged to do so if you play with character that relies on backpacks for general inventrory space, like bikini clad warrior with just backpack would be
  • changes to items are stored in separate mod HybridInventory - to keep them separated from original game files
  • to play with Hybrid Inventrory, you have to create world with Hybrid Inventory rebalance mod enabled, most of changes in game code check if the mod is enabled and either run original code or new code

Source code
is based on experimantal master from 13.12.2018 and can be found on my github fork, branch hcs.

Compiled game
for Windows x64 can be downloaded from my public Google drive folder, zip here.

Quick user manual for Advanced Inventory

  • to access worn backpack for pane, press “B”
  • to access held container, press “H”
  • to access different worn container, like briefcase, press “W” for worn items, select row with container, and press “C” (you can also access you backpack this way, but why would you)
  • you can access any container from any pane by selecting its row and press “C”
  • you can return to parent of container you are accessing by pressing “BACKSPACE”

Changes

  • picked up items are now automatically placed into worn backpack / held container, if you don’t have enough space in inventory, order is inventory->backpack->held container
  • backpacks no longer gets more encumbrance from content as their base encumbrance already accounts for it

Extra features in compiled game
These are not official part of Hybrid Inventory. Features I either PRed or plan to PR in the future, that I compiled together with HI.

  • zone for comestibles with FREEZERBURN flag (food that become mushy after thawing)

Regarding Backpacks/ Bags
#2

This sounds amazing, does anyone know if this will be a selectable mod? I am so not a coder, but I would gladly accept the “extra” complexity to make my bug-out bag have just the stuff that I need.


#3

You should make a PR if you ever want to see this in-game, it’s pretty easy!


#4

Maybe not mainline it yet, just mainline it as a mod so anyone can use it but they don’t have to.


#5

Mods currently can only adjust JSON and make code changes through LUA; this change introduces a lot of C++ code changes and can’t be done as a mod.


#6

Oh sorry, I missed that it was a fork. I thought it was just (somehow) a mod.

Of course you can still set it up within the hardcode and have a JSON mod to trigger it on/off so it’s still optional.


#7

WOW~amazing work!! I want it to be mainlineヾノ≧∀≦)o


#8

After getting the hang of this, I have to say, its quite nice. Only thing I don’t like is that I can’t use the normal drop menu to put things down from a bag. Select one item from the bag, and it drops the whole thing. Otherwise, its pretty gud.


#9

Really? I never noticed that. I’l check it out and fix it.

Thanks for the report.


#10

So, I checked it and what a trip to the rabbit hole it was.

Rant incoming…

There are newer parts of code and older parts of code. In older parts position of an item is transferred as several independent pieces of information - type (character, map, vehicle), position on the map / part of the vehicle, and index. In newer parts of code, position of an item is transferred via item_location, which has all necessary information neatly in one place.

Now, I hijacked the item_location, to additionally carry the information necessary to find correct item regardless of containers it is nested in.

Sadly game code that does dropping from Inventory screen spans throughout several files, many functions, and information about items to drop is conveyed just by index. Which is why the drop function right now drops the bag, as the bag and all items in it share the same index.

It means I would have to alter way too much code to achieve something, that is already possible in Advanced Inventory, which I am not too keen to do.

TL;DR: While it would be nice to have this feature in Inventory screen, complex changes would be necessary, which would make my branch harder to maintain.


#11

I updated my git and compiled game with newest changes in vanilla game.

I also added following functionality:

picked up items are now automatically placed into worn backpack / held container, if you don’t have enough space in inventory, order is inventory->backpack->held container


#12

I updated my git and compiled game with newest changes in vanilla game.

The compiled game does include feature to sort out your loot which I PRed to be added to the vanilla game. I did it so it can be tried out by people and also because I wanted to play with the feature myself.


#13

Got to say, loving this enough that I had to go and make patches for my custom content mods just so they play nice with this. Shame about the dropping stuff, but I can completely understand the desire to not dig into maddening code. Plus the loot sorting feature, which addressed the only issue I had of getting stuff into sensible places in my base. Now this is quite literally nearly perfect.


#14

Thanks, glad you like it!

I updated the compiled game for download with latest version of sorting loot feature.

I plan to delay syncing of recently added features of vanilla game until the PR for sorting is merged into it.


#15

Hotfix for following sorting loot bug reported by dogoken on Git Hub

  • crash while trying to sort the MREs

If you have latest game .zip, you can download just new .exe from here. - obsolete


#16

Love it does it not work for clothes yet trye to use it on a coat but did not seem to let me? possibly doing it wrong LOL.

Can we get this to be a MOD so we can use it in latest versions etc that would be awesome or does it modify CORE game files? I assume it does

Thanks so much


#17

Can we get this to be a MOD so we can use it in latest versions etc that would be awesome or does it modify CORE game files? I assume it does

This can’t be a mod. Currently only JSON files are able to be used for mods. What Robik alters is core cpp files. Unfortunately that means the game needs to be compiled into a new .exe app every experimental build (if you want the constant upgrades from github) and downloaded as a .zip for the code to take effect when running the .exe app


#18

I did assume as much mate

Thanks for the awesome work any way :slight_smile:


#19

Yes, I’d love to have it as a pure mod, sadly, it is not possible. And while it is possible to add changes to main game just for mod support, my changes are bit too extensive to be accepted for such purpose.

Good news is that unlike CataTweaks, I wrote Hybrid Inventory with maintainability in mind, and I keep it that way. So making it updated every few days is not such a headache as it was in the past.

And while I planned to make new .zip after the sort out loot gets merged, the main game was updated with some cool stuff, like Root Cellar, and so I compiled new version anyway.


#20

Don’t you plan to mainline your system? Not the changes required for making it moddable, but the whole system, perhaps even making it default?