This mod dynamically updates NPC vendors to sell additional items via .json file definitions. This was my first "utility" mod.

code cover image

While messing with NPC shopkeeper inventories, I was annoyed by how much custom configuration I had to do for something I considered simple. Shopkeepers are controlled by “tweaks” in Cyberpunk 2077. These are CDPR’s own way of storing game variables and certain information. These tweaks have a confusing structure which caused me to take a few weeks just to understand fully.

Along with editing existing NPCs, I also messed with adding new NPCs to the world, but this proved to be a huge time sink. Most edits I would make seemed to affect other files at random and I ended up recreating my entire project dozens of times. Once I had it working, I did not want to touch it again or I felt I risked losing hours of configurations again.

So once I had new NPCs working, I only created them with empty inventories, nothing for sale. Then, I created my own custom scripts which would parse any matching .json file I gave it with the “tweak” values described earlier. It took some trial and error as I hadn’t written my own json reader before. Being in the correct layer of both tweaks and json was something only solved by one too many print(“got here #4”) statements. Once it was done, I finally was able to release my own NPC

Gameplay screenshot of the new custom shopkeeper NPC