Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Can you change the names of squads by editing game files?  (Read 817 times)

JBlak

  • Bay Watcher
  • The Game.
    • View Profile
Can you change the names of squads by editing game files?
« on: October 04, 2011, 07:45:20 am »

I'm tired of my badass hammerlords being called The Adequate Windmills or something. I want to change it into something more intuitive like The Hammers of Time.
Logged
Shimbilagak

Askot Bokbondeler

  • Bay Watcher
  • please line up orderly
    • View Profile
Re: Can you change the names of squads by editing game files?
« Reply #1 on: October 04, 2011, 08:04:30 am »

create bunches of empty squads and place those weaponlords in the most fittingly named ones. i'm not sure what you want is possible

khearn

  • Bay Watcher
    • View Profile
Re: Can you change the names of squads by editing game files?
« Reply #2 on: October 04, 2011, 11:35:41 am »

A quick look at the files in my save folders seems to show that (except for the raws) they are in a binary format. I just tried grepping for the names of my current squads in the .dat files and nothing came up, so the names aren't even saved as regular strings. So it looks like it would be non-trivial to change them. This is on a Linux system, but I suspect the save ormat is going to be the same on any OS.

When I create a new squad, I always look at the name, and if it's something lame like "The Fluffers of Pillows" I just delete the squad and create it again. It gets a new name each time, so you can just keep trying until something decent comes up.

Logged
Have them killed. Nothing solves a problem quite as effectively as simply having it killed.

Necro910

  • Bay Watcher
  • Legendary Drunk +5
    • View Profile
Re: Can you change the names of squads by editing game files?
« Reply #3 on: October 04, 2011, 11:48:24 am »

A quick look at the files in my save folders seems to show that (except for the raws) they are in a binary format. I just tried grepping for the names of my current squads in the .dat files and nothing came up, so the names aren't even saved as regular strings. So it looks like it would be non-trivial to change them. This is on a Linux system, but I suspect the save ormat is going to be the same on any OS.

When I create a new squad, I always look at the name, and if it's something lame like "The Fluffers of Pillows" I just delete the squad and create it again. It gets a new name each time, so you can just keep trying until something decent comes up.
Goblin Swordsman: Ok, we're going to go through this conveniently placed corridor, and...
Goblin Lasher: OH GOD! THE FLUFFERS OF PILLOWS ARE HERE! RUN FOR YOUR LIVES!
Goblin Axeman: OH GARLEGAOVMAOUVEUOAFN! RUNNNNN! QUICKLY MEN, RUN AROUND IN CIRCLES AND THROUGH THE CORRIDOR!
Goblin Everyone: burgle burgle

Varnifane

  • Bay Watcher
    • View Profile
Re: Can you change the names of squads by editing game files?
« Reply #4 on: October 04, 2011, 11:54:16 am »

I currently have a squad of hammerdwarves named The Green Oils; which I thought was odd until I realized that is what they made every time the goblins sieged.
Logged
I regret to inform the community that the mass murder of puppies does not create a viable clock.
I don't know if you need other ideas when you have magma.

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: Can you change the names of squads by editing game files?
« Reply #5 on: October 04, 2011, 01:48:21 pm »

There's an init option to "uncompress saves" or such.  Apparently, when people do this, it reveals the raws for FB, HFS, and explores a lot of otherwise unavailable world data.  I haven't dabbled with this yet, but that seems like your best option.

Blue_Dwarf

  • Bay Watcher
    • View Profile
Re: Can you change the names of squads by editing game files?
« Reply #6 on: October 11, 2011, 11:42:49 am »

create bunches of empty squads and place those weaponlords in the most fittingly named ones. i'm not sure what you want is possible
I wish it was possible for my main squad  :'(

My main squad consists of five steel-equipped dwarfs, lead by what used to be my militia commander. The squad had an average name.

Then I created a second squad, and... it got named "The Lords of Steel". What are the chances  :D

So now the problem is that by assigning my militia commander to it, he gets downranked to captain. I guess I'll just have to assign a random dwarf to be commander  :(
Logged
Crafting Statistics 42.06Farming Statistics

Blue Dwarf has been happy lately. He did some !!science!! recently. He admired a fine forum post lately. He was enraged by a forum troll recently. He was upset by the delayed release of the new version of Dwarf Fortress lately. He took joy in planning a noble's death recently.

Satarus

  • Bay Watcher
    • View Profile
Re: Can you change the names of squads by editing game files?
« Reply #7 on: October 11, 2011, 03:23:19 pm »

I wouldn't be surprised if the names were genned from a set of pointers.  That way you can easily get the dwarven name and the english translation.  So in the game files the name might be 32,67 but we see 'Urist Olon' or 'Dagger of Gears'.
Logged
Quote
You need to make said elf leather into the most amazing work of art.  Embed it with every kind of gem you have, stud it with metals, and sew images into it.  Erect a shrine outside your fort with that in the center.  Let the elves know that you view their very skin as naught more but a medium for your dwarves to work on.

khearn

  • Bay Watcher
    • View Profile
Re: Can you change the names of squads by editing game files?
« Reply #8 on: October 11, 2011, 04:08:43 pm »

Ok, time for a little science.

I changed [COMPRESSED_SAVES:NO] in init.txt and saved, then searched for my squad names in all of the files in my data/save/region2/ directory. I had a few false positives in world.sav. I have a squad named "The Earthen Autonomy" and earthen matched, but when I looked in the file, it was earthenware. But no "earthen" (and I was ignoring case). I also have a squad named "The Labyrinthine Sacks" and I found labyrinth in world.sav, but not labyrinthine. So I searched all the files under region2/raw, and only found:
./raw/objects/language_words.txt:   [ADJ:labyrinthine]

So I suspected that Satarus is right, and the squad names are probably stored as indexes into the language_words.txt file. So I saved the game, changed "labyrinthine" in that file to "scrotum", and restarted. When I checked the military screen, I now have a squad named "The Scrotum Sacks".

So that's it. Just edit data/save/regionX/raw/objects/language_words.txt (where regionX is region1, region2, or whatever)and find the word(s) that you want to change and change them. Note that you will still be limited to same number of words. And this could have side effects if some other object in your game also has a name containing the same word(s). You could end up changing your fortress name, your group name, some dwarf's name, some soldier's title, a FB's name, or many other sorts of names.

Each word in languiage_word.txt is one or more of: ADJ, NOUN, PREFIX or VERB. For instance, the entry for labyrinth looks like:
Code: [Select]
[WORD:LABYRINTH]
        [NOUN:labyrinth:labyrinths]
                [THE_NOUN_SING]
                [OF_NOUN_PLUR]
        [ADJ:labyrinthine]
                [ADJ_DIST:5]
So a LABYRINTH as a nonun is "labyrinth" and as an adjective is "labyrinthine".
There are:
2104 WORD
785  ADJ
1684 NOUN
16 PREFIX
673 VERB

So there are lots to choose from and unexpected side effect shouldn't be too frequent. And I rather doubt they'd break anything.

You know, I'm continually impressed by the amount of depth Toady put into this game.

Logged
Have them killed. Nothing solves a problem quite as effectively as simply having it killed.

Mitchewawa

  • Bay Watcher
  • My pick is the pick that will pierce the heavens!
    • View Profile
Re: Can you change the names of squads by editing game files?
« Reply #9 on: October 11, 2011, 04:20:51 pm »

My miner/military squad got 'The Holy Tools'.

AND YAE, SO DOTH THE PICK STRIKETH THE EARTH, AND SO DOTH WE LIVE IN PROSPERITY.
Logged
Mitch cancels sleep: Interrupted by Clowns