This have been bugging me for years and finally I have found a fix. At first I thought they just forgot to implement the functionality of ending the feast in player's kingdom. Turns out they did, but messed up. So it's a bona fide bug. And here I present a bona fide bugfix.
BUG DESCRIPTION
Intended behavior: Game attempts to end all feasts that have been going on for more than 72h.
Actual behavior: Endless feasts if player is leading his own kingdom, in other cases feasts being ended after 72h.
Source of the problem: The bugged script in question receives "faction decider" (the person in charge) as a parameter. But most of the operations the script performs are done on the faction, not on that person (troop object), so the script gets the faction by applying the store_faction_of_troop command to the troop. The problem stems from the fact that this command is meant for NPCs, not for player character. For player character it returns the id of fac_players_faction (id=13) which is an empty dummy faction, with only the player in it. When player "joins" factions, he actually stays in his own fac_players_faction, and the info on his allegiance (also if mercenary) is stored in the $players_faction global variable. When you join a pretender's rebellion or start "your own kingdom" it's actually the fac_player_supporters_faction (id=14). As a result, if player is leading his faction (id=14), the script actually gets wrong id (id=13) from store_faction_of_troop so the feast-stopping code never gets executed for fac_player_supporters_faction.
Fix: check if troop we work on is player, and store the faction ID correctly (from $players_faction)
BUGFIX CODE FOR MODULE SYSTEM
This bug exists in pretty much every mod I have encountered so far, which means they use the same broken vanilla code. This also means that the same fix should work for all of them. Or most of them at least.
Where to put it:
file: module_scripts.py
script name: "npc_decision_checklist_faction_ai_alt"
line: in unmodded Native insert right after line 46821
descriptive instructions:
In module_scripts.py find:
A few lines below that find:
Right after that insert this code (preferably as new lines):
(This is only one of the few possible implementations of this bugfix. I choose this way because it requires the least changes to vanilla lines - code is added, not replaced).
CREDITS AND ACKNOWLEDGEMENTS
Just use the code. You don't have to credit me, you don't have to mention me. I don't care. I want your mods fixed, so I can play them in peace
BUG DESCRIPTION
Intended behavior: Game attempts to end all feasts that have been going on for more than 72h.
Actual behavior: Endless feasts if player is leading his own kingdom, in other cases feasts being ended after 72h.
Source of the problem: The bugged script in question receives "faction decider" (the person in charge) as a parameter. But most of the operations the script performs are done on the faction, not on that person (troop object), so the script gets the faction by applying the store_faction_of_troop command to the troop. The problem stems from the fact that this command is meant for NPCs, not for player character. For player character it returns the id of fac_players_faction (id=13) which is an empty dummy faction, with only the player in it. When player "joins" factions, he actually stays in his own fac_players_faction, and the info on his allegiance (also if mercenary) is stored in the $players_faction global variable. When you join a pretender's rebellion or start "your own kingdom" it's actually the fac_player_supporters_faction (id=14). As a result, if player is leading his faction (id=14), the script actually gets wrong id (id=13) from store_faction_of_troop so the feast-stopping code never gets executed for fac_player_supporters_faction.
Fix: check if troop we work on is player, and store the faction ID correctly (from $players_faction)
BUGFIX CODE FOR MODULE SYSTEM
This bug exists in pretty much every mod I have encountered so far, which means they use the same broken vanilla code. This also means that the same fix should work for all of them. Or most of them at least.
Where to put it:
file: module_scripts.py
script name: "npc_decision_checklist_faction_ai_alt"
line: in unmodded Native insert right after line 46821
descriptive instructions:
In module_scripts.py find:
Python:
"npc_decision_checklist_faction_ai_alt"
Python:
(store_faction_of_troop, ":faction_no", ":troop_no"),
Python:
#BUGFIX BEGIN - bugfix of store faction for when decider is player
(try_begin),(eq,":troop_no","trp_player"),(assign,":faction_no","$players_kingdom"),(try_end),
#BUGFIX END - bugfix of store faction for when decider is player
CREDITS AND ACKNOWLEDGEMENTS
Just use the code. You don't have to credit me, you don't have to mention me. I don't care. I want your mods fixed, so I can play them in peace
Last edited: