Repository navigation
Conversation
This script provides tools for recovering from a deceased baron/count/duke. When the landholder dies, the game selects a successor, but this successor is almost always at another site. The game is supposed to push the successor into an army that will path to the site and join it as the new landholder, but the vanilla code to do this includes a test that prevents it from working for landholders (it works for any _other_ civ-level noble position where this happens, just not for landholders. go figure.) so clearly this is what is _supposed_ to happen, it just doesn't because Toady's code is broken. This script finds the already-appointed successor, creates an army, shoves the successor into it, and emulates a unitless "makeown" so that when the successor arrives they'll (re)join the site as the new landholder automatically. Tested on a fort with a dead baron obtained from BlindIRL.
quietust
reviewed
Nov 12, 2026
quietust
reviewed
Nov 12, 2026
quietust
reviewed
Nov 12, 2026
quietust
reviewed
Nov 12, 2026
quietust
reviewed
Nov 12, 2026
quietust
reviewed
Nov 12, 2026
quietust
reviewed
Nov 12, 2026
quietust
reviewed
Nov 12, 2026
quietust
reviewed
Nov 12, 2026
quietust
reviewed
Nov 12, 2026
SilasD
reviewed
Nov 12, 2026
SilasD
left a comment
Contributor
There was a problem hiding this comment.
nitpicky stuff, not the important stuff Quietust flagged.
I'll try to give it more attention later.
Member
Author
|
Verified that the updated version still works in the test fort I'm using, at least for |
Bumber64
reviewed
Nov 13, 2026
Bumber64
left a comment
Member
There was a problem hiding this comment.
Just skimmed, but noticed a few things.
Comment on lines
+131
to
+140
| - ``recall`` for land-holder positions is limited by a native gate: the | ||
| successor-travel sweep skips any position whose definition has | ||
| ``land_holder > 0`` *before* reading the destination, so a baron, | ||
| count, or duke never gets a native travel army no matter what | ||
| ``st_id`` says. The ``st_id`` write is still correct and consumed | ||
| by the same native path -- it just needs the one native check | ||
| bypassed for the target only. A production fix should scope the | ||
| bypass (call the creation path for the single intended nemesis, or | ||
| patch for a single sweep window); a global patch makes every | ||
| stranded land-holder in the world travel at once. |
quietust
reviewed
Nov 13, 2026
quietust
reviewed
Nov 13, 2026
quietust
reviewed
Nov 13, 2026
| end | ||
| if not gate(rd_i32(hf, 0x30) == -1, | ||
| if not gate(hf.died_year == -1, | ||
| ('figure+0x30 (died_year?) == -1 [=%d]'):format(rd_i32(hf, 0x30))) |
was used during investigation, no longer needed
Member
Author
|
Again verified that, after these changes, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This script provides tools for recovering from a deceased baron/count/duke.
When the landholder dies, the game selects a successor, but this successor is almost always at another site. The game is supposed to push the successor into an army that will path to the site and join it as the new landholder, but the vanilla code to do this includes a test that prevents it from working for landholders (it works for any other civ-level noble position where this happens, just not for landholders. go figure.) so clearly this is what is supposed to happen, it just doesn't because Toady's code is broken.
This script finds the already-appointed successor, creates an army, shoves the successor into it, and emulates a unitless "makeown" so that when the successor arrives they'll (re)join the site as the new landholder automatically.
Tested on a fort with a dead baron obtained from BlindIRL.