Create key bindings for zones #5550
Replies: 2 comments 1 reply
-
Not an expert here. Possible, maybe? Finding the addresses is pretty much a solved problem. They're all fields in giant objects, the objects themselves can be located fairly easily, the field layout doesn't change all that often, and there's automated tools that do a lot of the work. For instance, you can tell if the game has the Zone popup open by testing if This is implemented to the point that DFHack keeps track of 'focus strings' that tell you what mode the UI is in, and can even trigger callbacks when the UI changes to or from a specific state. When the Zone popup is open, the relevant focus string is I think trapping the The target variable looks like it might be In general, changing UI state is a huge, huge problem for DFHack. As in, we generally can't do it. That may kill this idea right there. Maybe the best we could do is try to feed a mouse-click to the exact right screen location? That's really, really not a good way. |
Beta Was this translation helpful? Give feedback.
-
To conclude this discussion. I created a script zone-bindings. I am not sure whether it is worth adding to the official repository, so I leave the link here. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Make it possible to trigger the creation of specific zones using the keyboard. For example,
zo
for office,zm
for meeting zone, and so on (z
is the default key for zone type selection).The game has key bindings for buildings but lacks hotkeys for zones. For example,
bpr
initiates a door spawn, andbfb
initiates a bed placement. When the zones pop-up is active, users must use a mouse or trainers (memory hacks) to choose the zone to create; moreover, hotkeys are not locked in zone selection mode, which makes it trickier to implement from scratch.The variables for the current pop-up window and zone types seem to be 4-byte integers and have constant addresses (at least in the Windows Classic version binary). The game interface reacts immediately when the values are changed in memory. Such behaviour makes this feature feasible to implement, but may be problematic to support because the address can change with any release.
I discovered DFHack/df-structures/symbols.xml, which contains a massive base of addresses. I suppose this may have been automatically created from RTTI. Maybe the addresses for the zone type choice are part of some entities that can be discovered using automatic search, and thus, they are possible to implement without manual overwrite on each game release.
Please share your thoughts on the possibility of implementation.
Beta Was this translation helpful? Give feedback.
All reactions