Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: dfhack 34.11 - how do I figure out a dwarfs unit id?  (Read 10817 times)

Finn

  • Bay Watcher
    • View Profile
dfhack 34.11 - how do I figure out a dwarfs unit id?
« on: October 20, 2015, 11:57:21 pm »

I've found a lua script on the web which will allow me to marry two dwarfs, however I am supposed to pass it a unit id.  My search-fu is not revealing to me how to find a dwarf's unit id.  Can anyone tell me?
Logged
I thought 'complained about the draft lately' meant they didn't have a door to their room.

Finn

  • Bay Watcher
    • View Profile
Re: dfhack 34.11 - how do I figure out a dwarfs unit id?
« Reply #1 on: October 21, 2015, 12:14:56 am »

Answer:  LUA and the command "print(dfhack.gui.getSelectedUnit().id) works.
Logged
I thought 'complained about the draft lately' meant they didn't have a door to their room.

Honalululand

  • Bay Watcher
    • View Profile
Re: dfhack 34.11 - how do I figure out a dwarfs unit id?
« Reply #2 on: October 29, 2015, 12:08:27 pm »

I usually use the CPROBE command.
Logged

Prester

  • Bay Watcher
    • View Profile
Re: dfhack 34.11 - how do I figure out a dwarfs unit id?
« Reply #3 on: August 14, 2017, 06:27:22 am »

Answer:  LUA and the command "print(dfhack.gui.getSelectedUnit().id) works.


sorry for reviving this thread but it asks what i also need to know:

Can someone explain to me what this means? first of all what is LUA, where do i type this stuff? in the df-console or somewhere ingame or what? please help ;-/

im trying to revive dead goblins in an attempt to end the infinite-siege-tag bug but cannot select them so i need their unit ids
« Last Edit: August 14, 2017, 06:31:27 am by Prester »
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: dfhack 34.11 - how do I figure out a dwarfs unit id?
« Reply #4 on: August 14, 2017, 08:31:21 am »

First off, it's not LUA. It's Lua.

You need to run the command "lua" to enter the Lua interpreter, followed by "print(dfhack.gui.getSelectedUnit().id)", then "quit" if you want to get back to the DFHack console.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Prester

  • Bay Watcher
    • View Profile
Re: dfhack 34.11 - how do I figure out a dwarfs unit id?
« Reply #5 on: August 14, 2017, 01:49:06 pm »

First off, it's not LUA. It's Lua.

You need to run the command "lua" to enter the Lua interpreter, followed by "print(dfhack.gui.getSelectedUnit().id)", then "quit" if you want to get back to the DFHack console.

thanks.

now there is still the problem of dead units not being selectable and finding out the unitIDs of dead enemies
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: dfhack 34.11 - how do I figure out a dwarfs unit id?
« Reply #6 on: August 14, 2017, 02:07:56 pm »

Select them in the 'u'nits list (you don't have to select them in the map for that to work).

Edit: from another thread:

but thats the thing, how do i find out unit ids if i CANNOT select them? thanks

Are you saying that they don't appear in the units list? Are you in the "dead units" tab? It sounded like you were trying to select them in the map earlier.
« Last Edit: August 14, 2017, 02:10:01 pm by lethosor »
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.