Modding Item Box initial contents (and a hex tutorial)
Nov 19, 2020 13:15:43 GMT 10
ReiKaz and Scott Kennedy like this
Post by rodwolf on Nov 19, 2020 13:15:43 GMT 10
Hey everyone! I was messing around with some files for a mod I'm making for myself and found a way to switch which weapons you can get at the start of a new run. There is a file called _masters.scn.19 that has the weapon IDs of the unlockable weapons and DLC weapons (if you have them) that get added to the item box on a new run.
The file is located in ~\natives\x64\objectroot\scene\system\_masters.scn.19
Make a copy of the file and place it somewhere else, so you can always have a backup of the original in case something goes wrong! And open the copy in the hex editor of your choice (I use HxD)
Once you have the file opened in a hex editor, you can look for the following IDs, depending on what you want to change. The following are for the unlockables, and won't show up in-game unless you have already completed the requirements to unlock them:
2F 00 00 00 0F 00 00 00 01 00 00 00 01: Infinite Knife
52 00 00 00 0F 00 00 00 0F 00 00 00 01: Samurai Edge (Infinite)
17 00 00 00 11 00 00 00 20 00 00 00 01: LE 5 (Infinite)
DE 00 00 00 1C 00 00 00 01 00 00 00 01: ATM-4 (Infinite)
FC 00 00 00 1D 00 00 00 01 00 00 00 67: Minigun (Infinite)
These 5 are bundled almost together separated by a few bytes, a few lines above any of these you should find the text "I.t.e.m.L.o.c.k.e.r.A.d.d.E.x.I.t.e.m."
You can also look for the following IDs for the DLC handguns:
53 00 00 00 0F 00 00 00 00 00 00 00 00: Chris' Samurai Edge
54 00 00 00 0F 00 00 00 00 00 00 00 00: Jill's Samurai Edge
55 00 00 00 0F 00 00 00 00 00 00 00 00: Albert's Samurai Edge
Cool, but how do I change the weapons?
Well, as far as I know (I'm no expert, mind you), the hex structure for most weapons in the game is the following:
AA Weapon ID
BB Ammo type
CC Ammo loaded in magazine (REMEMBER THIS IS IN HEX, so use a hex calculator to put the correct value in)
DD Upgrades on weapon (it's kinda iffy, as you might be able to tell already)
For a weapon change to work properly, you have to set the correct weapon ID and ammo type (so you cant put 9mm ammo on the LE5 as it won't work properly, the change might be possible, but those values are defined in another file which is unknown to me). Ammo loaded is flexible but I have not tested this in all weapons. And lastly, we have upgrades, on most weapons where upgrades aren't available it's best to leave it at 00, but as you can see, some weapons here have other values (01 or 67) and I don't know why.
Here are some IDs that I have found through testing and/or existing cheat tables:
02: M19
03: JMB Hp3
04: Quickdraw Army Revolver
07: MUP
08: Broom Hc
09: SLS 60
0B: W-870
15: MQ 11
17: LE 5 (Infinite)
1F: Lightning Hawk
29: EMF Visualizer
2A: GM 79
2B: Chemical Flamethrower
2C: Spark Shot
2D: ATM-4
2E: Combat Knife
2F: Infinite Knife
31: Anti-tank Rocket
32: Minigun
41: Hand Grenade
42: Flash Grenade
52: Samurai Edge (Infinite)
53: Samurai Edge (Chris Model)
54: Samurai Edge (Jill Model)
55: Samurai Edge (Albert Model)
DE: ATM-4 (Infinite)
F2: Anti-tank Rocket (Infinite)
FC: Minigun (Infinite)
0F: Handgun Ammo
10: Shotgun Shells
11: Submachine Gun Ammo
12: MAG Ammo
16: Acid Rounds
17: Flame Rounds
18: Needle Cartridges
19: Fuel
1A: Large-caliber Handgun Ammo
1B: High-Powered Rounds for SLS60
1C: Rocket
1D: Minigun Ammo
01: Upgrade 1
02: Upgrade 2
03: Upgrade 1 + 2
04: HP3 Laser Sight
06: SLS and HP3 Full Upgrade
All of these values can be used across various files to replace weapons and items around the game, but if you decide to do so, please check out Zealot's item editor, at the time of writing it's in beta but it makes changing most items a breeze (except items in containers like lockers and such, you can change those but it has to be by hand in a hex editor). Also, make sure you use this ID list as it is more accurate than the one in the tool, I will post item IDs in the next post.
The file is located in ~\natives\x64\objectroot\scene\system\_masters.scn.19
Make a copy of the file and place it somewhere else, so you can always have a backup of the original in case something goes wrong! And open the copy in the hex editor of your choice (I use HxD)
Once you have the file opened in a hex editor, you can look for the following IDs, depending on what you want to change. The following are for the unlockables, and won't show up in-game unless you have already completed the requirements to unlock them:
2F 00 00 00 0F 00 00 00 01 00 00 00 01: Infinite Knife
52 00 00 00 0F 00 00 00 0F 00 00 00 01: Samurai Edge (Infinite)
17 00 00 00 11 00 00 00 20 00 00 00 01: LE 5 (Infinite)
DE 00 00 00 1C 00 00 00 01 00 00 00 01: ATM-4 (Infinite)
FC 00 00 00 1D 00 00 00 01 00 00 00 67: Minigun (Infinite)
These 5 are bundled almost together separated by a few bytes, a few lines above any of these you should find the text "I.t.e.m.L.o.c.k.e.r.A.d.d.E.x.I.t.e.m."
You can also look for the following IDs for the DLC handguns:
53 00 00 00 0F 00 00 00 00 00 00 00 00: Chris' Samurai Edge
54 00 00 00 0F 00 00 00 00 00 00 00 00: Jill's Samurai Edge
55 00 00 00 0F 00 00 00 00 00 00 00 00: Albert's Samurai Edge
Cool, but how do I change the weapons?
Well, as far as I know (I'm no expert, mind you), the hex structure for most weapons in the game is the following:
AA 00 00 00 BB 00 00 00 CC 00 00 00 DD 00 00 00
AA Weapon ID
BB Ammo type
CC Ammo loaded in magazine (REMEMBER THIS IS IN HEX, so use a hex calculator to put the correct value in)
DD Upgrades on weapon (it's kinda iffy, as you might be able to tell already)
For a weapon change to work properly, you have to set the correct weapon ID and ammo type (so you cant put 9mm ammo on the LE5 as it won't work properly, the change might be possible, but those values are defined in another file which is unknown to me). Ammo loaded is flexible but I have not tested this in all weapons. And lastly, we have upgrades, on most weapons where upgrades aren't available it's best to leave it at 00, but as you can see, some weapons here have other values (01 or 67) and I don't know why.
Here are some IDs that I have found through testing and/or existing cheat tables:
--------------------------------------------------WEAPONS--------------------------------------------------
01: Matilda02: M19
03: JMB Hp3
04: Quickdraw Army Revolver
07: MUP
08: Broom Hc
09: SLS 60
0B: W-870
15: MQ 11
17: LE 5 (Infinite)
1F: Lightning Hawk
29: EMF Visualizer
2A: GM 79
2B: Chemical Flamethrower
2C: Spark Shot
2D: ATM-4
2E: Combat Knife
2F: Infinite Knife
31: Anti-tank Rocket
32: Minigun
41: Hand Grenade
42: Flash Grenade
52: Samurai Edge (Infinite)
53: Samurai Edge (Chris Model)
54: Samurai Edge (Jill Model)
55: Samurai Edge (Albert Model)
DE: ATM-4 (Infinite)
F2: Anti-tank Rocket (Infinite)
FC: Minigun (Infinite)
--------------------------------------------------AMMO TYPE--------------------------------------------------
00: Nothing0F: Handgun Ammo
10: Shotgun Shells
11: Submachine Gun Ammo
12: MAG Ammo
16: Acid Rounds
17: Flame Rounds
18: Needle Cartridges
19: Fuel
1A: Large-caliber Handgun Ammo
1B: High-Powered Rounds for SLS60
1C: Rocket
1D: Minigun Ammo
--------------------------------------------------UPGRADES--------------------------------------------------
00: Nothing01: Upgrade 1
02: Upgrade 2
03: Upgrade 1 + 2
04: HP3 Laser Sight
06: SLS and HP3 Full Upgrade
All of these values can be used across various files to replace weapons and items around the game, but if you decide to do so, please check out Zealot's item editor, at the time of writing it's in beta but it makes changing most items a breeze (except items in containers like lockers and such, you can change those but it has to be by hand in a hex editor). Also, make sure you use this ID list as it is more accurate than the one in the tool, I will post item IDs in the next post.
--------------------------------------------------EXAMPLES--------------------------------------------------
Ok, so you now know how to look for the weapon you wanna replace in the item box and you know the IDs to replace them with, so here's a few examples:
------- Infinite Knife replacer -------
Look for the ID for the infinite knife: 2F 00 00 00 0F 00 00 00 01 00 00 00 01
Replace the line with: F2 00 00 00 1C 00 00 00 04 00 00 00 00 to get an infinite Anti-Tank Rocket Launcher (like the one Leon gets in the fight with the Tyrant, but infinite, and with a cool reload animation!)
As you can see, I replaced the Inf. Knife ID (2F) with the Infinite Anti-Tank Rocket's (F2), set the ammo type to Rockets (1C), put four rockets in the magazine (04) and changed the upgrade slot back to 00 (you can leave it at 01, it won't make a difference in this case).
------- Upgraded Weapon Replacer -------
Look for the ID you want to replace, let's say you wanna replace the LE5: 17 00 00 00 11 00 00 00 20 00 00 00 01
So, if you want to replace the LE5 with a fully upgraded HP3, you replace it for 03 00 00 00 0F 00 00 00 1A 00 00 00 06
This means that the HP3 (ID 03) will use handgun bullets (0F), have 26 bullets in the magazine (1A) and have both the extended mag upgrade and the laser sight added (06)
Once you finish editing, remember to save, and then put the file inside the correct file structure on the mod manager (~\modmanager\Games\RE2R\Mods\NAME OF YOUR MOD\natives\x64\objectroot\scene\system\_masters.scn.19), open the modmanager exe, refresh mod list and activate. Once that is done, start a new run and go open the item box to see the results!
This, or any item/weapon replacements won't work on an already started run, so keep that in mind!
That's it! Happy modding!
Ok, so you now know how to look for the weapon you wanna replace in the item box and you know the IDs to replace them with, so here's a few examples:
------- Infinite Knife replacer -------
Look for the ID for the infinite knife: 2F 00 00 00 0F 00 00 00 01 00 00 00 01
Replace the line with: F2 00 00 00 1C 00 00 00 04 00 00 00 00 to get an infinite Anti-Tank Rocket Launcher (like the one Leon gets in the fight with the Tyrant, but infinite, and with a cool reload animation!)
As you can see, I replaced the Inf. Knife ID (2F) with the Infinite Anti-Tank Rocket's (F2), set the ammo type to Rockets (1C), put four rockets in the magazine (04) and changed the upgrade slot back to 00 (you can leave it at 01, it won't make a difference in this case).
------- Upgraded Weapon Replacer -------
Look for the ID you want to replace, let's say you wanna replace the LE5: 17 00 00 00 11 00 00 00 20 00 00 00 01
So, if you want to replace the LE5 with a fully upgraded HP3, you replace it for 03 00 00 00 0F 00 00 00 1A 00 00 00 06
This means that the HP3 (ID 03) will use handgun bullets (0F), have 26 bullets in the magazine (1A) and have both the extended mag upgrade and the laser sight added (06)
Once you finish editing, remember to save, and then put the file inside the correct file structure on the mod manager (~\modmanager\Games\RE2R\Mods\NAME OF YOUR MOD\natives\x64\objectroot\scene\system\_masters.scn.19), open the modmanager exe, refresh mod list and activate. Once that is done, start a new run and go open the item box to see the results!
This, or any item/weapon replacements won't work on an already started run, so keep that in mind!
That's it! Happy modding!