dfhack icon indicating copy to clipboard operation
dfhack copied to clipboard

makeSquad, updateRoomAssignments

Open 20k opened this issue 3 years ago • 1 comments

Both of these functions are absolutely hideously complicated to implement correctly and required a lot of reverse engineering, and I thought they might well be useful to have generally. I've tested makeSquad a fair amount in 50.xx and it seems to work, updateRoomAssignments is a lot more straightforward to test and I've bashed on it a lot. Both of these are unimplementable from lua, because of memory allocation

These functions take IDs currently but I've noticed that a lot of the rest of the API takes raw values so that probably wants to change? And the sorts below could probably be changed to a sorted insert, as the sorting is necessary

Other than that: the main question is is this something generally that you'd want in dfhack core? I imagine it'll need reworking a fair bit, but I'm happy to make it happen because I'm hoping to shrink the size of my fork for the ui replacement to just imgui

20k avatar Jan 21 '23 20:01 20k

I already merged #2684, but could you tack on a changelog entry for that PR here? in the API section for c++ and Lua for Lua

myk002 avatar Jan 22 '23 00:01 myk002

ping on this

myk002 avatar Feb 13 '23 21:02 myk002

I should have some free time to finish this up fairly soon, sorry for the long delay!

20k avatar Feb 16 '23 08:02 20k

Cleaned up a bunch more of the PR. The only major code-wise unanswered question as far as I can tell is what uniform_priority is doing there

I also need to check what's going on with sorting squad->rooms and zone->squad_room_info, I can't remember if I had a good reason when I wrote this for not using sorted insert

Edit: Ah well my original pr message says no, so I'll fix that too

20k avatar Feb 27 '23 01:02 20k