Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Util: List dwarf skills  (Read 1035 times)

Zhentar

  • Bay Watcher
    • View Profile
Util: List dwarf skills
« on: April 22, 2007, 07:42:00 pm »

I posted v.1 a little while back in the save format thread, but I doubt most people saw it there. But, I've made a lot of improvements making v.2 much more useable and useful, so I'm posting it here where more people will notice.

Download link: http://zhentar.mccambridge.org/DwarfSkills.zip

Description/Instructions (All this is in the readme):
DwarfSkills is a utility that reads the memory of Dwarf Fortress v0.23.130.23a to give a convenient listing of the skill levels of the dwarves in your fortress.

The program filters out all dwarves that do not perform work (most nobles, babies). This does not include children, because children can have strange moods and thus gain skills.

How to install:
Unzip DwarfSkills.exe to the root Dwarf Fortress folder.

DwarfSkills requires the language_DWARF.txt and language_words.txt files in raw/objects/ to decode surnames. The path is hardcoded, so the program can actually be run from any folder that has those two files in raw/objects subfolders.
If DwarfSkills cannot find these two files, it will crash. (Huh, maybe I should add error checking?)

How to run:
There are three options for running DwarfSkills:

1.) Run the exe by double clicking, or however else you choose. If it successfully finds everything it needs, it will open or create DwarfSkills.csv then delete any contents, and write out the dwarf skills.

2.) Run the exe from the console, or however else you choose, and provide a filename as the first parameter. An extension of .csv is recommended. It will attempt to open this file and if successful, append the dwarf skills on the end of it.


3.) Print Dead dwarves: Run the exe from the console, or however else you choose, and provide a filename as the first parameter. Put anything in the second parameter, and it will act as option two except it will print the skills of dead dwarves instead of the living ones.

If it cannot open the file for output, for whatever reason (probably because it's opened by another program, i.e. excel), it will dump the output to the console. This will probably be fantastically unreadable.

Finally, open the file created in the spreadsheet viewer of your choice, as a comma seperated values file (if the extension is .csv, this should be automatic). There's the list!


Notes:
Is it safe?
Yes. Right now, my program has very little error checking, so there are many possible problems in which it will crash instead of exiting gracefully. But, since it only reads from DF's memory, and does not write to it, none of this will harm your Dwarf Fortress game. You should still backup saves though, because that's always a good idea.

Known problems:
-Dwarf Fortress doesn't use the same character encoding as windows/Excel default to. This means some of the special characters in dwarf names don't come out right. I'll fix it, some day.
-It uses hardcoded values for a few memory locations needed. These are always right in worlds made with the current version with the standard creature list. Otherwise, it might not. Emphasis on the might though, and it's safe even if it's wrong, so give it a try anyways; it could still work right.

Logged