Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: i wsih to edit my forts name  (Read 1036 times)

jaxler

  • Bay Watcher
  • thats not a red mage...
    • View Profile
i wsih to edit my forts name
« on: November 21, 2011, 09:57:03 pm »

i want to edit my fortes name through save files but how.
Logged
I've decided to say "fuck it" and will just implode my fort.

“Ok, Neo ChosenUrist, before you is two levers. Pull the Kimberlite lever -- you wakeup in a random bed and have whatever thoughts you want to think. You pull the Bauxite lever -- you stay in the caverns and I show you how deep the adamantine hole goes.” - psalms

Grumbledwarfskin

  • Bay Watcher
  • stilts don't have skin
    • View Profile
Re: i wsih to edit my forts name
« Reply #1 on: November 21, 2011, 11:26:43 pm »

I'm pretty sure that the answer to this one is that nobody knows the save file format, so it may not be possible. You can edit the raws of your save after creating it, and some of those raw changes will have an effect on the game, but your fort's name isn't stored in an easily edited file in the save.

I suppose you could uncompress the save and search for your fort's name with a hex editor, and test whether editing it manually works, but I've no idea how likely you are to succeed there. It could appear once, or dozens of times, and there's a chance that not all of those times are specifically references to your fort. There's even a chance it won't appear at all, if it's stored in a strange format, or perhaps as references to an array that holds the dwarven dictionary.
Logged

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: i wsih to edit my forts name
« Reply #2 on: November 22, 2011, 01:08:48 pm »

You can do this by editing the raws. Say you had a fortress called Somethingworked, and you wanted to change that last part. You'd need to go into language_DWARF.txt and language_words.txt, and alter the bolded parts of the following entries. (Square brackets changed to curly ones for formatting reasons.)

language_words.txt
{WORD:WORK}
   {NOUN:work:works}
      {FRONT_COMPOUND_NOUN_SING}
      {REAR_COMPOUND_NOUN_SING}
      {THE_COMPOUND_NOUN_SING}
      {THE_NOUN_SING}
      {OF_NOUN_SING}
      {REAR_COMPOUND_NOUN_PLUR}
      {THE_COMPOUND_NOUN_PLUR}
      {THE_NOUN_PLUR}
   {VERB:work:works:worked:worked:working}
      {STANDARD_VERB}

language_DWARF.txt
   {T_WORD:WORK:ducim}

These changes will be applied to everything called 'worked' or 'ducim'. You'd only actually need to alter whichever 'worked' the fortress name was actually using, but you're not going to know which it is unless you made a note pre-embark or change one and then load to see the results.
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: i wsih to edit my forts name
« Reply #3 on: November 22, 2011, 01:23:55 pm »

It is in fact fairly impossible to change the actual translated name of your fort however. If your fort was "TannedShips", then it will always be "TannedShips", regardless of what you do to the dwarven language. Of course if you really wanted to you could simply regen the world and embark at the same location with a different name but that is about it.
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: i wsih to edit my forts name
« Reply #4 on: November 22, 2011, 02:25:23 pm »

If your fort was "TannedShips", then it will always be "TannedShips", regardless of what you do to the dwarven language.
The non-English languages aren't the only ones you can edit.
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: i wsih to edit my forts name
« Reply #5 on: November 22, 2011, 08:06:14 pm »

It might be possible to use DFHack to edit the fortress's name within the game's memory (after locating the offsets, anyways).
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: i wsih to edit my forts name
« Reply #6 on: November 23, 2011, 12:48:05 pm »

Here is an upload of two embarks. The name change doesn't work on the dwarven name displayed on the load screen (you can always rename the save folder and use that for identification), but it changes the in-game display. There have currently been no opportunities for the fortress name to be displayed outside the status screen, but renaming a dwarf using this method and having them engrave something brings up the altered dwarven name in the engraving's description screen, and their description screen displays the altered translated name.

It works okay as long as you don't care about the load screen or anything using the seven or fewer words the fortress name does. A hack would certainly be neater though, especially if your name change results in some very odd dwarven titles.
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: i wsih to edit my forts name
« Reply #7 on: November 23, 2011, 02:16:02 pm »

After a bit of searching, I managed to find the data structure that stores the name of your fortress. Trouble is, I can't trace that pointer back to a static address, so I can't write a tool for editing it. If you've got a memory editing tool (such as Cheat Engine), then it should be possible to change your fortress name that way - you'll need to figure out the word ID numbers for your current fortress name (by looking them up in language_words.txt - e.g. Releasetreaty -> 1541 [RELEASE] and 915 [TREATY]), then search for two consecutive 32-bit integers having those values (in this case, 0x00000605 and 0x00000393, giving the byte array "05 06 00 00 93 03 00 00"), then change those numbers to what you want your fortress to be called. Note that this won't change the parts of speech for the English translation, so if you replace a noun-only word with a verb-only word it'll display nothing (I don't recall how/where that info is defined). Also, if there are multiple instances of this, you'll probably want to change all of them in the same way.

This information is also stored in world.sav, but it's located at an unpredictable address (the fort's Dwarven name is stored as a string near the beginning, but that's only a cached copy that gets ignored once you actually load the world and overwritten once you save again).
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.