Using JA-BiA debugger and cheat engine to modify inventory

15-09-2018 - 1 minute, 31 seconds -

Jagged Alliance Back in Action is several years old, but there is a number of people that still enjoy the game and play it. Several community members have recently been asking various technical questions related to modding. I do not plan to add any more features to JABIA tools, but since there is still enough interest I wanted to answer a particular question in a blog post. A community member asked to add some quest related inventory items to character's inventory. The current debugger is capable of editing equipment and weapons, but not the inventory slots. However, using a combination of the debugger and CheatEngine, it is possibly to very quickly edit a mercenary's inventory. I will omit detailed usage of the debugger and CheatEngine since those can be found elsewhere and focus on the task at hand.

First, copy the address of the mercenary's inventory structure. The address is found next to the mercenary's name in the debugger. In CheatEngine, click on "Add Address Manually", pase the address and click ok.

This should have created a new entry in CheatEngine, which should be right clicked and "Brose this memory region" selected. Move an item around in the inventory and watch for highlted bytes in the Memory Viewer. The hexadecimal 0x384 is 900 in decimal which according to the game's "ammunition.txt" config file maps to .357 magnum ammunition. The 0x09 is the count of that item.

Lets select the first byte 0x84, right click on it and click Edit. Change the drop down to 2 byte and set the value to 812 which maps to a quest item. In a similar way, change the count to 1, making sure to set the drop down to 1 byte.

After closing the merc's inventory and opening it again, instead of .357 magnum ammunition a magazine is there.