Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 158 159 [160] 161 162 ... 243

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

Mim

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2385 on: May 17, 2020, 08:35:29 am »

Is playing with DFHack's digging invaders any fun?
« Last Edit: May 21, 2020, 10:33:56 am by Mim »
Logged
I am an excellent proofreader... after I click submit.

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2386 on: May 18, 2020, 01:10:33 am »

Is it possible to call map.rb's map_tile_at(x,y,z) from a lua script, or do I have to implement my own?
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2387 on: May 18, 2020, 02:38:37 am »

Is it possible to call map.rb's map_tile_at(x,y,z) from a lua script, or do I have to implement my own?
not sure what is map.rb's but there is this module and tile is usually collection of type+flags+occupancy(+ some other stuff that is harder to explain). Most of the things can be done with
Code: [Select]
local ttype=dfhack.maps.getTileType(x,y,z)
local des,occ=dfhack.maps.getTileFlags(x,y,z)

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2388 on: May 18, 2020, 03:22:13 am »

not sure what is map.rb's but there is this module and tile is usually collection of type+flags+occupancy(+ some other stuff that is harder to explain). Most of the things can be done with
Code: [Select]
local ttype=dfhack.maps.getTileType(x,y,z)
local des,occ=dfhack.maps.getTileFlags(x,y,z)
https://github.com/DFHack/dfhack/blob/master/plugins/ruby/map.rb

It contains some convenient helper functions as part of a MapTile class (such as returning the relevant df.world.world_data.geo_biomes entry for the tile.) Also an iterator that iterates through every map block on the map.

I can try the maps module, it's just a bit of extra work.
« Last Edit: May 18, 2020, 03:27:42 am by Bumber »
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

bloop_bleep

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2389 on: May 18, 2020, 12:10:03 pm »

Hello all, I'm coming from a discussion on another thread.

I'd like to mention that for building on Windows, I found it required to add C:\Strawberry\perl\vendor\lib\auto\XML\LibXML to PATH, in addition to the paths listed in the docs. The reason is that otherwise, the generate build script throws a rather cryptic error, whose root cause seems to be not being able to find the LibXML dll. Additionally, I've found that in the cmake line in generate-MSVC-all.bat, the -G and -T options needed to be set to

-G"Visual Studio 15 Win64" -T v141

whereas previously, as-downloaded, they were something like

-G"Visual Studio 14 Win64" -T v140_xp
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2390 on: May 18, 2020, 06:24:38 pm »

Thanks for bringing it here! I'll make an issue for it. Would this be the appropriate path to add to the docs, then?
Code: [Select]
<path to perl>\perl\vendor\lib\auto\XML\LibXML

As for the build scripts, I'm pretty sure your changes switch from the 2015 compiler to the 2017 one. We don't want to break things for users of the 2015 compiler, since we recommend it, but it would be worthwhile to document how to build with the 2017 compiler too. (I would rather not introduce separate versions of the scripts for 2015 and 2017, because we've already made one or two choices that have doubled the number of build scripts, and that's not really maintainable. If someone would like to come up with a cleaner way to make the Windows build scripts configurable, that would be great.)
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.

Romeofalling

  • Bay Watcher
    • View Profile
    • The Art of Amul
Re: DFHack 0.44.12-r2
« Reply #2391 on: May 18, 2020, 08:26:21 pm »

Oh, hey. I set up those By-Industry custom stockpiles and then never did anything with them. Almost overwrote them when I downloaded the latest versions.

A) Are you still interested in trying to find some way to distribute these custom stockpiles with dfhack, or do you think it would be simpler to submit these to the LNP and LMacP folks, since they already have folders for such things?

B) If yes, uh....where on Github? I've never submitted a pull request via Github before.

The LNP and LMP both come with a Gems stockpile setting group (Rough Ornamental. Rough Rare, Rough Semiprecious), a Magma Safe group (different Stone and Ore settings), and a MechGuides group.

So since I'm going to go through the trouble of making [Workshop]_Input stockpiles for everything, how do I submit those for inclusion into df-hack?

Submitting a pull request on GitHub is probably easiest for us. However, this case is a bit tricky because we currently don't distribute any stockpile profiles with DFHack, so there's not really a place in the repository to put them (but we can figure out how to address that and make sure they get bundled properly). They're also binary files, from what I remember, which tend not to play very well with Git - if they're large, we might just distribute them separately.

As a side thought, if it's possible to generate these profiles programmatically, it might be more maintainable to have the plugin generate them (although built-in workshops are hardcoded, and reactions for custom workshops can be pretty complicated... so your solution is probably easiest for now).
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.12-r2
« Reply #2392 on: May 18, 2020, 11:04:02 pm »

Oh, hey. I set up those By-Industry custom stockpiles and then never did anything with them. Almost overwrote them when I downloaded the latest versions.

A) Are you still interested in trying to find some way to distribute these custom stockpiles with dfhack, or do you think it would be simpler to submit these to the LNP and LMacP folks, since they already have folders for such things?

B) If yes, uh....where on Github? I've never submitted a pull request via Github before.
We still don't really have a place for them. I'd post them in the LNP thread(s) for now, since they're better equipped to distribute that sort of thing (similar to embark profiles, etc).
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.

Stargazer

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2393 on: May 19, 2020, 01:10:05 pm »

Did anyone ever sort out the bug with the building planner? The one where your dwarves build your furniture directly out of bars of various materials? Mine are doing it right now with iron bars. I'll place the ghost furniture icon and a while later a dwarf with an inventory of iron bars comes up and builds it. I have on Masterful cabinets of any material selected to build with none in my stocks. It even does this when I specifically designate stone as a material.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2394 on: May 19, 2020, 04:20:57 pm »

Did anyone ever sort out the bug with the building planner? The one where your dwarves build your furniture directly out of bars of various materials? Mine are doing it right now with iron bars. I'll place the ghost furniture icon and a while later a dwarf with an inventory of iron bars comes up and builds it. I have on Masterful cabinets of any material selected to build with none in my stocks. It even does this when I specifically designate stone as a material.
This is the first time I've ever heard of this issue, so as far as I'm concerned, it was never reported to us (at least through GitHub, here, or another official channel - have you seen reports of it elsewhere?). The plugin doesn't seem to have changed recently either. I'll see if I can reproduce it on my end. Any idea if this is new to 0.47, or was it happening earlier?
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.

Stargazer

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2395 on: May 19, 2020, 04:37:46 pm »

Did anyone ever sort out the bug with the building planner? The one where your dwarves build your furniture directly out of bars of various materials? Mine are doing it right now with iron bars. I'll place the ghost furniture icon and a while later a dwarf with an inventory of iron bars comes up and builds it. I have on Masterful cabinets of any material selected to build with none in my stocks. It even does this when I specifically designate stone as a material.
This is the first time I've ever heard of this issue, so as far as I'm concerned, it was never reported to us (at least through GitHub, here, or another official channel - have you seen reports of it elsewhere?). The plugin doesn't seem to have changed recently either. I'll see if I can reproduce it on my end. Any idea if this is new to 0.47, or was it happening earlier?

I was browsing and searching to see if I could find an answer for the issue and noticed a few other mentions of it back from 2017.

Right, sorry I should have said all the technical stuff :)

I'm using the LNP (PeridexisErrant's Starter Pack 0.43.05-r03) which has DF 43.05 along with DFHack 0.43.05-r1 (thread: http://www.bay12forums.com/smf/index.php?topic=126076.0)

To be clear, I have the min quality set to ordinary and filter set to *any.  I have say 4 beds prebuilt.  I place 1 bed down in planning mode and a dwarf hauls a bar of coke over.

I don't think this happens on a new game.  I feel like I did something at some point that triggered this behaviour because it reliably does this as soon as I load up the save (even if I already have the furniture constructed).  But when I load an earlier save, it doesn't happen and dwarfs will wait until I construct a bed even if there is coke bars available.

I tried forbidding all my coke bars from the stocks screen.  When they are forbidden, dwarfs properly use normal constructed beds.   After unforbidding, it seems this has fixed the behaviour...  Very strange!!!  I'll post again if anything interesting happens...

Hello, wasn't sure where to put this and I haven't see anyone talk about this, but can someone explain why doors, tables and I guess other furniture are built with coke when they are put down in planning mode?
By coke, I mean they haul bars of coke to the location and then create a door or table from scratch!  I can deconstruct it and I get bars of coke back...  I've never seen this behaviour before.

Planning mode was working normally a while ago where it would wait until I'd build the funiture item and then a dwarf would go haul the constructed item to the spot and install it.  But suddenly (and I'm not sure exactly when as 'coke bar' furniture looks like gabbro) any planned furniture immediately gets made out of coke bars...  and it's always coke bars.  Any ideas?

Except with me it's not coke bars. It's iron bars.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2396 on: May 19, 2020, 10:27:42 pm »

Thanks for tracking it down! It sounds like it's an intermittent issue and an old one (both not great, but at least it's not a regression in 0.47). I've been trying to hunt down segfaults in recent DFHack development builds for a couple days now, but I will try to reproduce it when I get a chance.
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.

HungThir

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2397 on: May 20, 2020, 04:26:23 am »

oh, i think i've seen this before!

iirc, "iron bars" are the default object (first one listed in the raws?) that gets used if somehow no other object was provided.  (maybe, back in 2017, the first one was coke?)

i believe it's not that the script is "constructing the cabinet on the spot out of iron bars", but rather, something has gotten corrupted, and instead of collecting a cabinet object from the stockpile, the dwarf has "collected" some nonsense unitialised object that's being interpreted as iron bars

i haven't used plannng mode in a while, but i _think_ maybe you can reproduce this on demand by placing some furniture in planning mode, specifying objects you don't have yet (so that it creates a suspended job, which will be unsuspended by the script once the desired object exists), and then going into the jobs screen and unsuspending the job yourself -- some dwarf will execute the job, with whatever placeholder object it had been originally created with...

the simple answer might be "well, don't do that then".  but maybe there's a new bug that has surfaced and creates similar weirdness, when the player hasn't manually unsuspended an unready planning-mode job? idk

maybe Stargazer can chime in as to whether they recently unsuspended some jobs just before this happened
Logged

Stargazer

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2398 on: May 20, 2020, 08:40:26 am »

oh, i think i've seen this before!

iirc, "iron bars" are the default object (first one listed in the raws?) that gets used if somehow no other object was provided.  (maybe, back in 2017, the first one was coke?)

i believe it's not that the script is "constructing the cabinet on the spot out of iron bars", but rather, something has gotten corrupted, and instead of collecting a cabinet object from the stockpile, the dwarf has "collected" some nonsense unitialised object that's being interpreted as iron bars

i haven't used plannng mode in a while, but i _think_ maybe you can reproduce this on demand by placing some furniture in planning mode, specifying objects you don't have yet (so that it creates a suspended job, which will be unsuspended by the script once the desired object exists), and then going into the jobs screen and unsuspending the job yourself -- some dwarf will execute the job, with whatever placeholder object it had been originally created with...

the simple answer might be "well, don't do that then".  but maybe there's a new bug that has surfaced and creates similar weirdness, when the player hasn't manually unsuspended an unready planning-mode job? idk

maybe Stargazer can chime in as to whether they recently unsuspended some jobs just before this happened

I don't think I did but I might have. I vaguely recall accidentally unsuspending one of the ghost furniture but I can't remember for sure.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.47.04-r1
« Reply #2399 on: May 21, 2020, 01:46:37 pm »

Question about speed in lua, is there a notable difference between these two?

Code: [Select]
if Table.SubTable then
  for k,v in pairs(Table.SubTable) do
    ...
  end
end

vs

Code: [Select]
for k,v in pairs(Table.SubTable or {}) do
  ...
end
Logged
Pages: 1 ... 158 159 [160] 161 162 ... 243