Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Some DFHack questions w/r to createunit  (Read 1259 times)

Dame de la Licorne

  • Bay Watcher
  • Cats? Check. FPS? Uh-oh...
    • View Profile
Some DFHack questions w/r to createunit
« on: December 18, 2016, 11:03:38 am »

All,

So I've been playing around with the createunit command of DFHack, and I was wondering the following things:

1) Is there a way to make the name actually appear in the creature's language rather than English?  (E.g. If I spawn a MOUNTAIN (dwarf), the name "ROPE" appears, instead of "GODEN".  The second name appears to work fine.)

2) Is there a way to either spawn a unit with specific skills, or to retrofit a unit (e.g. a previously-spawned unit) with specific skills?  (If yes, could someone walk me through the command sequence step-by-step?)

- Dame de la Licorne
Logged
If software was real world, then it'd be something equivalent of hitting a nail with a hammer and having a building collapse on the other side of town.

Don't worry people, sometimes -moments occur

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Some DFHack questions w/r to createunit
« Reply #1 on: December 19, 2016, 11:36:08 am »

Far from a walkthrough (merely guesses), but maybe better than no answer at all:

2: It ought to be possible to use gui/gm-editor on a selected unit and edit skills and attributes in the corresponding vectors.
1: A guess is that you'd somehow need to modify the name structure (using gui/gm-editor) so it tells DF that the first name is according to the desired language, and thus that the script you used didn't do that for you.
Logged

Dame de la Licorne

  • Bay Watcher
  • Cats? Check. FPS? Uh-oh...
    • View Profile
Re: Some DFHack questions w/r to createunit
« Reply #2 on: December 19, 2016, 11:53:55 am »

Thanks, but I have no idea where to even begin for either of those.

- Dame de la Licorne
Logged
If software was real world, then it'd be something equivalent of hitting a nail with a hammer and having a building collapse on the other side of town.

Don't worry people, sometimes -moments occur

PatrikLundell

  • Bay Watcher
    • View Profile
Re: Some DFHack questions w/r to createunit
« Reply #3 on: December 19, 2016, 02:11:11 pm »

I was sort of afraid it wouldn't be useful...
I've taken it as a challenge to look at it, though. Point 1 is actually incredibly easy, as I was wrong about the language...

1.1: Select the creature with 'v'
1.2: Go to the DFHack window and type gui/gm-editor.
1.3: Hit <ENTER> when the cursor is on "name" (which it should be by default).
1.4: Hit <ENTER> again on "first_name" (again the default).
1.5: Change the text to "goden" (for some reason DF seems to introduce an initial capital letter by itself on the critters I've looked at).
1.6: Hit <ESC> a number of times to back out.

Edit:
2. is rather straightforward as well:
2.1: gui/gm-editor on 'v' selected creature (as above)
2.2: Down arrow until "status" is selected, and <ENTER>
2.3: Down arrow until "current_soul" is selected and <ENTER>
2.4: Down arrow until "skills" is selected and <ENTER>
2.5: You're now in an array of the skills. Go down into each of them with <ENTER>, edit, and back out with <ESC>
2.5.1: The first one is CARPENTRY. Down arrow to "rating" and change it to the desired one (go down the list presented and hit <ENTER>), back out, and change "experience" to match.
Skill levels:
Dabbling: 500
Novice: 600
Adequate: 700
Competent: 800
Skilled: 900
Proficient: 1000
Talented: 1100
Adept: 1200
Expert: 1300
Professional: 1400
Accomplished: 1500
Great: 1600
Master: 1700
HighMaster: 1800
GrandMaster: 1900
Legendary: 2000
Legendary1: 2100
Legendary2: 2200
Legendary3: 2300
Legendary4: 2400
Legendary5: Above.
Presumably these levels are the top of the corresponding proficiency.
2.6: <ESC> out when finished tweaking.

Note that I haven't actually tried the above. I've looked with gui/gm-editor when typing this, though. Anyway, make a backup before hacking, just in case.
« Last Edit: December 19, 2016, 02:30:01 pm by PatrikLundell »
Logged

Dame de la Licorne

  • Bay Watcher
  • Cats? Check. FPS? Uh-oh...
    • View Profile
Re: Some DFHack questions w/r to createunit
« Reply #4 on: December 19, 2016, 07:16:25 pm »

Thanks so much for looking into both of those for me!  It does look fairly straightforward, and certainly gives me a starting point for playing around.

And I learned a long time ago to make a backup when playing around with anything, let alone actively hacking.   :D

- Dame de la Licorne
Logged
If software was real world, then it'd be something equivalent of hitting a nail with a hammer and having a building collapse on the other side of town.

Don't worry people, sometimes -moments occur