How to add items to a room using HardRain's toolset (beta)
May 22, 2023 2:39:51 GMT 10
Sr. Belt and HardRain like this
Post by trauser on May 22, 2023 2:39:51 GMT 10
We'll take as example the room 21a, the underground mines area where we found the Royal Staff. We'll add two more items to this room: a (now completely useless) False Eye and a Green Herb (because, well, it's a Green Herb). Let's also make the Green Herb Shootable, i. e., we can shoot it so it will move once. It is very useful if we put it on the ceiling or other high places, just like the gems. Let us see what items we have by opening the 25.ITA in the editor.
We have 21 items in room 21a. Close the file but do not quit the ITA editor. Open the file in HxD or another hex editor of your choice.
We need to add 2 to the number of items in the room. That number is in the first row (00000000), seventh column (06) of the file. In our case, it's "15" (21 in hex). Add 2 to it and change to "17" (23 in hex).
Next, we go to the end of the file. If you look closely, you'll notice many lines with "............?€..". They are (I suspect) separators between items (see Note 1 below). What we will do is to copy 11 lines from the last "............?€.." upwards, and stop just before the next "............?€.." above.
We move to the end of the last "............?€.." line of the file and paste the lines we copied as many times as the items we want to add (two times, in this case). Save and close the hex editor.
Open the file again in the ITA editor. We now have 23 objects in the room and the last two are copies of the one above them. I've changed the Glow to None in the last item.
Now, we change the Index of the new items to acceptable values. If we want them lying around in the room, we just copy the coordinates from the RE4 Level Viewer (DO NOT FORGET to multiply the values by 1000). If we need them Inside an Object, we need to check what Object is available in the ETS tool; or you can follow my tutorial on how to add new objects to a room if you want to create new objects for the items.
We have 21 items in room 21a. Close the file but do not quit the ITA editor. Open the file in HxD or another hex editor of your choice.
We need to add 2 to the number of items in the room. That number is in the first row (00000000), seventh column (06) of the file. In our case, it's "15" (21 in hex). Add 2 to it and change to "17" (23 in hex).
Next, we go to the end of the file. If you look closely, you'll notice many lines with "............?€..". They are (I suspect) separators between items (see Note 1 below). What we will do is to copy 11 lines from the last "............?€.." upwards, and stop just before the next "............?€.." above.
We move to the end of the last "............?€.." line of the file and paste the lines we copied as many times as the items we want to add (two times, in this case). Save and close the hex editor.
Open the file again in the ITA editor. We now have 23 objects in the room and the last two are copies of the one above them. I've changed the Glow to None in the last item.
Now, we change the Index of the new items to acceptable values. If we want them lying around in the room, we just copy the coordinates from the RE4 Level Viewer (DO NOT FORGET to multiply the values by 1000). If we need them Inside an Object, we need to check what Object is available in the ETS tool; or you can follow my tutorial on how to add new objects to a room if you want to create new objects for the items.
Let's say the coordinates are adjusted and the items are exactly where we want them. Change the Glow of the False Eye to Big White, and the Glow of the Green Herb to Green (Note 2). Save and close. Repack the files into r21a.dat and copy it to the folder st2 in the game directory. I'm assuming you backup files every now and then.
Now you're done, and the items will be there the next time you run the game. Notice that some weapons (they're items too) won't appear in a New Game unless they are available at the Merchant.
Note 1: not exactly. The line that comes after the "............?€.." deals with properties like Glow and Inside. Even so, my little mistake didn't (and won't) affect the rest of the procedure. We'd be copying the properties of the previous object but we'll fix them in the ITA editor anyway. No harm done.
Note 2: the Glow shows us what the item is. Green is for healing items, Red is for ammo and grenades, Blue is for pesetas; the three former types of Glow appear like a column of light and are for the items in boxes or barrels, or the ones dropped by enemies or crows. White is for many other things. Glint is just a kind of metallic reflection on the item.