Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 162 163 [164]

Author Topic: DFHack 0.47.04-r1  (Read 312093 times)

Tokeli

  • Bay Watcher
  • Oh wow, mew
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2445 on: June 30, 2020, 01:16:53 am »

I'm still unsure if this is the best place to be asking questions, but-

I've been trying to make a plugin for the embark screen and have been pretty successful, but, is there a way to access the names of the dwarves in the Prepare Carefully screen?

Checking the fields in in
Code: [Select]
dfhack.gui.getCurViewscreen().dwarf_info[0].name.has_name is false, and all the other name fields are also empty, revealing that the dwarves have no name at all. But they're there on the screen! Does anyone know where these specific names are stored before they're applied to the dwarves? I've dug through the structure files for the setupdwarfgame screen but can't find anything that leads to the mysterious intermediate names, if they're accessible at all.
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2446 on: June 30, 2020, 02:01:48 am »

df.global.world.units.all is populated by 7 creatures at that point, and the first one had a name of "kogsak" when I checked. Thus, I'm fairly sure that's where you've got your dorfs. When you enter the embark carefully screen the dorfs have been generated, with names and all.
(Dwarf Therapist can display the dorfs as well, at that point).
Logged

Clément

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2447 on: June 30, 2020, 03:54:15 am »

df.global.world.units.all is populated by 7 creatures at that point, and the first one had a name of "kogsak" when I checked. Thus, I'm fairly sure that's where you've got your dorfs. When you enter the embark carefully screen the dorfs have been generated, with names and all.
(Dwarf Therapist can display the dorfs as well, at that point).

Actually df.global.world.units.all has more than 7 creatures. I had to change Dwarf Therapist to use the view screen instead since the more units in the world were activated. But I use viewscreen_setupdwarfgamest.units instead viewscreen_setupdwarfgamest.dwarf_info.
Logged

Tokeli

  • Bay Watcher
  • Oh wow, mew
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2448 on: June 30, 2020, 05:04:57 am »

df.global.world.units.all is populated by 7 creatures at that point, and the first one had a name of "kogsak" when I checked. Thus, I'm fairly sure that's where you've got your dorfs. When you enter the embark carefully screen the dorfs have been generated, with names and all.
(Dwarf Therapist can display the dorfs as well, at that point).

Actually df.global.world.units.all has more than 7 creatures. I had to change Dwarf Therapist to use the view screen instead since the more units in the world were activated. But I use viewscreen_setupdwarfgamest.units instead viewscreen_setupdwarfgamest.dwarf_info.

HECK, I can't believe I didn't just check through the viewscreen's fields instead, the names and everything else are perfectly accessible under the units section, thank you!

Edit: Well their first name is there at least, but that's good enough!
« Last Edit: June 30, 2020, 05:08:51 am by Tokeli »
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2449 on: June 30, 2020, 12:38:34 pm »

Edit: Well their first name is there at least, but that's good enough!
If you want a human-readable version of a language_name object, you'll want dfhack.TranslateName(some_unit.name) (in Lua, anyway). Also worth mentioning: TranslateName returns a CP437-encoded string, so if you're printing these names somewhere, you should use df2utf or df2console as appropriate: https://docs.dfhack.org/en/stable/docs/Lua%20API.html#c-function-wrappers
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.

Salperticon

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2450 on: June 30, 2020, 03:33:09 pm »

While looking at the world map, I am currently trying to get an overview of the creatures available at the embark, so I can chose a location that has a certain species for my fort.
In the past, I think I used the "region-pops" command in DFHack for this. However, "region-pops list" now gives me only:

Quote
Plants:

Creatures and vermin:

There is nothing shown. What am I doing wrong? Can I only use this after embark?
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2451 on: June 30, 2020, 04:16:32 pm »

While looking at the world map, I am currently trying to get an overview of the creatures available at the embark, so I can chose a location that has a certain species for my fort.
In the past, I think I used the "region-pops" command in DFHack for this. However, "region-pops list" now gives me only:

Quote
Plants:

Creatures and vermin:

There is nothing shown. What am I doing wrong? Can I only use this after embark?
I wouldn't be surprised if the structure region-pops uses isn't populated until you embark as DF has no use for it until then. You can use the Biome Manipulator http://www.bay12forums.com/smf/index.php?topic=164658.msg7495705#msg7495705, although it's a bit more cumbersome, as you have to manually identify all regions your planned embark has, and then locate a "parent" world tile for each of those regions (basically embark world tile some of the 8 surrounding ones). On the other hand you can add desired creatures with it.
Logged
Pages: 1 ... 162 163 [164]