Qhimm.com Forums
Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: NobodyImportant on 2006-05-12 03:05:38
-
Hello, I've been digging through the wiki and jenova source and couldn't find any information on the ID of weapons or armor. When looking through the savemap, I see "0x1C 1 byte Equipped weapon". So, when I go to a save with Clouds inital equipment, go to the correct offset and read one byte, both the weapon and armor ID are 0x00. Any ideas?
Sorry if I'm becoming a nuisance. I did look for it. :)
-
Savemap@wiki (http://wiki.qhimm.com/FF7/Savemap)
- When reading from FF7 PC saved game, add 0x09 to the offset (there is some PC-only header at the beginning of the file).
- Decide which character's weapon you want to read, pick the right record-offset (0x54 for Cloud, 0xD8 for Berret, etc.) and add it to your offset
- Check the character record for an offset you are interested in and... add it to your offset :)
So... If we were trying to read Cloud's weapon, we'd search for it at offset:
0x09 + 0x54 + 0x1C = 0x79
dziugo
-
Right, that's all calculated. However, when I pick the right offset, both the armor and weapon return 0x00. :(
I'm sure it's the right offset because all other data read is correct.
-
Can I see your save-game?
dziugo
-
I've been using save00.ff7 (http://www.ffseven.com/saves.php), slot one. No need to make my own with this perfectly working example. :) In this save, Cloud has a Buster Sword and Bronze Bangle.
The item ID for Bronze Bangle is 0x00, great. As for the Buster Sword, it's 0x80. :(
ADDITION: I changed the offset to read Barrets weapon & armor, which returns 0x01 for the Gatling Gun and 0x00 for the Bronze Bangle. This is why I'm assuming there's some sort of offset list for the weapons, armor and accessories. Not knowing C++, the Jenova source is very hard to make out, but I've been looking for something like it. By the way, the Gatling Gun item ID is 0xA0. :(
-
I've compared what you get with one of my epsxe savegame at the beginning of the game. I also have 0x00 for the Buster Sword and the Bronze Bangle. Barret's equipped Gatling Gun is 0x20. Considering Buster Sword and Gatling Gun are (respectively) 0x80 and 0xA0 in the inventory listing, you have to substract 0x80 from this value to get the weapon value when equipped.
In Jenova, this is found in charedits.cpp, ie. in the void CCharEquip::OnSelchangeWeapon() function. You'll see some 128 there, because of this "conversion". That's the trick :wink:
By the way, the armor need not be converted. But for the accessory, you have to subtract 0x20 from the inventory ID to get the equipped ID.
-
FeuFeu was faster (that thread-updated notify is soo cool :)), so I'll just post offsets at which a "decoding" process takes place:
Weapon:
00706326 |. 8A440A 1C MOV AL,BYTE PTR DS:[EDX+ECX+1C]
0070632A |. 05 80000000 ADD EAX,80
Armour:
0070635D |. 8A440A 1D MOV AL,BYTE PTR DS:[EDX+ECX+1D]
00706361 |. 05 00010000 ADD EAX,100
Acc:
007063AD |. 8A440A 1E MOV AL,BYTE PTR DS:[EDX+ECX+1E]
007063B1 |. 05 20010000 ADD EAX,120
dziugo
-
Man, all the members here are so smart. :|
I never would have thought of that. Good find.
Thanks, you two.
EDIT: Looks like you posted before I replied. Neat board feature.
Thanks again.
-
0x100 and 0x120 for armor and accessories ? Is the "compressed" inventory IDs expanded on two bytes when it's loaded from the savemap ?
-
It's converted "on the fly" whenever it's needed. Then as a DWord it is used in function(s).
dziugo