Jump to content

[TIP] How to manually change own character's name [Hex Editing]


Raziel23x
 Share

Recommended Posts

Original post https://steamcommunity.com/app/892970/discussions/1/3180111158759391483/

How to change a character's name in current game's state?

You'll need a hex editor. If you don't know what this is, or are reluctant to use it on a save file, then this post can't help you. It's best to wait for the functionality to be added to the game.

1. Save your worlds and characters save files

On Windows, they are found in:
C:\Users\ <username> \AppData\LocalLow\IronGate\Valheim

On Linux, they may be found in:
/home/ <username> /.config/unity3d/IronGate/Valheim

You don't need to save all the files in \characters\ and \worlds\ folders, but it won't harm if you do. We are going to edit <your_character>.fch and <your_world>.db (or more worlds).

2.Preliminaries

2.1 Start the game with your character you want to change the name of.

2.2 Build a bed and reclaim it.

2.3 Disconnect.

2.4 Reconnect and destroy the bed.

2.5 Empty the inventory (better in chests, I guess).

2.6 Quit game.


Note on 2:
None of these operations is mandatory, I believe.
Note on 2.5:
It allows to make things cleaner or simpler (see below).
Note on 2.2 - 2.4:
It looks dumb, but I had a strange bug during my test. Newly named character kept respawning inside claimed bed in loop with Unity generating errors, when I changed name's length. I had to destroy the bed using old character (that is same character with old name), and then new character (that is same character with new name) could spawn at the place where the bed was (whereas another character with same length name just spawns at former character's location as usual when you reconnect).
In short, I sure messed something, but that shouldn't prevent you from trying, if you saved your files somewhere, as asked above.
If you feel bold, and forecasting this might occur, I suggest that you bring your character near current claimed bed, and skip 2.2 to 2.4. In case the weird bug occurs, then you'll use this character to hammer the bed, as I did.

3. Change your character's name

3.1 Open your character's save file < your_character >.fch in \characters\ folder, using an hexadecimal editor.

3.2 Search for character string (or text) < old_name > (for example "Thorgard"). There will be only one occurrence because you emptied the inventory.

3.3 Look closely at this name. It is preceeded by a leading dot character, and followed by a trailing dot character, but both of them are important, that is they have non-zero hexadecimal values, as you can see on the left panel where hexadecimal values are displayed.
Leading dot corresponds name's length coded in two bytes (for example "08" for "Thorgard", which is 8 characters long).

3.4 Now, we will change your character's name.
3.4.1 In case new name has same length as old name (for example: change "Thorgard" into "Isildana", 8 characters each): stay or switch to Overwrite mode (OVR). Click on first letter in text panel and change the name letter for letter. Check that trailing dot still has the same hexadecimal value as before. Done.
3.4.2 In case new name has a different length as old name (for example: change "Thorgard" into "Isildanara", now 10 characters long): stay or switch to Overwrite mode (OVR). Click on name's first letter and start changing the name letter for letter. Do not overwrite trailing dot! Instead, when cursor is on it (or just before it), switch to Insert mode (INS) and insert the new name's last letters. Switch back to Overwrite mode. Check that trailing dot still has the same hexadecimal value as before. Click on leading (not trailing) dot and locate what hexadecimal value it corresponds. Click on this value (in Overwrite mod) and replace it with the new hexadecimal value corresponding the new name. For example, replace "08" (for "Thorgard") with "0A" (for "Isildanara"), as 0A is 10 in hexadecimal. Done.

3.5 Save file as < the_name_you_want>.fch


Note on 3.2:
Don't worry in case you didn't, there will be more occurrences, but apparently, only first one is important (read: I don't know what the others are for, as I could use any item in inventory; I don't know if it some ownership).
Note on 3.3:
I advise that you take note on paper of the hexadecimal values of the few trailing characters after the name, including first trailing character that is a dot (just in case you mistakenly overwrite them). Exact number of hexadecimal value you take note of shall depend on your level of confidence.
Note on 3.4:
Sorry, if you are used to hex editors, this was surely painful to read.
Note on 3.5:
File name appear to not be important, but I'd advise to follow game's logic and name it according to character's name, hence: < new_character_name >.fch

4. Rename your beds

4.1 Open your world's save file < your_world >.db in \worlds\ folder, using an hexadecimal editor.

4.2 Search for character string (or text) < old_name > (for example "Thorgard"). There will be only one occurrence if you have only built one bed. Most probably, there will be a lot of occurences.

4.3 For each occurence, just follow instructions in 3.4. Leading dot still corresponds name's length.

4.4 Once done, save the file under the same name.


Note on 4:
The process is basically the same as for changing the name in character's save file.
Apparently, renaming beds is not necessary to actually use them. Beds are probably linked to character by some reference, and we changed only names.
Note on 4.1:
This operation is to be done with each world you have beds in. Perhaps it is necessary to also do it for any item that displays an ownership, but I don't know as I don't use any of them at the moment (wards?). Anyway, you are going to change every occurrence of old name.
Note on 4.3:
I tested with a pretty new character that had only built one bed, so it was easy to change one name in the world file (same work as for changing naked character's name in character file). Now, if there are a lot occurences in the world file, you can use a "Search & Replace All" order on hexadecimal values (to include the new length bytes), but do it only if you know what you are doing.


5. Testing

5.1 Start the game, and select the new (naked) character who is available.

5.2 Check that there is no issue with the spawning.

5.3 Retrieve your inventory in nearby chests.

5.4 Disconnect if you want a save right now, or keep playing.


Note on 5:
Remember that old name character is still available (although naked as well), and ready to be used in case you need to "free" the newborn character.
After a while, you can delete the old name character files, because you saved them elsewhere, anyway.

Edited by Raziel23x
Link to comment
Share on other sites

  • Raziel23x changed the title to [TIP] How to manually change own character's name [Hex Editing]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...