Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 208 209 [210] 211 212 ... 360

Author Topic: DFHack 0.43.03-r1  (Read 1123189 times)

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3135 on: September 21, 2015, 09:20:43 am »

Are there any scripts out there that modify the hunger rates for Dwarves?
If not, could someone direct me toward making one?

I do not know of any.
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3136 on: September 21, 2015, 10:39:40 am »

Wait hunger like the counter or hunger like how fast they get hungry, didn't it get discovered that recuperation influences that?

the gui/gm-unit.lua can do the counters as I recall, I've been meaning to add an attribute editor to it since it should be pretty straightforward to just point the same layout as the skill section towards the body.attributes and status.current_soul.mental_attributes instead of status.current_soul.skills with the appropriately renamed sections and value displays swapped in.

Keep thinking about how to translate the list of stuff in appearance.bp_modifiers into a cromulent list for editing and getting distracted from the much easier attributes idea.
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3137 on: September 21, 2015, 12:15:43 pm »

So you guys wanted monsters to attack other people? I finally found how to do it (in my work for arena building).

So there is this thing called "enemy_status_cache". Like name implies it's only used for enemies (or at least my testing showed that). Combined with "unit.enemy.enemy_status_slot" you can figure out what is "relation" between two units. Here's a small script that i used for testing:
Spoiler (click to show/hide)

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3138 on: September 21, 2015, 12:23:39 pm »

Thanks Warmist!  I will test this out when I get a chance (which unfortunately might not be for several days).

Do you need to induce a first blow between the units, or can you specify which one throws the first punch?
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3139 on: September 21, 2015, 02:21:59 pm »

Thanks Warmist!  I will test this out when I get a chance (which unfortunately might not be for several days).

Do you need to induce a first blow between the units, or can you specify which one throws the first punch?
You can probably set one to be angry at another and the other be friendly (till he gets hit?)
Also found some research on these values: here

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3140 on: September 21, 2015, 03:14:38 pm »

Thanks Warmist!  I will test this out when I get a chance (which unfortunately might not be for several days).

Do you need to induce a first blow between the units, or can you specify which one throws the first punch?
You can probably set one to be angry at another and the other be friendly (till he gets hit?)
Also found some research on these values: here
The context would be a newly spawned unit 0 or 1 tiles away from a fort citizen, and the mod logic determines that the newly spawned unit is supposed to be "hostile" but not berserk.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Nazushvel

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3141 on: September 22, 2015, 01:47:16 pm »

I've been working on identifying the different variables under bp_modifiers for a utility I'm working on. Is there a place where I can document this in the dfhack or dfstructures repo? Thanks!
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3142 on: September 22, 2015, 02:34:37 pm »

Clone a version of df-structures and assign the variable values/names under the unit.appearance entries?

Once you get them worked out or even just worked out as far as you can, submit a pull request, and thank you for working on that too. I've got some idea of them. I know the bottom 20 or so are skin wrinkles, there is a chunk of 5 with the same values for teeth spacing, the hair lengths are a chunk of 2 pairs and 2 more which match the values under tissue_length, and then there are a few more for like nose straightness/size that I don't know as well.
« Last Edit: September 22, 2015, 02:36:36 pm by Max™ »
Logged

Nazushvel

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3143 on: September 22, 2015, 04:07:50 pm »

Gotcha. I am confident I know what all of the bp_modifier values do, as well as the values for tissue styles. I'll try to figure out how to add these values correctly...the XML structure is very confusing to me. I'm completely unfamiliar with C++ and Lisp, and I just dived into Lua for this project.
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3144 on: September 22, 2015, 04:26:27 pm »

Is there a straightforward way to determine the "type" of an object, for example differentiating between a trap and a workshop?  The type() operator just says "userdata".

It turns out that a building ID can refer to things other than a workshop, and referencing a workshop-only field crashes Lua.  As a stopgap, I filtered on construction_stage 3 and no design quality... but getting the actual object type would be preferable.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3145 on: September 22, 2015, 04:29:48 pm »

Try object._type (type() is a function, by the way, which will return "userdata" for anything that isn't a basic Lua type).
What exactly are you doing in Lua that causes a crash? For example, "custom_type" is a field specific to workshops, but "df.building_trapst:new().custom_type" doesn't crash.
« Last Edit: September 22, 2015, 04:32:42 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.

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3146 on: September 22, 2015, 04:30:08 pm »

Dirst: I think that would require run-time type information, which Toady does not have enabled.
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3147 on: September 22, 2015, 05:08:56 pm »

I had hooked into job completion and checked for job type 68, which is constructing a building.  I was checking the building to see if it was relevant to the mod's logic, but referenced a field (custom_type) that doesn't exist for traps.  I suspect bridges might be a problem too, so the current screen is a new building, construction_stage == 3, and design == nil.  Those should exist for any building... I hope.

Edit: a "capture" or "on error" structure would work, too.
« Last Edit: September 22, 2015, 05:12:12 pm by Dirst »
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #3148 on: September 22, 2015, 05:10:40 pm »

Dirst: I think that would require run-time type information, which Toady does not have enabled.
Yeah, that's exactly what I wanted.  Can't have everything I suppose.

Thanks for the help guys!
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: DFHack 0.40.24-r3
« Reply #3149 on: September 22, 2015, 05:54:07 pm »

Dirst: I think that would require run-time type information, which Toady does not have enabled.
Yeah, that's exactly what I wanted.  Can't have everything I suppose.

Thanks for the help guys!

Don't know why expwnent said that, since game types are known to us. You can use df.is_instance(df.building_workshopst,your_building).
(your_building._type == df.building_workshopst) will work too in your case, but is_instance handles subclasses as well.
Pages: 1 ... 208 209 [210] 211 212 ... 360