Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 56 57 [58] 59 60 61

Author Topic: [SUGGESTIONS] for DFhack plugins  (Read 143404 times)

FantasticDorf

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #855 on: October 29, 2016, 07:42:39 pm »

They're not the same value. Why do you think they're the same value?

Also, intelligent creatures don't show emotions in dwarf mode unless they're citizens, not just intelligent, so the GUI argument sort of falls flat there, too.

Also, "where it pools into" isn't quite right; these structures are part of larger structures but that doesn't mean their behavior is inextricably linked with said larger structures. Just because unit.status.current_soul.emotions[0] is an emotion contained within unit doesn't mean that unit.animal.vanish_countdown is going to do anything to said emotion.

Because as how I understand it population id in the world data wouldn't work without it, since it needs to read sites in addition to settled areas, creatures that are non-site native are disallowed from leaving and to properly count everything living in every tile across all regions (without having $populationg.reg have anything to do with it) despite screwily as Quietust points out with innacuracies, population_id is already claimed  by entity_population at df.history.xml#L340 though the actual population id is marked as 'idx' which im unsure if thats applicable to any code rules.

But intelligent non-citizens (semi intelligent and animal observably) do (or alternatively looking at it, they emulate as non fortress faction citizen units), one such way to provoke a emotional response is to restraint chain for a extended period of time.

Certain individual creatures will become depressed and express emotional states, even the wild animals do the same (personality facets to each creature?), though mostly you can trigger anxiety emotions more easily in animals by exposing [BENIGN] tamed units to predatory wild units with historical names (which are then ignored by local site populations in fighting, though that might be related to my ethic setup, which has its own bug report here about wild creatures only respecting site entity ethical morale engagement rules - http://www.bay12games.com/dwarves/mantisbt/view.php?id=10059) because that creature killed a member of your fortress, much like the behavior of villagers being struck down with panic in adventure mode. This is not the same as generic animal running fear (which activates when being attacked), the anxious units will just stare though the grate at the carnivorous named animal and rush out to kill it, despite ignoring all other creatures otherwise.

Ill try to get a save up for the future dedicated to this for vanilla and solid science, but they are all things i have seen happening personally and with some effort are re-creatable and reproducible every single time with enough effort to arrange the conditions because its behind the scenes tomfoolery since the mind system was put in.

Sometimes its just common sense, but if it leads you towards where the original type value is defined and hosted (lets say ref-type creature raw, knowing it exists and then searching the directory for all of those entries will lead you to places, from there onwards until you find all the parts that you need and encounter new terms relevant to your query)

Spoiler: bugs and links (click to show/hide)
« Last Edit: October 30, 2016, 04:44:52 am by FantasticDorf »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #856 on: October 30, 2016, 05:56:08 pm »

They're not the same value. Why do you think they're the same value?

Also, intelligent creatures don't show emotions in dwarf mode unless they're citizens, not just intelligent, so the GUI argument sort of falls flat there, too.

Also, "where it pools into" isn't quite right; these structures are part of larger structures but that doesn't mean their behavior is inextricably linked with said larger structures. Just because unit.status.current_soul.emotions[0] is an emotion contained within unit doesn't mean that unit.animal.vanish_countdown is going to do anything to said emotion.
population_id is already claimed  by entity_population at df.history.xml#L340

No it isn't. Names do not work that way. They are two independent but similarly-named parts of structures. Each unit has its own unit_id and historical figures also have unit_id, but that won't clash with anything.

FantasticDorf

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #857 on: November 02, 2016, 08:09:04 pm »

They're not the same value. Why do you think they're the same value?

Also, intelligent creatures don't show emotions in dwarf mode unless they're citizens, not just intelligent, so the GUI argument sort of falls flat there, too.

Also, "where it pools into" isn't quite right; these structures are part of larger structures but that doesn't mean their behavior is inextricably linked with said larger structures. Just because unit.status.current_soul.emotions[0] is an emotion contained within unit doesn't mean that unit.animal.vanish_countdown is going to do anything to said emotion.
population_id is already claimed  by entity_population at df.history.xml#L340

No it isn't. Names do not work that way. They are two independent but similarly-named parts of structures. Each unit has its own unit_id and historical figures also have unit_id, but that won't clash with anything.

 :-X

I think i've found enough evidence both through observational study and clumsy XML memory reading to determine that the issues im talking about is code regression. There are bug-tracker discussions about those local feature site population causing personality/ethic bleeding problems here at (10059) and DF unit & BP body part issues causing intelligent living corpses because no BP death state and lingering living creature ID's here at (0010057)

Turns out after all, you're right about them being citizens rather than based on intelligence but all site animals are simply (wild) site citizens based on the entity who has settled the area, and this resonates to all settlements with kobolds taking up human professions in abandoned towns and hostile invaders (who switch to a hostile marauder class like megabeasts/invaders do, even if they are your deserted factional units) to explain crazy beserk wagons and civilians going feral when stranded on reclaim sites because they are now part of the non-site population.


Back to actual suggestion i guess, what about a plugin/script that reveals the genetic links of a egg (because each egg has a parent creature) and can centre on them for working out paternity.

Runs in sync with egg fertility indicator plugin described here and possibly future scripts as a way to artificially create units without drawing upon world populations by causing them to spontaneously hatch out of a egg by script editing the parent race. Might have some funky functions as chicken donor's (contributing to fertile eggs and laying) could make tame animals by switching out the fertile eggs and parents code, and splicing new or artificial ones in.
« Last Edit: November 02, 2016, 08:11:42 pm by FantasticDorf »
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #858 on: November 03, 2016, 05:50:25 am »

Now that Toady seems willing to provide a dump of global variables (if not the entire memory structure), a DFHack plugin to convert guessed-to-actual names would be very helpful.  Ideally something that could wrap around an old script like an emulator.  Statically analyzing code seems like it would be hardest path (having to parse local variables pointing to global ones).
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: [SUGGESTIONS] for DFhack plugins
« Reply #859 on: November 03, 2016, 08:12:56 am »

We don't have to change DFHack's names at all. We just have to figure out how DF's and DFHack's names correspond.
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.

Roses

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #860 on: November 03, 2016, 11:41:25 am »

We don't have to change DFHack's names at all. We just have to figure out how DF's and DFHack's names correspond.

Not necessary to change names, but switching to the DF names might also make it more intuitive. Depending on what Toady has named things.
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #861 on: November 03, 2016, 02:01:24 pm »

We don't have to change DFHack's names at all. We just have to figure out how DF's and DFHack's names correspond.

Not necessary to change names, but switching to the DF names might also make it more intuitive. Depending on what Toady has named things.
Well, anon fields really ought to be renamed.  Other than that, Toady's names can be under a separate pointer to the DF structure (such as DF_official).

Hopefully the attributes aren't all .scamps1, .scamps2, .scamps3, etc.
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: [SUGGESTIONS] for DFhack plugins
« Reply #862 on: November 03, 2016, 02:11:31 pm »

Who said anything about field names? This is about global addresses only. There are a couple ways Toady could have done it, and we're not sure if it even exposes the global names or not.
Renaming even one global in DFHack would be a huge amount of work. Aliases should be possible, but would probably be confusing.
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.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #863 on: November 03, 2016, 02:30:02 pm »

Who said anything about field names? This is about global addresses only. There are a couple ways Toady could have done it, and we're not sure if it even exposes the global names or not.
Renaming even one global in DFHack would be a huge amount of work. Aliases should be possible, but would probably be confusing.
Also we can have multiple names having same type and same address.

Roses

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #864 on: December 08, 2016, 04:37:37 pm »

So I've been looking into it a little bit and I think it should be possible, but it is outside my knowledge level. I would like to see the ability to choose on the world map where a civilization starts (and if possible put lairs and such). Basically pausing world generation right before the "placement" stage and then doing it manually. Any of the more technically savvy DFHackers want to help me with it? I can write code, but I have no idea how to inject something like that (or even how to pause world generation at the right time)
Logged

FantasticDorf

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #865 on: January 25, 2017, 10:52:31 am »

I have a plugin request in regards to issue (0009171: Butcher returns of sentient creatures are unusable, regardless of adventurer's ethics) and the findings conducted on this thread about sentient butchery.

> Eating Sapients FotF derail (namely this post reveals the nature of the bug)

A function to disable 'graveyard' (or (y) corpses stockpile) taking in traffic on command, given that the bug explored here suggests that the issues with sentient beings stem from a relationship of being queued up to visit that stockpile sometimes unnecessarily when there is room for bodies in the refuse piles. If the bodies can be redirected away (by the prompt to go to graveyard never firing) from the graveyard stockpile and into the refuse pile, the materials will be freed up for use with the appropriate ethics until the resulting bug is fixed.

> Graveyard is still important for defining who to bury & who can be memorialised, but it is tedious when you have the option to memorialise every sentient that ever visited your site via this bug because they went to the graveyard. It would also in strongly supported theory free up pets to be butchered (because they are queued up for the graveyard when they die of natural/combat)

> Re-enabling dead_dwarf=true on your civilians you want to memorialise would be a manual hot-fix if this plugin would work.
« Last Edit: January 25, 2017, 10:54:27 am by FantasticDorf »
Logged

ab9rf

  • Bay Watcher
    • View Profile
    • ab9rf@github
Re: [SUGGESTIONS] for DFhack plugins
« Reply #866 on: January 26, 2017, 11:33:56 am »

So I've been looking into it a little bit and I think it should be possible, but it is outside my knowledge level. I would like to see the ability to choose on the world map where a civilization starts (and if possible put lairs and such). Basically pausing world generation right before the "placement" stage and then doing it manually. Any of the more technically savvy DFHackers want to help me with it? I can write code, but I have no idea how to inject something like that (or even how to pause world generation at the right time)
We know very little about what goes on during worldgen itself, and have very limited access to the worldgen process. It is not really possible to do much, with DFHack at least, to alter the behavior of worldgen.
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #867 on: February 12, 2017, 07:11:09 am »

The combine_plants and combine_drinks utils are quite nice but it would be great if instead of a onetime action on a single stockpile they would setup a repeat action on a specific or all stockpiles.
There is a repeat script for that.
After spending half a hour looking at the code, I'm left bit askance on how I'd use repeat script for this and decided to ask.

Can't use just repeat -time 1 -timeUnits months -command [ combine-plants ], as that will always give an error as you never have stockpile selected while game is unpaused.

So I thought that maybe I could fed combine-plants arguments for this. However, variations on combine-plants 12 1 295 (respective #s for 'max', 'stockpile' and single 'container' in said stockpile ) gives an error on the 12.

What would be proper repeat script to do this? (Ideally bound to a hotkey, but getting even one that has to be copy-pasted for each stockpile to run would be a start.)

fortunawhisk

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #868 on: February 12, 2017, 03:42:39 pm »

I use the following:
Code: [Select]
repeat -name food -timeUnits days -time 1 -command [ "combine-plants -stockpile 21" ]

Quotes and spacing are important. I used bprobe to get the stockpile number, the number that shows up in-game (#7, etc) doesn't appear to work.
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #869 on: February 12, 2017, 05:24:01 pm »

Thanks, didn't occur to me that I'd need to identify the variable names either.

I guess the building number is order of buildings placed on embark with oldest/embark wagon first - found it on test myself with :lua print(df.building.find(1)) and gui/gm-editor on the container for it's id.
Pages: 1 ... 56 57 [58] 59 60 61