Bay 12 Games Forum

Please login or register.

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

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

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #705 on: January 08, 2018, 03:40:59 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).
figure.info.relationships.links might be it, although I'm seeing garbage for year_tick (0xaaaaaaaa, which means it's uninitialized in my setup), so that structure might be off a bit.

I can guarantee that you did not corrupt your save by doing anything in manipulator. If it crashes, any modifications you made to the save are gone. Back before there was a data/save/current folder (around 23a), crashes and killing DF could corrupt saves, because everything was written to the region folder, but that's no longer the case. If you saved files yourself, though (like custom profession files), those might be corrupted somehow. Anyway, you're probably just getting lucky with the map-export feature. I can't think of a way it would affect anything else, but bugs due to undefined behavior can be affected by doing unrelated things sometimes, if you get lucky.

Just to clarify, what exactly is wrong with these "bugged saves" you have? Do they crash at some point soon after loading, or do they exhibit some other bug(s)? Particularly if it's the former, I'd like to take a look at one of these saves.
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.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #706 on: January 08, 2018, 03:50:21 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)

you could also use dfhack's teleport script both to get your adventurer's ID and to teleport your adventurer that way

lethosor

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

you could also use dfhack's teleport script both to get your adventurer's ID and to teleport your adventurer that way
I think the "more bearable" part implied that the teleport script was annoying to use (which is fair - gui/teleport is nicer, in my opinion, but only works in fortress mode).
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.

strainer

  • Bay Watcher
  • Goatherd
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #708 on: January 08, 2018, 04:26:39 pm »

Lethosor:

>Just to clarify, what exactly is wrong with these "bugged saves" you have?

I do find them strange, I can make them easily, just put a div by zero or something in manipulator, open it, df crashes, fix manipulator, next time I open the save it can crash seconds after loading, even while paused, or run for a few seconds unpaused before crashing, it wont save again. I would kick myself if it was a good game and then found through trial that 'export' proceedure can straighten it out somehow enough so it saves, and then runs again. I dont expect its very interesting, maybe just some out of sync temp file or something, but I can make one and zip it up this week if you're curious.
« Last Edit: January 08, 2018, 04:30:18 pm by strainer »
Logged
Klok the Kloker !

Max™

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

you could also use dfhack's teleport script both to get your adventurer's ID and to teleport your adventurer that way
I think the "more bearable" part implied that the teleport script was annoying to use (which is fair - gui/teleport is nicer, in my opinion, but only works in fortress mode).
Yeah, in adventurer mode there is no reason to have a script which needs to be aimed but doesn't use the cursor. I can move myself around with gui/gm-editor easily enough too, or I can hit a keybind and poof over to where my cursor is currently.
Logged

PatrikLundell

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

I still don't understand what strainer is looking for, but it sounds like something along the lines of this:

Spoiler (click to show/hide)

The snipped of a (unfinished) script gets reasonably close to what's shown on the relations screen, but doesn't get it correct all the time, and it also lists relations suppressed from that screen (but obviously present in df). I assume strainer is actually looking for something else, though.
Logged

lethosor

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

Yeah, no idea what's going on there. What files are you overwriting when you reinstall DFHack? It could be some sort of configuration thing. I'd expect that to be related to data/init/init.txt, though, which DFHack doesn't include.
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.

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #712 on: January 08, 2018, 11:47:37 pm »

If you right click in the dfhack window to select something during bootup, that can prevent the game from starting till you right click again.
Logged

Isher

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #713 on: January 09, 2018, 12:05:39 am »

When you build the source of DFHack, is that when the header files in  dfhack>library>include>df are created? Or do I get those from somewhere else?
Logged

lethosor

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

When you build the source of DFHack, is that when the header files in  dfhack>library>include>df are created?
Yes. Specifically, it's the "generate_headers" target, or the one that generates codegen.out.xml.
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.

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #715 on: January 09, 2018, 12:11:42 am »

Note that this is why dfhack relies on perl.
Logged

strainer

  • Bay Watcher
  • Goatherd
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #716 on: January 09, 2018, 04:21:30 am »

"the header files in  dfhack/library/include/df are created ..."

Heh, I spent quite a while puzzled why I couldnt grep any header info, as I was writing and compiling on different machines.

PatrikLundell wrote:
"I still don't understand what strainer is looking for"

I was looking for where units deities are stored, which I found in figure.histfig_links. Im also interested in decoding all of the other unit relationships which is what I was refering to by "such info". Ive discussed the relationship info found in unit.relationship_ids and figure.histfig_links and figure.entity_links and the anon elements in figure.info.relationships.

Your code snippet is very intresting thanks, it looks like you have decoded some of anon figure.info.relationships. Ill try to use it (in the short term to make a rough count of units friends to complete a compact unit summary)
« Last Edit: January 09, 2018, 04:26:30 am by strainer »
Logged
Klok the Kloker !

PatrikLundell

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

@strainer: Just be aware that the snippet is by no means the truth. It gets somewhat close to replicating what DF displays, but that's about it, but it might serve as a starting point. I think Fleeting Frames did a similar type of calculation using a different formula recently, but I haven't done any comparisons. I don't quite remember the context, but it might be regarding enhancements to Dwarf Manipulator info.
Logged

strainer

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

Great! Fleeting Frames has mostly decyphered the figure.info.relationships thing in relations-indicator.lua --lots of good comments too.

Thread: relations-indicator.lua

Thanks again Patrik.

... Im noticing that there is a manipulator.lua underway which my extension of manipulator.cpp ignores. Apologies for that Ive got too far into it before noticing to switch. Maybe they can compliment each other.
« Last Edit: January 09, 2018, 10:24:14 am by strainer »
Logged
Klok the Kloker !

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.05-r3.1 | 0.44.03-beta1 (dev)
« Reply #719 on: January 09, 2018, 09:59:02 am »

I still don't understand what strainer is looking for, but it sounds like something along the lines of this:

Spoiler (click to show/hide)

The snipped of a (unfinished) script gets reasonably close to what's shown on the relations screen, but doesn't get it correct all the time, and it also lists relations suppressed from that screen (but obviously present in df). I assume strainer is actually looking for something else, though.
Can you explain what the fields you used are? anon_3 appears to be some kind of weight, and anon_1 is some sort of ID, I think, but it's hard to tell at a glance. If you can make a PR at https://github.com/dfhack/df-structures, that would be even better. anon names are unreliable and generally shouldn't be used except for experimentation.
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.
Pages: 1 ... 46 47 [48] 49 50 ... 243