Bay 12 Games Forum

Please login or register.

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

Author Topic: DFHack 50.14-r1.1  (Read 892073 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

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2452 on: July 04, 2020, 07:24:36 pm »

Well went and ponder what happens if dfhack did mess with the farmer workshop and discovered yeah you can mess with the general ref of the Milkee's unit id for that job, which lets you drag anyone over to the farmer workshop.

the kicker to this is uhh if they aren't fit via the raws to produce stuff they will produce nothing even though they got dragged over there. but there's something else to this you can re-target the same cattle again and constantly get resources from them.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2453 on: July 04, 2020, 11:33:31 pm »

@Rumrusher
But will you fulfill the late DerMeister's dreams of a plugin for milkable ogresses?
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2454 on: July 05, 2020, 05:18:25 am »

@Rumrusher
But will you fulfill the late DerMeister's dreams of a plugin for milkable ogresses?
i just got done with repeatedly milking a sheep, and realizing no you can't just toggle the milkable enemy caste flag on folks
like I Was thinking 'oh hey can I use this one job reaction to say harvest bone from someone or blood. does it have to be milk?'  and so far it seems like 'yeah it totally does there nothing in the unit data that controls what body part is milk or not' and I think it's tied to the raws which also ....
fake edit : I just look in the extract section in the creature caste and notice that's where the milkable material section is. I'm tired but combination of messing with the milker's jobs to target who ever you wanted to be milked, with the combination of either Making a mod where you set up the milkee or dfhacking the milkee's caste extract to a material so the game will produce something and or making a milk material for the milkee

so far having got a farmer market to milk blood from a god sheep I'm pretty much done on this as I do not want to pursuit this mess any further at best I can direct you to the gm-editor command lines I used to mess with this .
Code: [Select]
gui/gm-editor df.global.world.nemesis.all[milker nemesis id here].unit.job.current_job.general_refs
- this here is where you can edit the job of the unit hopefully you wrote a script that inserts a milking job for them so that they go do this but if you haven't you probably need to insert "general_ref_unit_milkeest" in the job's general ref section after the general ref of the building and worker. other wise you just edit the job's milkee unit id before the worker grabs the default milkee-

gui/gm-editor df.global.world.raws.creatures.all[insert milkees creature id here].caste[the caste id of the milkee here].extracts

-and here is where you need to fill out which material do you want to have this creature extracting if you already have a creature with raw mods set for this you can skip this step for others uhh you need to edit the materials of the creature's raws to have a liquid that you can produce... or this just grabs any raws and makes it work regardless either way this is needed to produce stuff or else the stuff above will be getting nothing-



and like given messing with creature raws resets the changes after saving and or exiting the save this idea just seems like you need to run the script every time you want to do this or some complex auto fort mode triggers tied to an custom modded in workshop reaction that edits the milking job or something.

man do hope the next dfhack project I do at least involves adventure mode and or is fun.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2455 on: July 05, 2020, 05:29:48 am »

The Armok dream of producing barrels of blood can finally be made true...

Interesting results from a theoretical point of view. Gremlin tears, dwarf sweat, barrels of venom, ...
Now you just have to figure out how to extract the really interesting substances produced by FBs (and some of the new experiments).
What about scraping contaminants from dwarf boot soles?
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2456 on: July 05, 2020, 02:12:46 pm »

You certainly could fairly easily combine a few things and create a script that allows you to extract blood, tears, pus, etc... You could even have it set up like the gui/create-item script where you select an extractor, an extractee, and the material to extract. You could also turn it into a more automated thing by creating reactions for extracting blood and such, and then tie the script into those reactions so that they functions similarly to how the milking reaction goes.
Logged

Iä! RIAKTOR!

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2457 on: July 06, 2020, 04:54:04 am »

You certainly could fairly easily combine a few things and create a script that allows you to extract blood, tears, pus, etc... You could even have it set up like the gui/create-item script where you select an extractor, an extractee, and the material to extract. You could also turn it into a more automated thing by creating reactions for extracting blood and such, and then tie the script into those reactions so that they functions similarly to how the milking reaction goes.
How make script and reactions for this script?
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2458 on: July 06, 2020, 11:48:59 am »

You certainly could fairly easily combine a few things and create a script that allows you to extract blood, tears, pus, etc... You could even have it set up like the gui/create-item script where you select an extractor, an extractee, and the material to extract. You could also turn it into a more automated thing by creating reactions for extracting blood and such, and then tie the script into those reactions so that they functions similarly to how the milking reaction goes.
How make script and reactions for this script?

You would need to combine the work that Rumrusher did with a heavily modified create-item script. You could also use the reaction-trigger hooks to set up a script, that would probably be more work, but also more configurable.

If you were asking if someone would make the script for you, probably not, as it is probably not of a lot of interest to most of the people that routinely write scripts. But it would be a great exercise for you to learn how to write scripts.
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2459 on: July 06, 2020, 08:36:18 pm »

You certainly could fairly easily combine a few things and create a script that allows you to extract blood, tears, pus, etc... You could even have it set up like the gui/create-item script where you select an extractor, an extractee, and the material to extract. You could also turn it into a more automated thing by creating reactions for extracting blood and such, and then tie the script into those reactions so that they functions similarly to how the milking reaction goes.
How make script and reactions for this script?

You would need to combine the work that Rumrusher did with a heavily modified create-item script. You could also use the reaction-trigger hooks to set up a script, that would probably be more work, but also more configurable.

If you were asking if someone would make the script for you, probably not, as it is probably not of a lot of interest to most of the people that routinely write scripts. But it would be a great exercise for you to learn how to write scripts.
the work I did mostly discovered you could probably set the extract material to anything of that creature's material, though this does mean you could end up with milked flesh.

also trying to get this to work in adv fort just made me realize how much of an headache getting jobs to work in adv fort vs just assigning said job to an non playable adventurer or Adventurer party member.
so far the only result I got from this is getting a designated campsite inhabitant to drag one of my adventurers off their mount to the farmer's workshop but unable to finish the job so they are just continuing dragging this adventurer around.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes
Pages: 1 ... 162 163 [164] 165 166 ... 244