Renaming a character?


Problems running or configuring the software, commands & options, compiling, different platforms, using the interface, documentation, etc.

Dungeon Dilettante

Posts: 2

Joined: Monday, 1st June 2015, 22:05

Post Monday, 1st June 2015, 22:07

Renaming a character?

Hi,
Is it possible to rename a character? I've looked through the help, FAQ, this site, etc. Nothing in the wiki either. Or is there a .cs file editor I could use to change my character's name?

Thanks,
John
User avatar

Blades Runner

Posts: 614

Joined: Tuesday, 31st December 2013, 19:51

Post Tuesday, 2nd June 2015, 11:36

Re: Renaming a character?

Just kill off this one and name your new character properly.
114491 | Pan | Entered the realm of Gloorx Vloq.
114491 | Pan | Noticed Gloorx Vloq
114492 | Pan | Killed Gloorx Vloq

true lords of shadow NEVER sleep
User avatar

Dungeon Master

Posts: 502

Joined: Wednesday, 7th March 2012, 13:25

Location: Lexington, KY, US

Post Tuesday, 2nd June 2015, 17:47

Re: Renaming a character?

l8gravely wrote:Hi,
Is it possible to rename a character? I've looked through the help, FAQ, this site, etc. Nothing in the wiki either. Or is there a .cs file editor I could use to change my character's name?


At the moment you need a combination of crawl command line options, and a hex editor (vim -b will work, but you MUST use binary mode or it will screw up the file).

  1. MAKE A BACKUP OF YOUR SAVE FIRST!
  2. Extract the character chunk from your save. This contains information about your character that is displayed in the save browser, which includes the character name.
      Code:
    crawl -edit-save filename.cs get chr char.chunk
  3. Now hex-edit the resulting char.chunk file. The name starts at offset 9 (counting from 0). Edit this. It is easiest if the new name has the same length, but you can insert or delete characters (shifting everything that follows) if necessary.
  4. If the new and old names are different lengths, you need to update the name's length (offsets 7+8, big endian so you probably only need to change the second byte) and the chunk's length header (offsets 2-5, but again you probably only need to change the last byte). So, if your new name is two characters longer than your old name, you will add 2 the the value of bytes 5 and 8. You might also want to verify that the size of the resulting chunk file is 6 greater than the value of byte 5.
  5. Stuff the chunk back into your save.
      Code:
    crawl -edit-save filename.cs put chr char.chunk
  6. Optionally rename the .cs file, so crawl -name newname will know where to find it. It should show up in the save browser either way.

For this message the author neil has received thanks: 5
and into, jason0320, l8gravely, MrDizzy, rockygargoyle

Dungeon Dilettante

Posts: 2

Joined: Monday, 1st June 2015, 22:05

Post Friday, 5th June 2015, 11:38

Re: Renaming a character?

Wow, thanks for the detailed info on how to do it! I suspect letting my character die is the simpler step right now, next would be to actually write a tool to do the editing for me instead of all the by hand hex edits. But I'll certainly keep this in mind!
John

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 8 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.