Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
This is going to affect all units in the fort. DFHack can likely run a fixup tool when it detect a fort has just been unretired.
Note that this fixes much more than just the part that impacted preserve-rooms when unretiring. All room assignment links will be checked and fixed in all fort situations. This effectively fixes DF bug 6578: https://dwarffortressbugtracker.com/view.php?id=6578
However, I already have a duchess, so I wondered how the room reservation would work. Surprisingly, even though the DFHack UI lumps baron/count/duke as one reservation setting, it still assigns the new zones to the new baron instead of the existing duchess, and the previous zones reserved for the duchess remained under her name.
I'm not sure if this was something you guys anticipated and made allowances for or things just happened to work out fine, either way it's great!
Overall, the algorithm for assigning role-associated rooms is:
iterate through all rooms that the player has marked as associated with a role
if the room is currently owned:
- if the room is currently owned by someone who does not have the assigned role (or set of roles), then unassign them
- if the room is owned by someone who has the assigned role (or any of the set of roles), don't change the assignment
if the room is not currently owned:
- iterate through the set of roles that the room is associated with in reverse promotion order (in this case, that would be Count, Duke, then Baron)
- find units that hold that role that belong to your fort and are present at your fort
- find the first of those units that does not already have a role-assigned room of the current room type (e.g. bedroom) and assign this room to them
If you're interested, the code for this is here: https://github.com/DFHack/dfhack/blob/develop/plugins/preserve-rooms.cpp#L311
and the code that detects and prepares the groups of promotion chains is here: https://github.com/DFHack/dfhack/blob/develop/plugins/lua/preserve-rooms.lua#L315 (noble positions and promotion chains are entirely determined by the raws, so there are no static assumptions about what the noble roles look like in the current game).
Ah, that explains why my Baron got the room, since his previous room was not role-assigned. Thank you very much for the detailed explanation!