
Originally Posted by
gsthoed
...a script that causes CTDs on demand...I cannot imagine how to check for...
I know that the point is moot now and I'm not sure that the above is actually what you were asking, but... one way to script a CTD is by calling historic_event with a name that does not exist in historic_events.txt.

Originally Posted by
gsthoed
I believe we are a little off topic when we discuss about scripted garrison reinforcements, but here it is...
It was off topic but your solution's while loop brings it back.
Well, to the topic of while loops at least which strictly speaking was also off topic.
Good thinking with the Transgression event. I have never used it myself because I seem to recall that it can only fire once per turn - that is from something I read once but it might have been that certain transgression types can only happen once per turn, e.g. war declared between the same two factions, or maybe it wasn't the Transgression event at all that I'm remembering. Anyway...
If somebody lays siege to any norway settlement or fort before Trondhelm then that while loop runs forever - checking 20 times per second whether Trondhelm is under siege - until somebody does finally lay siege to Trondhelm. In that respect I suspect that it's no different to the original monitor_conditions script, lag wise, except that it only happens for sections of the campaign lifetime - begins when somebody lays siege to norway and ends when Trondhelm is under siege - instead of all of the time.
As far as I can see it could be rewritten as just...
Code:
monitor_event Transgression TransgressionName = TC_INSTIGATE_SIEGE
and TargetFactionType norway
and I_SettlementOwner Trondhelm = norway
and I_SettlementUnderSiege Trondhelm
create_unit Trondhelm, nor_noble_axemen, num 4, exp 2, arm 1, wep 0
create_unit Trondhelm, nor_karlar, num 2, exp 2, arm 1, wep 0
create_unit Trondhelm, nor_shieldwallmen, num 3, exp 2, arm 1, wep 0
create_unit Trondhelm, nor_rekka, num 4, exp 2, arm 1, wep 0
create_unit Trondhelm, nor_Langbogmenn, num 2, exp 2, arm 1, wep 0
create_unit Trondhelm, nor_hr_norsk, num 2, exp 2, arm 1, wep 0
end_monitor
...or am I missing something? Perhaps that at the time of a TC_INSTIGATE_SIEGE event firing the settlement in question is not yet actually under siege, so I_SettlementUnderSiege doesn't work?
Either way there is another issue: if norway-owned Trondhelm is under siege when somebody lays siege to any other norway settlement/fort then this monitor will execute again, adding more units to Trondhelm.
EDIT:

Originally Posted by
Me
Perhaps that at the time of a TC_INSTIGATE_SIEGE event firing the settlement in question is not yet actually under siege, so I_SettlementUnderSiege doesn't work?
I just tried it and this is exactly what happens. Unfortunately that kind of thing happens sometimes.
However, this works...
Code:
monitor_event Transgression TransgressionName = TC_INSTIGATE_SIEGE
and TargetFactionType norway
and I_SettlementOwner Trondhelm = norway
campaign_wait 0.1
if I_SettlementUnderSiege Trondhelm
create_unit Trondhelm, nor_noble_axemen, num 4, exp 2, arm 1, wep 0
create_unit Trondhelm, nor_karlar, num 2, exp 2, arm 1, wep 0
create_unit Trondhelm, nor_shieldwallmen, num 3, exp 2, arm 1, wep 0
create_unit Trondhelm, nor_rekka, num 4, exp 2, arm 1, wep 0
create_unit Trondhelm, nor_Langbogmenn, num 2, exp 2, arm 1, wep 0
create_unit Trondhelm, nor_hr_norsk, num 2, exp 2, arm 1, wep 0
end_if
end_monitor
The campaign_wait gives the game some 'time' to realise that Trondhelm is now under siege.