Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 8 9 [10]

Author Topic: Kloker was Cavern Keeper was Manipulator. Detailed and automatic labor control.  (Read 25407 times)

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Cavern Keeper is Manipulator + detailed character information.
« Reply #135 on: July 28, 2019, 08:32:14 pm »

Oh no, they meant ability to turn off labours depending on month (link), not affecting military schedules (which you can, incidentally, find under df.global.world.squad[#].schedule[#][#] (.orders) , though there's some unknowns in 44.09). This would probably require saving data in world files to keep past restart with save, but not restart without save.

And, hah, I suspect why there's just assigning in therapist and uniform copying is more about how grand the military rework ideas are. I myself have more than a full page of thoughts on settings, indicators, ui additions that I've yet to touch, to say nothing of pages and pages of mostly doable suggestions in suggestions forums by other people.

strainer

  • Bay Watcher
  • Bugeyed Goblin Artiste
    • View Profile
Re: Cavern Keeper is Manipulator + detailed character information.
« Reply #136 on: July 28, 2019, 09:33:00 pm »

Oh right, that adds a whole extra dimension to work assignment - a crazy idea :) I dunno like right clicking on a labour brings up a little calender pop-up modal that lets months be clicked and the information saved somewhere, and then another plugin could apply that info every month. Then it would need convenient reset and summary features or invisible labor toggling chaos ensues !

This 'unitkeeper' doesnt help with any automation at the moment. Ive thought about quick hacks like adding a feature to save the labor state, so it can then briefly run an autolabor plugin and then quickly restore labors to units which were not selected - so its a kind of group autolabor ability, or it could overlay autolabors results instead of overwriting. Then autolabor or labormanager might themselves beg to be modified to take a list of units to exclude from auto assignments.

A small but fiddly wish is for an ability to open keeper focused on a unit selected on the map, Im sure dfhack functions exist to do that pretty easily but until I find another pluggin that does similar Im stuck. Apparently keeper only runs at them moment when it is called from unitlist, how to add something that listens for a keypress from the map screen escapes me.

...that killer horse didn't get wind of you using its kind for a bit of military training did it ? ;) 
« Last Edit: July 28, 2019, 09:34:33 pm by strainer »
Logged
Beware Kloker !

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Cavern Keeper is Manipulator + detailed character information.
« Reply #137 on: July 28, 2019, 09:52:42 pm »

Hah, little popups would open up freedom way beyond that; allowing stuff like "keep enabled for N jobs" or other timeunits. Regimented monthly allows one to swap labor grids per month or have it as background detail to the aptitude/skill level fg, leaving it easier to keep all information the keeper does in one screen. Well, ultimately, these kinds of features strike me as bit of handling needs though.

Saving labour state, though...I must admit, I've done this sorta thing with therapist - commit set of labours, then immediatelly undo those changes but not commit so I can remove them when something I want done by them/avoided by them is done. It might be useful.

Labormanager already excludes any units in burrows, so adapting that to other lists shouldn't be hard, I guess. Autolabor's documentation doesn't mention that, but does mention excluding CMD.

Opening keeper on an unit selected in the map...I'd guess you'd need to remember the unit, relay key for opening the unit screen (like manipulator (lua) does, using gui.simulateInput), set cursor position in list to unit's position in the underlying native unitlist viewscreen (with correct tab if unit isn't a citizen/resident), then launch keeper. A separate lua script could probably do it; maybe even just :lua inline keybind.

PS: It did, and it told it to next generation; I nearly lost another dwarf to a supposedly calm foal strangling them in rage. This may be too fun a way to train armor user; at least with horses (wild boars and horseshoe crabs have been more receptive in the past, though I've had fatalities with the former. ).
« Last Edit: July 28, 2019, 10:02:42 pm by Fleeting Frames »
Logged

strainer

  • Bay Watcher
  • Bugeyed Goblin Artiste
    • View Profile
Re: Cavern Keeper is Manipulator + detailed character information.
« Reply #138 on: July 29, 2019, 07:08:14 pm »

I've got keeper opening on map units now, trickiest thing was working out how to use dfhacks "VMETHOD_INTERPOSE" system to put the hotkey in the unitview menu - that's weird c++ hacker voodoo. I pieced together the necessary incantations from other plugins, and instead of opening the focused unit in a standard list, I make a list of the units surrounding it or underneath if there arent many about, and that list of mix-ups opens in keeper okay :D
Logged
Beware Kloker !

strainer

  • Bay Watcher
  • Bugeyed Goblin Artiste
    • View Profile
Re: Cavern Keeper is Manipulator + detailed character information.
« Reply #139 on: August 23, 2019, 05:28:35 pm »

I've finished a number of updates, if anyone likes to try/help-test then new compiles for dfhack 44.12.r2  are here for windows and linux, or let me know what plat/version you need.

The cavern keeper has revealed its archaic name to be: "Kloker" (its a kind of cave sprite so it goes), so it may be known forthwith...

Kloker can be opened from the map (look menu) now, and then it displays a list of the focused unit and all the units in vicinity... dwarves, visitors, animals, even zombies and other dead things.

The profession system is altered a bit. Profession masks can now be saved with hotkey and professions can be unsaved with a hotkey. Previously, making masks and unsaving  professions required players to manually edit files in dfhack. The Professions/masks are applied in a new combined "batch actions" screen that includes other features, making the UI a bit nicer.

The batch actions screen, combines the options for group renaming, for applying professions, and has options for reducing/maxing labors or hauling, and also has 2 special options which really frazzled my puzzer putting them in... to automatically assign outstanding tasks to the selected units. The automatic assignment can be done as a full reassignment or as a mask (which seems more useful - it doesn't forbid any labors). It uses the labormanager plugin transplantedly in the background which was the most fiddly to arrange under C++ hyperlexical attacks, but it seems to work nicely as an option to quickly avail a few dwarves to all pending tasks, or just to observe what labormanager would make of things. The batch actions screen also has an undo feature to make it quite safe to try.

Renaming single units can be done quickly from the main screen with hotkeys n and p for name and profession, or from within the batch action screen.

Unit happiness column is player settable to one of a dozen or so options, and it changes itself occasionally if player doesnt set it.

Units with absent souls (zombies/husks etc) at last are visible in kloker.

Finally, The current Dwarven Date is written in the screens border.

--
Before these features I had the code tidied up a bit to try and send back to dfhack, but its got an extra 1.5 thousand lines of freshly scrawled code now.  :o Quite a relief to have it done though. \o/
« Last Edit: August 23, 2019, 05:43:04 pm by strainer »
Logged
Beware Kloker !

strainer

  • Bay Watcher
  • Bugeyed Goblin Artiste
    • View Profile
Re: Cavern Keeper is Manipulator + detailed character information.
« Reply #140 on: August 24, 2019, 12:26:34 pm »

Saving labour state, though...I must admit, I've done this sorta thing with therapist - commit set of labours, then immediatelly undo those changes but not commit so I can remove them when something I want done by them/avoided by them is done. It might be useful.

This shouldnt be a great ordeal to add to the batch action screen now. A "save group's labors" menu option could save a groups labors to the existing 'professions' folder using similar profession saving methods, under a name given by the player using the same method which 'change nickname' uses to input a name. Then  'apply labors of group: x' could be listed as options in the batch action menu, same as the apply profession options do. It would just need a warning that the option applys to the saved group not the currently selected one, and an option to delete group arrangement saves to stop them accumulating.

Quote
Labormanager already excludes any units in burrows, so adapting that to other lists shouldn't be hard, I guess.

I got it working by temporarily clearing everyones labors, and getting everyone not in the group thats to be assigned, to pretend that their hands are broken before calling in the auto-labormanager. I ran into difficulties getting the labormanager to reliably attend and efficiently storing boolean labor arrays in a 'map' datatype. Without deep knowledge of how c++ parses things it can be mind boggling to figure out how to put straightforward operations to it. And the std::maps .size() method wasnt returning 0 after it was in fact .clear()ed for some wicked reason  :o  Writing lua and even javascript is a breeze in comparison, C++ doesn't just have gotchas - it seems constantly intent on getting me !

Quote
Opening keeper on an unit selected in the map...I'd guess you'd need to remember the unit, relay key for opening the unit screen ...
Turns out it was straightforward to just call keeper/kloker directly from the code which is interposed into the dwarfmode lookat menu to add the text and event to that menu (all just copied and tweaked from the way someone did it before). The dfhack "interpose" ability allows code to just be sort of wedged into modules of df's viewscreens and all keeper needed to open was a list of units to refer to.
« Last Edit: August 24, 2019, 12:30:06 pm by strainer »
Logged
Beware Kloker !

Noobboyo

  • Escaped Lunatic
    • View Profile
Re: Cavern Keeper is Manipulator + detailed character information.
« Reply #141 on: August 26, 2019, 06:50:24 pm »

So how do you install it in am very very new and need some help with installing it
Logged

strainer

  • Bay Watcher
  • Bugeyed Goblin Artiste
    • View Profile
Re: Cavern Keeper is Manipulator + detailed character information.
« Reply #142 on: August 27, 2019, 08:29:45 am »

Hi, you should find the plugin file to download for your OS and DF pack version linked in the readme  here. Then all there really is to do is paste it into the hack/plugins directory. It only runs in fortress mode btw - I notice you have been adventuring so far :)
Logged
Beware Kloker !

Noobboyo

  • Escaped Lunatic
    • View Profile
Re: Cavern Keeper is Manipulator + detailed character information.
« Reply #143 on: August 27, 2019, 07:09:34 pm »

Thank you for clarifying things and yeah I know it is for fortress mode
Logged

strainer

  • Bay Watcher
  • Bugeyed Goblin Artiste
    • View Profile

Hope you like it. If you dont find a link for your version let me know, Ill check and see about putting up a compile for it if its not there.
Logged
Beware Kloker !

strainer

  • Bay Watcher
  • Bugeyed Goblin Artiste
    • View Profile

Oh I just noticed last weeks compiles were missing lots of character info display. I didnt notice cause I just tested it on zombies. Ive uploaded fixed versions.

Here is a screenshot of the new "Batch Actions" screen :


Here is how the tweaked main screen looks :
Logged
Beware Kloker !
Pages: 1 ... 8 9 [10]