Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 45 46 [47] 48 49 ... 243

Author Topic: DFHack 50.13-r2  (Read 816863 times)

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #690 on: January 06, 2018, 07:51:51 pm »

Did some more research by comparing a spawned unit in arena mode with the secret (interactions work ok) with one that received the syndrome.
The wound is properly created (in 'body') by DF when the syndrome is added. It contain a curse info with all the proper data, said curse is then applied to the unit.
The only divergence was the lack of a reinfection id and count, but after modifying syndrome-util to add it, nothing changed.

Everything in body, in curse and in syndrome is adequate. I'm still searching...

Quoting myself, but after figuring it out I believe you might be interested.
Dfhack wise, the syndrome is properly added as far as interaction goes. But Kruggsmash made a video about turning dwarves into necromancers so I knew that it had to work.
I tested with an inhaled stone that provides interactions and the units were not using it either, so taking inspiration from generated necromancy I removed usage hints and it worked.

As it seems, ATTACK is not working anymore, but no hint now has the same effect (instead of "all the time" from 0.34) and the unit will use the interaction in combat. The arena does not respect those rules, so it's probably a bug. Mystery... kinda solved, I guess?

Spoiler: The interaction (click to show/hide)

It is added with :
Code: [Select]
local synName = 'Pyromaniac (fireballs, directed ash, firejet)'
dfhack.run_script('modtools/add-syndrome', '-target', unit.id, '-syndrome', synName, '-resetPolicy', 'DoNothing')

That does not explain issues with bleeding or drowsiness. Those symptoms are a little complicated as those counters were not in body, probably in body parts. Again, it is worth testing it with inhalation before going further.

Interesting results, I wonder why USAGE_HINT:ATTACK isn't working anymore. Was that information anywhere in the change logs? I think I need to start doing all my testing in fortress mode, it seems arena mode has some issues.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #691 on: January 06, 2018, 08:36:08 pm »

Thanks Quietust - this should relieve me of much future puzzling !
You can also use df.type.is_instance() instead of link:getType():
Code: [Select]
unit = dfhack.gui.getSelectedUnit()
for _, link in ipairs(df.historical_figure.find(unit.hist_figure_id).histfig_links) do
    if df.histfig_hf_link_deityst:is_instance(link) then
        deity = df.historical_figure.find(link.target_hf)
        -- do something with deity
    end
end
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.

dragdeler

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #692 on: January 06, 2018, 10:15:09 pm »

There seems to be a problem where working pumps don't pump, after you changed a tile upon which a machine part lies with "tiletypes".

god that'll teach me not to cheat instead of spending a day to do minor improvements... i'm so done
Logged
let

Pvt. Pirate

  • Bay Watcher
  • Dabbling Linux User
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #693 on: January 07, 2018, 04:39:45 am »

i got problems with mousequery not responding to the mouse being in the bottom or right border.
this did not occur in 43.x.x but only in 44.x.x
i'm using a 5:4 screen and running DF windowed 1280x960.
maybe there's something wrong with the calculation of the position and/or size of the areas for mouse scrolling.
Logged
"dwarves are by definition alcohol powered parasitic beards, which will cling to small caveadapt humanoids." (Chaia)

iceball3

  • Bay Watcher
  • Miaou~
    • View Profile
    • My DA
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #694 on: January 07, 2018, 05:12:33 am »

Also, I'll test it again tomorrow, but I'm pretty sure that the stonesense bundled in dfhack is currently non-functional. Wouldn't even close when i tried to force it to, aside from closing DF.
Logged

KittyTac

  • Bay Watcher
  • Impending Catsplosion. [PREFSTRING:aloofness]
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #695 on: January 07, 2018, 08:05:39 am »

Can you write me a script that teleports you in adv mode to the cursor with "l"? It would make navigating laggy areas more bearable.
Logged
Don't trust this toaster that much, it could be a villain in disguise.
Mostly phone-posting, sorry for any typos or autocorrect hijinks.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #696 on: January 07, 2018, 08:50:46 am »

Thanks Quietust - this should relieve me of much future puzzling !
You can also use df.type.is_instance() instead of link:getType():
Code: [Select]
unit = dfhack.gui.getSelectedUnit()
for _, link in ipairs(df.historical_figure.find(unit.hist_figure_id).histfig_links) do
    if df.histfig_hf_link_deityst:is_instance(link) then
        deity = df.historical_figure.find(link.target_hf)
        -- do something with deity
    end
end
You can, but it's generally much more efficient to use .getType() - the only time you really need to use is_instance is when you're dealing with a class that doesn't have a .getType() vmethod (e.g. a Viewscreen).
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #697 on: January 07, 2018, 09:09:23 am »

Thanks Quietust - this should relieve me of much future puzzling !
You can also use df.type.is_instance() instead of link:getType():
Code: [Select]
unit = dfhack.gui.getSelectedUnit()
for _, link in ipairs(df.historical_figure.find(unit.hist_figure_id).histfig_links) do
    if df.histfig_hf_link_deityst:is_instance(link) then
        deity = df.historical_figure.find(link.target_hf)
        -- do something with deity
    end
end
You can, but it's generally much more efficient to use .getType() - the only time you really need to use is_instance is when you're dealing with a class that doesn't have a .getType() vmethod (e.g. a Viewscreen).

I always use instance._type myself. It should be the most efficient as it's already populated, and doesn't depend on getType() availability.

Obviously the main difference between all this and is_instance() is that the latter can be used to check if an instance is of a subclass of a base class, but I don't think this is ever needed, so it's an overkill.

strainer

  • Bay Watcher
  • Goatherd
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #698 on: January 07, 2018, 09:40:34 am »

I think is_instance is nice and descriptive, but here Im getting the type of each hflink and switching on it to grow a digest which is part of making a condensed 2 or 3 line description of the units circumstances, likes, strongest traits and beliefs. Think im still missing a few like 'friendly terms' though, leaving this for now...

The info displays while the unit is focused in the list so they can be browsed without rifling through other screens. If the process runs fast enough ill do it for the whole list when screen is loaded so efficiency is relevant, if it causes any delay for maybe a couple of hundred units, it can run individually on the units the first time they are focused.
Logged
Klok the Kloker !

strainer

  • Bay Watcher
  • Goatherd
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #699 on: January 08, 2018, 05:25:24 am »

Just to note - I havent found the relationships of friends, friendly terms, aquaintances, or detailed family relations though those could be constructed from mother,father and children which appear in figure.histfig_links. Aunts, cousins, grandfather, "SonEldest5" ... etc are enumed in histfig_relationship_type.h (which is not the type of histfig_links).

Some more correctly enumed relations like enemy and squad members appear in figure->entity_links

There is a small flat array in unit named relationship_ids which only contains refs to 10 things like mother, father, pet, ridermount. These are the first 10 enums in unit_relationship_type.h. Perhaps that array is longer than currently defined, but it doesnt seem capable of containing multiple links of same type anyhow. Maybe its just a small cache of those first 10 rels.

Finally? there is a figure.info.relationships.list which looks a likely suspect, but is mostly anonymous as yet.

Seems like an area to look out for / fill out in the future.
Logged
Klok the Kloker !

iceball3

  • Bay Watcher
  • Miaou~
    • View Profile
    • My DA
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #700 on: January 08, 2018, 06:51:59 am »

Hmm, just had a sudden "hard close". Not exactly sure what caused it.
Has taverns or missions been tested with DFhack yet?
Logged

strainer

  • Bay Watcher
  • Goatherd
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #701 on: January 08, 2018, 08:18:33 am »

I found a bugged save after a hard close can possibly be fixed by escaping immediately after load, selecting export local image, and cycling through the levels. Then the game might save again and be playable, to observe the hard close again...
Logged
Klok the Kloker !

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #702 on: January 08, 2018, 01:09:54 pm »

There is a small flat array in unit named relationship_ids which only contains refs to 10 things like mother, father, pet, ridermount. These are the first 10 enums in unit_relationship_type.h. Perhaps that array is longer than currently defined, but it doesnt seem capable of containing multiple links of same type anyhow. Maybe its just a small cache of those first 10 rels.
It cannot be longer than it is currently, because if that were the case, everything following it (including unit.job, unit.body, unit.counters, unit.status, and more) would be wrong, because it's a C array ("int32_t relationship_ids[10];" in df/unit.h).

Hmm, just had a sudden "hard close". Not exactly sure what caused it.
Has taverns or missions been tested with DFhack yet?
I think the word you're looking for is "crash". There aren't any other situations I can think of where DF would suddenly close except when it crashes.
As for your question, are you asking if DFHack not being tested with taverns/missions could be the cause of the crash? If so, the answer is almost certainly no, because if DFHack research hasn't been done on those things, nothing in DFHack can possibly touch them (unless layouts of globals like "world" are wrong, but those have been fixed for 0.44). Also, taverns were new in 0.42, so they're not likely to be a cause of any new bugs/crashes related to DFHack at this point.

I found a bugged save after a hard close can possibly be fixed by escaping immediately after load, selecting export local image, and cycling through the levels. Then the game might save again and be playable, to observe the hard close again...
If DF crashes, it will not touch the actual save folder itself at all (it saves temporary files to data/save/current, but ignores them when you restart DF). In other words, a crash (except when saving the game) will not permanently affect your save. I highly doubt that exporting images has anything to do with a crash, because that feature pretty much only reads from the map and hasn't been changed in years. If you think you observed it affecting a crash in some way, then that crash is probably due to undefined behavior somewhere, which means that exporting a map could affect it somehow, sometimes, if you're lucky, due to any number of semi-random factors (that could vary depending on your system, etc.). And I know I'm being pedantic, but please don't be afraid to use the word "crash" - it's a lot easier to search for.
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.

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #703 on: January 08, 2018, 01:34:19 pm »

Can you write me a script that teleports you in adv mode to the cursor with "l"? It would make navigating laggy areas more bearable.
Write one for you, personally?

Absolutely not.

Already have one?

Probably.
Code: (flashstep.lua) [Select]
--Teleports unit to cursor
--[====[

flashstep
=========
A hotkey-friendly teleport that places you where your cursor is.

]====]
function flashstep(flash,step)
    local flash = df.global.world.units.active[0]
    local step
        if df.global.ui_advmode.menu == df.ui_advmode_menu.Look then
            step = df.global.cursor
        else
            qerror("No [l] cursor located! You kinda need it for this script.")
        end
    local unitoccupancy = dfhack.maps.getTileBlock(flash.pos).occupancy[flash.pos.x%16][flash.pos.y%16]
        flash.pos.x = step.x
        flash.pos.y = step.y
        flash.pos.z = step.z
            if flash.pos.x==step.x then
            local stepvisibility = dfhack.maps.getTileBlock(flash.pos).designation[flash.pos.x%16][flash.pos.y%16]
                stepvisibility.hidden=false
            end
    if not flash.flags1.on_ground then unitoccupancy.unit = false else unitoccupancy.unit_grounded = false end
end
flashstep(flash,step)
Logged

strainer

  • Bay Watcher
  • Goatherd
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #704 on: January 08, 2018, 02:31:43 pm »

Lethosor:   "Maybe its just a small cache of those first 10 rels." - It *cannot* be longer than it is currently, ...

Ok, thats something. We all still seem to be in the situation that *no one here knows* where to find units friends, friendly terms, aquaintances... And whatever info is in figure.info.relationships.links is unkeyed.

Im just putting that info as I find it, here, for others to notice, or duckduckgo later.

Lethosor: a crash (except when saving the game) will not permanently affect your save.

I wouldnt have expected it to because I noticed task-killing a game is usually fine, but I have bugged dozens of game saves, with silly division by zero, infinite loops or null pointer crashes occuring while in manipulator (while not doing any saving). I dont know the mechanism but a hard crash while in manipulator, on linux, can kill a save, and the process I described can repair it (not necessary to actually export the levels, just scan through them - maybe even just open and close the feature).
« Last Edit: January 08, 2018, 02:48:59 pm by strainer »
Logged
Klok the Kloker !
Pages: 1 ... 45 46 [47] 48 49 ... 243