SigilFey;n9693521 said:It hath been passed on! I think y'all are pretty awesome!
ssdany;n9691271 said:This is how I met the Mighty Body Parts. All 16 of them. Initially, there are 10 at max and later you will receive new parts and copies of already existing ones. That’s the problem. Their identifiers can be spread across a very wide range (1-64802 in my case). And yes, you can’t remove them.
This confirms my worst nightmares: If we can't get some attention for this problem on the developers side, chances are, it may reappear in Cyberpunk 2077 as a TW3 legacy.ssdany;n9691271 said:Well, I did not even manage to find a definition of SItemUniqueID struct (which is, by the way, a TW2 legacy).
You need to enter the commands (like liverHack, upper/lowercase matters) on the developer console. To activate the developer console permanently, you have to add an entry to the file general.ini, which is located in The Witcher 3 Wild Hunt\bin\config\base, like this:DrDeathhand;n9692061 said:But after that when I am ingame I do not know how to run the different options of the MOD.
So can tell me / us how to run it?
This is, what I think too. Therefore I omitted these in the changed version of your mod, but I created an additional exec function (= developer console command) addknownRecipes, which can add the recipes and schematics already known as items later on request.ssdany;n9691271 said:Recipes and schematics: I think it’s a bad idea to add yet another hundred of items. Please notify me if disappearance of these "papers" will cause any bugs - I’ll change the code. Regardless, all recipes and schematics should still be available in related menus.
Gwent cards as items in the inventory are required and count for the quest "Collect Them All". A Gwent card, when received as item, is added to the Gwent card section of the game, but the basic starter deck was never added by card items, but was present a priori or added directly after the first Gwent quest. Therefore, I removed all Gwent cards present as item, but only these, and these will be added again, when the player takes / picks up the dropped cards in the bag. However, the player needs to rebuild his Gwent decks afterwards.ssdany;n9691271 said:Gwent cards will be transferred into a lootbag. My first implementation caused them to be duplicated (thanks karlblau for testing). Hope it’s OK now.
Five times, because sometimes I use the 'take all' option, and I wanted to have some margin of security, if there should be many unique items in the loot, or if the game adds a head. I tested this on different occasions, it worked, whenDuplicate item id alert (19411)
Drop and pick up again a runestone (a whole stack)
five times and reload your game!
More details about safety and the procedure proposed
karlblau;n9716871 said:How to crush the bug
This is a long text, but again worthwhile to read, I hope, because now there is a full solution to repair saved games without any compromise.
The problem after overflow of the SItemUniqueId by doing the liverHack are copies of Geralts body parts, which occupy high unique item IDs and cannot be removed by normal means, because of a special protection by the game engine. It is desired, to be able to reset to a SItemUniqueId counter as low as possible, which is about 10, before taking any items.
Therefore, let's remove these additional body parts now, to proceed in the game with a clean savegame and for a long time without any additional hassle.
To do this, you guess it, the special protection is tricked and bypassed - by directly editing a Witcher 3 savegame file compressed into LZ4 chunks with a Hex Editor - and yes, this can be done easily, don't be afraid.
I used the very good HxD by Maël Hörz, this tool can edit files and memory (RAM) of running programs, and is available in many languages as an installable or portable version, look at https://mh-nexus.de/en/hxd/ and check the Download page.
I have added a file, which shows how Geralts basic body part names (a bunch of strings each preceeded by a byte with the length) look in a decompressed savegame: GERALTBody.txt (it's not all readable text, you can use Notepad, but you should use a Hex editor) and an example what to expect in a compressed savegame: GERALTBody.lz4 (you may see something different). But in any case, you should find the preceeding strings "'06'PLAYER'06'GERALT" or in hex 06 50 4C 41 59 45 52 06 47 45 52 41 4C 54. Now change one letter in the readable part of each name of these (and only these) body parts, which you want to remove, because there are duplicates with high item IDs.
The game will automatically remove any item with an invalid name from the inventory while loading a savegame file, whether it was a protected "Mighty Body Part" (® by ssdany) or not. Therefore after loading the skillfully damaged savegame file (Geralt may be partially invisible), save again, and then undo all the changes with your favourite Hex Editor in this new savegame file, because Geralt needs a body and you want him to be visible without armor. Reload this savegame, and restore Geralts basic body parts (you would not even need to equip the body parts, but it looks definitely better); possible commands are:
additem('Body torso medalion')
equipitem('Body torso medalion')
additem('Body palms 01')
equipitem('Body palms 01')
Other initial, protected body parts are: Body underwear 01, Body feet 01, head_2, Preview Hair. Please note: Not all body parts are protected, most can and will be removed by RemoveAllItems() during liverHack!
After this action go and take all the items in the bag on the ground, which was created while doing liverHack(). Equip and unequip your armor, just to check whether the body parts are correctly equipped without armor donned and whether Geralt in underwear looks complete and fine (not only in inventory screen, but in the game world).
Now you can play the game without any mod - forever, if you like, because liverHack and the procedure for duplicate body parts removal can be repeated.
If you are afraid, that this editing of a compressed savegame file will do damage (even with some utility not written yet it would be an unknown and untested thing, to compress again and use a Witcher 3 savegame file), please read http://fastcompression.blogspot.de/2011/05/lz4-explained.html and make you realize, that CD projekt RED did not even add a checksum to Witcher 3 savegame files. To increase safety (but it's probably paranoid), you can check, whether the string (the changed body part name fragment) present after editing does not occur elsewhere nearby in the savegame file, so it can not be used as a new match when building literals during compression of a block.
Q: I can't find the initial string when searching a save file. There was no PLAYER GERALT
A: Use the hex values given and search again. Check, whether you used the correct data-type to search for (text for text, hex for hex). I tested many save files, and always found this string exactly once. Always, without any exceptions. Perhaps the developers used it as an eyecatcher for dumps.
Q: After hex editing a savegame file, I was not able to reload the game, and was told, the save file is damaged.
A: It is possible, that the changed text was in use as replacement for compressed text elsewhere in the block. In this case, decompression will produce garbage. For eample, if you change the first occurrence of "Body", you'll probably provoke this. Try body parts one by one. Try another character in a body parts name fragment. If all fails, try another save game file.
Q: If you could load a file, or find the decompressed body part names in memory, did you see errors?
A: This never happened during all my tests. If it worked, there was always the expected change.
I did additional tests and checks, used HxD to look at edited savegame files after decompression in the memory of W3SavegameEditor.exe (uploaded earlier here), replaced "Body torso medalion" (protected) by "Body torso 01" (not protected and removable) and created a mod to alter Geralt's body parts, which are defined in one XML file: It is in the game's installation directory .../The Witcher 3 Wild Hunt GOTY/content/content0/bundles/xml.bundle, and the unpacked / uncooked file is in /gameplay/items_plus/_technical_items_defs.xml.
The tools needed to make a mod to change Geralts vital body parts are
- the ModKitchen v1.0.1 made by Vervurax: https://www.nexusmods.com/witcher3/mods/389
- the official updated Witcher 3 Modkit by CD Projekt RED: https://www.nexusmods.com/witcher3/news/12625
But please note, you don't need to mess around with body parts, this was just done for additional checks.
The only tools required for a full repair and refresh of a saved game, before the bug occurs, are
- the enhanced modDebugItemId by ssdany and me, which I uploaded earlier
- a Hex Editor like HxD
You'll need the enhanced mod, because you want to list the names and item IDs of duplicate body parts with maxID and allNoShowID after a first liverhack just for looking, so you know which body parts to edit. After editing, use maxID and do liverhack(offset), then save, undo edited changes, reload and restore Geralt's body as described. And please note, the liverhack(offset) in the enhanced mod requires to enter the offset proposed by maxID.
Later ssdany reworked his mod and improved the handling, this liverHack(offset) (upper/lowercase matters) just puts you at offset after the overflow, this is better, but not yet in the enhanced mod (and there is still a minor bug in that reworked mod, but ssdany fixed the code already, it's not uploaded yet).
While hacking witcher3.exe, I found some SItemUniqueIdGenerator and ...ClassBuilder(s), therefore I think, all new item IDs are created properly in a single place and the bug could be fixed just by reusing item IDs quite easily and safely. But we can't do this and the developers won't do it. But if they are aware, they might do it for their next game.
Therefore, don't dream, use what we got. I really did not believe, it would be possible, to achieve this.
The developer console command additem('mh203_water_hag_trophy') would add it to your inventory, however, it is not possible to fix a game after the bug has destroyed the inventory already. The fix must be done, before the bug does any visible damage, before the uncontrolled SItemUniqueId overflow happens. I hope for you, that you have an earlier savegame with an uncorrupted inventory.DrDeathhand;n9720051 said:PS: when I found out my savegame was corrupted I found out because the BUG killed my WaterHag Trophy... it was just GONE!
Do you know of a way (after fixing my savegame) in which I can add the WaterHag Trophy to my inventory again??
16. Now we do the real thing, reload the savegame you intend to fix.For example, if there are two rows in the display:
ID: 19441, Name: Body torso medalion
ID: 2, Name: Body torso medalion, mounted
then 19441 is a duplicate with a high item ID and you need to remove these body parts with hex editing. I changed the fragment meda into mfda and back to do this.
karlblau;n9722261 said:The developer console command additem('mh203_water_hag_trophy') would add it to your inventory, however, it is not possible to fix a game after the bug has destroyed the inventory already. The fix must be done, before the bug does any visible damage, before the uncontrolled SItemUniqueId overflow happens. I hope for you, that you have an earlier savegame with an uncorrupted inventory.
I'll try to complete your checklist:
1. Make a backup of your savegames somewhere.
2. Edit the general.ini file @ c:\program files\The Witcher 3 (path may vary depending on where you installed your copy of The Witcher3) and add the following line to it:
[General]
ConfigVersion=2
DBGConsoleOn=true
3. Download the enhanced version of modDebugItemID.zip in post #63, uploaded by karlblau, link https://forums.cdprojektred.com/filedata/fetch?id=9699911
4. After successfully downloading modDebugItemID.zip file extract the folder to your Mods folder @ c:\program files\The Witcher3\Mods (path may vary depending on where you installed your copy of The Witcher 3
5. After doing points 1 / 4 start the Witcher 3. You should see the Witcher 3 recompiling scripts.
6. Load the savegame you want to fix.
7. When your savegame has been loaded open the Dev Console by pressing ~ (depends on keyboard language)
8. When the Dev Console is opened, test whether it works, enter testMessage
9. Close the Dev Console (press ~ again), and hit E or Enter to confirm this crazy message built in by the developers.
10. Check whether modDebugItemID is loaded and works: Open the console again and enter help
11. Read this, them close the console and confirm / close the help text.
12. Unequip all mutagens your Geralt currently uses, but nothing else.
12. Now you need to learn, which unremovable body parts have duplicates with high item IDs, enter maxID and write down the proposed offset for liverhack.
13. Enter liverhack(<offset>), <offset> is the recommended offset.
14. Ignore the next steps recommended by liverhack, this liverhack was just for the check.
15. Enter maxID again and write down the names of the body parts with duplicates.
16. Now we do the real thing, reload the savegame you intend to fix.
17. Unequip all mutagens, enter maxID and liverhack(<offset>) again.
18. Geralt is nude now, but his body is complete. Save this game in a new save game slot.
19. Hex edit this savegame as described, change the names of body parts with duplicates.
20. Reload the edited savegame, Geralt is nude and probably incomplete, some parts missing.
21. Save this game in another new save game slot.
22. Hex edit this latest saved game, and undo the changes, restore the names of Geralts body parts.
23. Reload the edited savegame, add and equip the missing body parts, Geralt looks complete again.
24. Take all items in the bag on the floor, which appeared after liverhack.
25. Equip all stuff and rebuild your Gwent decks. You are done.
Please note: There are currently two different versions of modDebugItemID uploaded. The version uploaded first by ssdany supports these commands: highestID, highestNoShowID, highestNoDropID, showAll and liverHack(<offset>).
The version uploaded later by karlblau, based on an earlier version by ssdany, supports these commands: help, maxID, maxNoShowID, allNoShowID, maxNoDropID, removeitemID(<ID>,<quantity>), dropitemID(<ID>,<bool keep>), mountID, addknownRecipes, dropGwint, liverhack(<offset>) and this version provides much more output, like item names, what we need here. This liverhack (spelled differently) needs the offset as number to add to SItemUniqueId, while the first liverHack uses an absolute offset above zero, which is easier, but ok, all this is work in progress. We'll try to make a consolidated, better, final version later.
PS: I'll be not on the Internet for the next days, and can't help. Be patient ...
PPS: There might be more body parts and duplicates, than maxID lists on one screen. To be safe, use allNoShowID too, this can scroll down and list hundreds of lines, when you write down the names of body parts to remove by Hex editing. Maybe, you created more duplicates during your very long sessions than expected. All copies are removed together, if the name is changed.
BTW: The first duplicate of a body part, Body palms 01, is added when Geralt is shaved and prepared for his audience with emperor Emhyr in Wyzima.
Any savegame with a negative offset proposed by maxID cannot be repaired, because an uncontrolled overflow of SItemUniqueID will happen after reload, there will be duplicate item IDs in any case. The savegame with a proposed offset of 47 should be useable however.... and voila... the offset would be -3 or - 10 or something
Trophies on your horse and equipped horse equipement like a saddle are not in the player's inventory, but in a different inventory, the horse inventory, which contains only these 4 items. They must not be unequipped, to avoid consuming of additional item IDs in the player's inventory. This horse stuff will go through the process of liverhack and the RemoveAllItems function called by it internally untouched. The mutagens are another thing: this stuff will be moved to the player's inventory during liverhack, often consume additional item IDs, distort the predictions of maxID, and even be duplicated. You do not need to unequip anything except the mutagens before doing liverhack, not even armor or swords.1. You asked / said to unequip the equiped mutagens. But when checking my inventory I also noticed that I still had my GraveHag Trophy and things like the Horse blinds, sadle, sadle bags etc equiped.. Should I also unequip / drop these items as well with everything else?? Just like the Mutagens??
Look at your screenshot 6 - there you can see "Body torso medalion" six times, and if you had used allNoShowID, you would see at least one more with an ID below 6. Geralt needs only one "Body torso medalion", the other items are duplicates.2. What do you mean with "change the names of bodyparts with duplicates?)
No, you should not remove all body parts, only those with high item ID duplicates. You should try to remove only what is absolutely necessary. Screenshot 7 is fully sufficient and an indicator for a successful operation, because you got rid of all duplicates, and the game added two new body parts with IDs 8 and 9, your current head with tattoo and your current hairstyle.3. Should the maxID list be completely empty after hexediting the bodyparts and then reloading that savegame and doing maxID? Because when I reload that savegame I have about 3 body parts left, see screenshot8 12-16
Yes, exactly this way. For the other body parts, which you removed by hex editing, just use the names displayed by maxID or allNoShowID.4. In point 23 you say add and equip the missing body parts. Do you mean by using this?
additem('Body torso medalion')
equipitem('Body torso medalion')
additem('Body palms 01')
equipitem('Body palms 01')
And if your answer is yes, can you please tell me all the commands for adding the bodyparts or show me a place / site where these commands are listed??
You may not change anything, neither during first hex editing, nor during hex editing back, which is not a readable, unchanged fragment of the body part name in clear text, or you will break the compressed data. In your case, "torso" and "ion" are fragments of "Body torso medalion" and "palm" (without r) is a fragment of "Body palms 01". If you can not change, considering this rule, the same character back, use another character of the readable fragment initially, or change less body part names at once and do two save/edit/restore/save/edit back steps. This IS a bit tricky and requires trial and error until successful. You, unfortunately, had many duplicates of nearly every body part (except Body underwear 01), and therefore more trial and error work awaits you. Sorry, I can't read the hex editor screenshots.5. Game locks up after I Hexedit the savegame again to return the changed values of the body parts to what they were.
I tried to find out which body part it locks up to and it locks up when trying to change back Body Palms 01.
Must I change this body part to?
The before Body Palms value is atorso ê.Aion...@palmr..
The after HexEditing Bodypalms is this atorso ê.Bion...0almr
Forget it, it is corrupted, even if you don't see this immediately.6. ... Is it still fixable over when the maxID nr is over 65535 like 65554 or has it crossed a line and is corrupted?
karlblau;n9760871 said:I don't have much time left, therefore I'll try to be short and exact.
Any savegame with a negative offset proposed by maxID cannot be repaired, because an uncontrolled overflow of SItemUniqueID will happen after reload, there will be duplicate item IDs in any case. The savegame with a proposed offset of 47 should be useable however.
Trophies on your horse and equipped horse equipement like a saddle are not in the player's inventory, but in a different inventory, the horse inventory, which contains only these 4 items. They must not be unequipped, to avoid consuming of additional item IDs in the player's inventory. This horse stuff will go through the process of liverhack and the RemoveAllItems function called by it internally untouched. The mutagens are another thing: this stuff will be moved to the player's inventory during liverhack, often consume additional item IDs, distort the predictions of maxID, and even be duplicated. You do not need to unequip anything except the mutagens before doing liverhack, not even armor or swords.
Look at your screenshot 6 - there you can see "Body torso medalion" six times, and if you had used allNoShowID, you would see at least one more with an ID below 6. Geralt needs only one "Body torso medalion", the other items are duplicates.
No, you should not remove all body parts, only those with high item ID duplicates. You should try to remove only what is absolutely necessary. Screenshot 7 is fully sufficient and an indicator for a successful operation, because you got rid of all duplicates, and the game added two new body parts with IDs 8 and 9, your current head with tattoo and your current hairstyle.
Yes, exactly this way. For the other body parts, which you removed by hex editing, just use the names displayed by maxID or allNoShowID.
You may not change anything, neither during first hex editing, nor during hex editing back, which is not a readable, unchanged fragment of the body part name in clear text, or you will break the compressed data. In your case, "torso" and "ion" are fragments of "Body torso medalion" and "palm" (without r) is a fragment of "Body palms 01". If you can not change, considering this rule, the same character back, use another character of the readable fragment initially, or change less body part names at once and do two save/edit/restore/save/edit back steps. This IS a bit tricky and requires trial and error until successful. You, unfortunately, had many duplicates of nearly every body part (except Body underwear 01), and therefore more trial and error work awaits you. Sorry, I can't read the hex editor screenshots.
Forget it, it is corrupted, even if you don't see this immediately.
karlblau;n9760871 said:I don't have much time left, therefore I'll try to be short and exact.
Any savegame with a negative offset proposed by maxID cannot be repaired, because an uncontrolled overflow of SItemUniqueID will happen after reload, there will be duplicate item IDs in any case. The savegame with a proposed offset of 47 should be useable however.
Trophies on your horse and equipped horse equipement like a saddle are not in the player's inventory, but in a different inventory, the horse inventory, which contains only these 4 items. They must not be unequipped, to avoid consuming of additional item IDs in the player's inventory. This horse stuff will go through the process of liverhack and the RemoveAllItems function called by it internally untouched. The mutagens are another thing: this stuff will be moved to the player's inventory during liverhack, often consume additional item IDs, distort the predictions of maxID, and even be duplicated. You do not need to unequip anything except the mutagens before doing liverhack, not even armor or swords.
Look at your screenshot 6 - there you can see "Body torso medalion" six times, and if you had used allNoShowID, you would see at least one more with an ID below 6. Geralt needs only one "Body torso medalion", the other items are duplicates.
No, you should not remove all body parts, only those with high item ID duplicates. You should try to remove only what is absolutely necessary. Screenshot 7 is fully sufficient and an indicator for a successful operation, because you got rid of all duplicates, and the game added two new body parts with IDs 8 and 9, your current head with tattoo and your current hairstyle.
Yes, exactly this way. For the other body parts, which you removed by hex editing, just use the names displayed by maxID or allNoShowID.
You may not change anything, neither during first hex editing, nor during hex editing back, which is not a readable, unchanged fragment of the body part name in clear text, or you will break the compressed data. In your case, "torso" and "ion" are fragments of "Body torso medalion" and "palm" (without r) is a fragment of "Body palms 01". If you can not change, considering this rule, the same character back, use another character of the readable fragment initially, or change less body part names at once and do two save/edit/restore/save/edit back steps. This IS a bit tricky and requires trial and error until successful. You, unfortunately, had many duplicates of nearly every body part (except Body underwear 01), and therefore more trial and error work awaits you. Sorry, I can't read the hex editor screenshots.
Forget it, it is corrupted, even if you don't see this immediately.
SpenceW;n9766681 said:Karlblau, you are a genius! I thought I would have to give up on this great game because of this bug, but your solution worked perfectly! One question though; how does the storage box play into this? Once I had finished with the liverhack/hex editing process and successfully "reset" the item IDs, I put all my runestones/glyphs in the storage so that I wouldn't burn up inventory IDs so quickly. However, the storage has its own inventory like you stated and the runes quickly use those IDs through loading or traveling to a new zone. Will this cause a problem in the future? Does the storage inventory need to be "reset" like the main inventory?
.....opens the blank page.karlblau;n9722261 said:Download the enhanced version of modDebugItemID.zip in post #63, uploaded by karlblau, link https://forums.cdprojektred.com/file...tch?id=9699911
(<offset>) gave me a bit of trouble. I kept entering i.e.: "liverhack(<263>)" and kept getting the "You failed Miserably" error message. To dilute confusion further, 263 was my personal offset number. Everyones' will be different. You obtain it in the 12th step after using the maxID command. But going back to why it wasn't working is because of the little < >symbols. Do not type them in as I found out the hard way after the 5th time I attempted this fix. So basically it should look like this: liverhack(263).karlblau;n9722261 said:13. Enter liverhack(), is the recommended offset.
karlblau;n9716871 said:Attached Files GERALTBody.zip (519 Bytes, 1 view)
Kevin04;n10013481 said:Amazing! This worked like a charm. Let me tell you my success story real quickly.
As my savegame had been corrupted for quite a while (50 hours of gameplay time at the least), I had low confidence that I could fix it at this point, especially after the last posts claiming that it wouldn't work. Expected to get a negative offset. Fortunately, that didn't happen. Got an offset of 158 and passed it to liverHack, changed the name of all 6 protected items in the save file (which took a few tries as head_2 got recompressed differently each time), reequipped my body parts and given myself all papers as items again (just because that's how the game does it apparently, when you pick them up). Not only were all the broken items gone, but the items I previously missed - at least three diagrams and one trophy - magically appeared in my inventory now. Thus, this fix can definitely work on a broken savegame, as long as your inventory is in a state to get a positive offset.
So, I think I can kind of confirm Nitnat's suspicion here: You're probably able to fix your savegame multiple times with this neat hack. I'm still more carefully managing my inventory now after reading all this (not using up a whole stack to save item IDs for example), but I know that should I hit the limit again/trigger a collision with a protected body part, I can try again. Probably won't happen as I'm almost done with this save, but nice to know in any case.