This Steam thread alerted me to the possibility that a squad's random_tasks table may, under some very specific circumstances, erroneously be cleared of in-progress 'capture' tasks assigned to the player via dialogue, which can cause the logic that should fail the 'capture' task upon the squad perishing:
... to be erroneously skipped, leaving the task active indefinitely with no possibility of completion.
E.g. suppose the player asks a CS squad stationed at the Machine Yard for work while another CS squad is also stationed there. While the dialogue window is open, a 'defend' task targeting the Machine Yard is auto-received. But the player has already been offered a list of tasks in the open dialogue window, and one of them happens to be a 'capture' task targeting the 'Encampment near truck'. The player accepts. But the task giver squad cannot start moving toward the truck, since the Machine Yard is the target of a defend task:
This Steam thread alerted me to the possibility that a squad's
random_tasks
table may, under some very specific circumstances, erroneously be cleared of in-progress 'capture' tasks assigned to the player via dialogue, which can cause the logic that should fail the 'capture' task upon the squad perishing:https://github.com/Decane/SRP/blob/4b4a2b132bc71884d58d10e61190eef1d6b18abd/gamedata/scripts/sim_board.script#L438-L442
... to be erroneously skipped, leaving the task active indefinitely with no possibility of completion.
E.g. suppose the player asks a CS squad stationed at the Machine Yard for work while another CS squad is also stationed there. While the dialogue window is open, a 'defend' task targeting the Machine Yard is auto-received. But the player has already been offered a list of tasks in the open dialogue window, and one of them happens to be a 'capture' task targeting the 'Encampment near truck'. The player accepts. But the task giver squad cannot start moving toward the truck, since the Machine Yard is the target of a defend task:
https://github.com/Decane/SRP/blob/4b4a2b132bc71884d58d10e61190eef1d6b18abd/gamedata/scripts/sim_squad_generic.script#L598
And since the squad is still idle:
https://github.com/Decane/SRP/blob/4b4a2b132bc71884d58d10e61190eef1d6b18abd/gamedata/scripts/task_dialogs.script#L27
... the player can still ask the squad leader for work. So he does. And this causes that squad's
random_tasks
table to be cleared:https://github.com/Decane/SRP/blob/4b4a2b132bc71884d58d10e61190eef1d6b18abd/gamedata/scripts/sim_squad_generic.script#L765-L766
But crucially, it does so without immediately repopulating it with already-given 'capture' tasks again, because of this line:
https://github.com/Decane/SRP/blob/4b4a2b132bc71884d58d10e61190eef1d6b18abd/gamedata/scripts/sim_squad_generic.script#L769
... which demands that no combat task is active against the smart terrain the squad is stationed on.