Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Hungrier Dwarves (and others)  (Read 1264 times)

Bogus

  • Bay Watcher
    • View Profile
Hungrier Dwarves (and others)
« on: March 24, 2016, 02:17:47 pm »

Im writing a simple script to make members of the fort eat/drink more. what it does is that it browses through all units with the right civ_id
every few ticks and then increments the counters.

now the thing is, the list of active units with civ_id being the fortress civ includes a lot of random stuff. my fortress with 101 residents and 119 pets has 265 units that belong to my civ for some reason or another. what flag(s) in the unit struct can i use to distinguish eaters (dwarves and foreign residents only) from non-eaters (pets/ghosts/..) ?
« Last Edit: March 24, 2016, 02:20:51 pm by Bogus »
Logged

Bogus

  • Bay Watcher
    • View Profile
Re: Hungrier Dwarves (and others)
« Reply #1 on: March 24, 2016, 03:14:59 pm »

i got the result i wanted by checking for changes in the thirst counter, as only residents seem to be drinking. so this works well except its a bit of extra checking.

ill post the code below, you can just drop this into your hack/scripts folder and run it through your dfhack.init or from the dfhack console. it should automatically enable when a fortress game is loaded.

the default is 4/2 times as much consumption for food/drink respectivly. if you want to change that, just tinker with the factor variables.

Spoiler (click to show/hide)
« Last Edit: March 25, 2016, 03:32:05 pm by Bogus »
Logged

Teneb

  • Bay Watcher
  • (they/them) Penguin rebellion
    • View Profile
Re: Hungrier Dwarves (and others)
« Reply #2 on: March 24, 2016, 03:42:52 pm »

You should take this to the DFHack thread (or at least sub-board), since, y'know, its a script for it.
Logged
Monstrous Manual: D&D in DF
Quote from: Tack
What if “slammed in the ass by dead philosophers” is actually the thing which will progress our culture to the next step?