Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 52 53 [54] 55 56 ... 243

Author Topic: DFHack 50.13-r1  (Read 811702 times)

strainer

  • Bay Watcher
  • Goatherd
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.05-alpha1 (dev)
« Reply #795 on: January 20, 2018, 06:13:58 pm »

Sounds good Patrick, I didnt know about that reputations structure. I'll look at the pull request to see how these definitions are updated.
Logged
Klok the Kloker !

flyteofheart

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.05-alpha1 (dev)
« Reply #796 on: January 21, 2018, 12:54:59 pm »

snip- found what i was looking for in search.

someone already made an adventure mode quick teleportation script called Flashstep

Im not sure how to get a script into DF and then set it to a hotkey but ill figure it out.

this specifically -

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)
« Last Edit: January 21, 2018, 01:08:09 pm by flyteofheart »
Logged
Encrusted with fried bread and menacing with spikes of coconuts
living the dream

dotterian

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.05-alpha1 (dev)
« Reply #797 on: January 22, 2018, 08:25:26 am »

Hi. I'm trying to determine selected or followed dwarf id from lua script. In first case it's a matter of calling one method, but I can't find anything for "follow dwarf" part.
Seems like I can get data of a dwarf in the center of sceen (some times I'll get two or more dwarves on one tile, but that's irrelevant for now).
I need to do this only when I'm in "follow dwarf" mode, and, since it's my first attempt at scripting for DFHack, I dunno how to determine if game is in this mode.
Logged

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: DFHack 0.43.05-r3.1 | 0.44.05-alpha1 (dev)
« Reply #798 on: January 22, 2018, 08:30:34 am »

Hi. I'm trying to determine selected or followed dwarf id from lua script. In first case it's a matter of calling one method, but I can't find anything for "follow dwarf" part.
Seems like I can get data of a dwarf in the center of sceen (some times I'll get two or more dwarves on one tile, but that's irrelevant for now).
I need to do this only when I'm in "follow dwarf" mode, and, since it's my first attempt at scripting for DFHack, I dunno how to determine if game is in this mode.

df.global.ui.follow_unit

Novaris

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.05-alpha1 (dev)
« Reply #799 on: January 22, 2018, 09:33:49 am »

Ok after lengthy testing it seems not related to quicksaving but rather to scared away merchants, they seem to drop everything once they leave the map, so all their stock shows up as 'unobtainable' in the stock overview. The invaders worked up to now.
Logged

Novaris

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.05-alpha1 (dev)
« Reply #800 on: January 22, 2018, 11:22:55 am »

Is there a script that deteriorates EVERYTHING that isn't stockpiled or worn/carried/owned? I have sooooo many sekeltons, bolts, arrows, armor, food, dead traders, god knows what creatures lying dead in front of my gates and cleaning everything up is annoyingly FPS consuming. I managed to get corpses and refuse deteriorate with the scripts but failed to manage a clever check for whether or not the stuff is in a stockpile...


I have to remedy my former statement: have a siege, wait until half of them arrive (like half the squad). quicksave, let the rest arrive, die, restart DF, load game, no more soldiers arrive.
« Last Edit: January 22, 2018, 11:50:22 am by Novaris »
Logged

iceball3

  • Bay Watcher
  • Miaou~
    • View Profile
    • My DA
Re: DFHack 0.43.05-r3.1 | 0.44.05-alpha1 (dev)
« Reply #801 on: January 22, 2018, 12:46:33 pm »

Is there a script that deteriorates EVERYTHING that isn't stockpiled or worn/carried/owned? I have sooooo many sekeltons, bolts, arrows, armor, food, dead traders, god knows what creatures lying dead in front of my gates and cleaning everything up is annoyingly FPS consuming. I managed to get corpses and refuse deteriorate with the scripts but failed to manage a clever check for whether or not the stuff is in a stockpile...


I have to remedy my former statement: have a siege, wait until half of them arrive (like half the squad). quicksave, let the rest arrive, die, restart DF, load game, no more soldiers arrive.
A stopgap until someone proposes a solution: dump all the junk underneath an open side-raising drawbridge and lower the drawbridge on top of it. The items will be obliterated.
Logged

Novaris

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.05-alpha1 (dev)
« Reply #802 on: January 22, 2018, 04:45:48 pm »

I do this already, designating all items I find for dumping and autodump them into an atomsmasher but still, related to the trade bug, I want it to occur automatically and also affect items that can't be selected by hand on the map. Anyway thanks for the suggestion :-)
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.05-alpha1 (dev)
« Reply #803 on: January 22, 2018, 04:55:40 pm »

I *think* this script should reveal, claim, and dump mark merchant stuff. I don't have any bugged merchants to try it on, though.
Make a backup of your save before trying it.

Spoiler (click to show/hide)
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.05-alpha1 (dev)
« Reply #804 on: January 22, 2018, 06:04:34 pm »

snip- found what i was looking for in search.

someone already made an adventure mode quick teleportation script called Flashstep

Im not sure how to get a script into DF and then set it to a hotkey but ill figure it out.
Save in df/hack/scripts as flashstep.lua.
In dfhack.init try like: keybinding add Ctrl-F flashstep or whichever key combo you prefer.
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.05-alpha1 (dev)
« Reply #805 on: January 24, 2018, 04:19:53 am »

Hey could someone look into how wounds work/get updated. I know there is some "calculated_XXX" flags but they did not seem to work when i removed brains from a dwarf (it should get him paralyzed?). I know that heart could be removed without any problems so maybe some info on how much bleeding should be correct for specific organ? Or just wound workings info would be appreciated.

Novaris

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.05-alpha1 (dev)
« Reply #806 on: January 24, 2018, 10:42:49 am »

I have it!

I found an error using dfhack, items are not lying were the carrier "died". I found gloves and armor in the df.world.items.all list with a position of -30000 and traced its carrier in the units.all and units.active list. The swordsman was not part of the units.active but found in the units.all with a valid position right on the map edge (I don't know why he died there but he never made it onto the map) so my plan is now to traverse the lists, find dead units that have a valid map position, check their items and if their position is invalid, I update the position or even mark them for garbage_collection.

Many thanks from everybody :D
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.05-alpha1 (dev)
« Reply #807 on: January 24, 2018, 11:22:59 am »

I have it!

I found an error using dfhack, items are not lying were the carrier "died". I found gloves and armor in the df.world.items.all list with a position of -30000 and traced its carrier in the units.all and units.active list. The swordsman was not part of the units.active but found in the units.all with a valid position right on the map edge (I don't know why he died there but he never made it onto the map) so my plan is now to traverse the lists, find dead units that have a valid map position, check their items and if their position is invalid, I update the position or even mark them for garbage_collection.

Many thanks from everybody :D
The reason those items do not have an explicit position is because they're either in a container or in a unit inventory. Containers may be in inventories as well, so their positions are the positions of the containers/units carrying them. That's not a bug in DFHack, but DF glitching the carrying creature (assuming you look at cases where they haven't arrived/left properly). Also note that the unit flag called "dead" by DFHack isn't actually an indicator of the unit being dead, but rather something more like inactive, so I think merchants on the way onto the map and those that have just left have that flag set. Likewise, invaders who haven't arrived properly yet can have this flag set.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.05-alpha1 (dev)
« Reply #808 on: January 24, 2018, 11:43:58 am »

I have it!

I found an error using dfhack, items are not lying were the carrier "died". I found gloves and armor in the df.world.items.all list with a position of -30000 and traced its carrier in the units.all and units.active list. The swordsman was not part of the units.active but found in the units.all with a valid position right on the map edge (I don't know why he died there but he never made it onto the map) so my plan is now to traverse the lists, find dead units that have a valid map position, check their items and if their position is invalid, I update the position or even mark them for garbage_collection.

Many thanks from everybody :D
The reason those items do not have an explicit position is because they're either in a container or in a unit inventory. Containers may be in inventories as well, so their positions are the positions of the containers/units carrying them. That's not a bug in DFHack, but DF glitching the carrying creature (assuming you look at cases where they haven't arrived/left properly). Also note that the unit flag called "dead" by DFHack isn't actually an indicator of the unit being dead, but rather something more like inactive, so I think merchants on the way onto the map and those that have just left have that flag set. Likewise, invaders who haven't arrived properly yet can have this flag set.

Yeah, it sounds more like you have a unit that didn't arrive/leave properly (although I think arrival problems are more common than leaving problems, at least for me) and so is stuck on the edge of the map and that the unit has an inventory and that that is actually what you are looking at for the items with a -30000 x coordinate.
Logged

Novaris

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.05-alpha1 (dev)
« Reply #809 on: January 24, 2018, 11:46:27 am »

Actually I meant I found a dfhack workaround for a DF glitch :D I finally can mark all the damn "edge items" using a single script and then autodump them away :D dfhack was the saviour, not the offender :P

I have yet to find a way to add the items to the map block though, I see them using the cursor but I cant select them, only dump them using autodump which complains about the items not being part of a block. But if "dead" doesn't mean dead, I still have to figure out how to distinguish between alive breathing entities and ... well ... guys who died at the border of the map.
« Last Edit: January 24, 2018, 11:50:54 am by Novaris »
Logged
Pages: 1 ... 52 53 [54] 55 56 ... 243