Regarding stonesense.. Is the expectation that it's currently supposed to be working, in -r1? Or is that a future revision goal?
I've tried a default/brand-new install of both 0.47.04 + dfhack 0.47.04-r1, and attempting to launch stonesense crashes df and dfhack.
For reference,
here is the issue. It's been around for a while, but Stonesense is large, complicated, and has few active devs (so thank you Rose for the fix!) so I didn't think it was worth holding off 0.47.04-r1 indefinitely for a fix. In retrospect, I probably should have made that more clear in the release notes. Our release notes are semi-generated now and really just focus on changes since the last release(s), not release-specific notes, but this is something we could improve.
At the same time, there is a weird and nasty
bug on develop (well, hopefully just this one) that would definitely hold up an r2. Maybe we should start making smaller and more frequent "point" releases (like r1.1) with fixes like these, now that I think about it.
Exactly - I would be more concerned about optimizing the loop body, since that's presumably run more often.
More just wanted to make sure that the x = y or z syntax wasn't stupidly expensive (it's not in the other languages I code in, so I didn't have a good handle on it). That being said, I should have just run a little test case (which I just did) with a million calls there was no appreciably difference in run times (when the SubTable was present the second was slightly faster, when the SubTable was not present the first was slightly faster, but within a few percent of eachother each time I ran)
Lua does short-circuit and/or, for what it's worth, so it's about as inexpensive as it can get:
> 5 or f()
5
> nil or f()
stdin:1: attempt to call a nil value (global 'f')
stack traceback:
stdin:1: in main chunk
[C]: in ?
Also, what's the difference between "dfhack.maps.getTileBlock(x,y,z)" and "dfhack.maps.ensureTileBlock(x,y,z)"?
From docs:
dfhack.maps.ensureTileBlock(coords), or ensureTileBlock(x,y,z)
Like getTileBlock, but if the block is not allocated, try creating it.
I'd have to dig into the source here to give you a better answer:
https://github.com/DFHack/dfhack/blob/f20446534bb7f39425e102bd70daec46e328004f/library/modules/Maps.cpp#L181-L223Regarding enums, if you can navigate in gui/gm-editor to the structure containing the fields you're interested in, editing it will give you a popup containing a list of enum items as well as the enum type name.