here the problem:Spoiler Alert, click show to read:
I want to check if a faction is allied with anybody is holding a specific settlement.
of course I cannot use this
becouse the DiplomaticStanceFromFaction does not work with ifs.Code:monitor_event FactionTurnStart [some conditions] if I_SettlementOwner Big_City = milan and DiplomaticStanceFromFaction milan = Allied console_command victory scotland end_if if I_SettlementOwner Big_City = venice and DiplomaticStanceFromFaction venice = Allied console_command victory scotland end_if end_monitor
Since checking the alliances for each faction would be having something like 109 monitors, I was wandering if some workaround was possible.
The idea that come in my mind is, if possible, to change the faction labels.
so then the 1st script becomes:Code:monitor_event FactionTurnEnd TrueCondition if I_SettlementOwne Big_City = venice command: label venice into global_king ; Is there any command? I can't find anything in my docudemos end_if if I_SettlementOwne Big_City = milan command: label milan into global_king end_if end_mointor
thanks in advance.Code:monitor_event FactionTurnStart [some conditions] and DiplomaticStanceFromFaction global_king = Allied console_command victory scotland end_if if I_SettlementOwner Big_City = venice and DiplomaticStanceFromFaction global_king = Allied console_command victory scotland end_if end_monitor
EDIT solved it. here the solution
Spoiler Alert, click show to read:
you use a counter for each faction
then you use a monitor firing at PreFactionTurnStartCode:declare counter faction1_alliance ;0 neutral, 1 allied declare counter faction2_alliance declare counter faction3_alliance declare counter faction4_alliance declare counter faction5_alliance
this must be repeated for each faction.Code:monitor_event PreFactionTurnStart TrueCondition and DiplomaticStanceFromFaction faction1 = Allied set_counter faction1_alliance end_monitor
then at turn's end each counter is set again to 0
So the main script becomes:Code:monitor_event FactionTurnEnd TrueCondition ;Set counters to 0 at turn's end set_counter faction1_alliance 0 set_counter faction2_alliance 0 set_counter faction3_alliance 0 set_counter faction4_alliance 0 set_counter faction5_alliance 0 end_monitor
Code:monitor_event FactionTurnStart [some conditions] if I_SettlementOwner Big_City = milan and I_CompareCounter milan_alliance = 1 console_command victory scotland end_if if I_SettlementOwner Big_City = venice and CompareCounter venice_alliance = 1 console_command victory scotland end_if end_monitor
BUT this leads to a big number of monitors firing during passage of turn - wich is a bad thing. Does anybody have an alternative solution (= less time consuming?)




Reply With Quote





