Я написал экономический скрипт для АИ с целью уберечь АИ от ухода в минус по деньгам. Вот этот скрипт, variable заменяется на название фракции с помощью репликатора, атрибут disband проставляется в EDU:
Экономический скрипт (Раскрыть)
monitor_event PreFactionTurnStart FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and Treasury < 1500
and FactionIncome < 0
freeze_recruit_pool all true
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and Treasury < 2500
and FactionIncome < -500
freeze_recruit_pool all true
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and Treasury < 4000
and FactionIncome < -1000
freeze_recruit_pool all true
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and Treasury < 6000
and FactionIncome < -1750
freeze_recruit_pool all true
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and Treasury < 9000
and FactionIncome < -2750
freeze_recruit_pool all true
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and Treasury < 13500
and FactionIncome < -4000
freeze_recruit_pool all true
end_monitor
declare_counter treasury
monitor_event PreFactionTurnStart FactionType variable
and Treasury < 1500
set_counter treasury 1
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and Treasury < 2500
set_counter treasury 2
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and Treasury < 4000
set_counter treasury 3
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and Treasury < 6000
set_counter treasury 4
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and Treasury < 9000
set_counter treasury 5
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and Treasury < 13500
set_counter treasury 6
end_monitor
monitor_event AddedToTrainingQueue FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and I_CompareCounter treasury = 1
and FactionIncome < 0
freeze_recruit_pool all true
end_monitor
monitor_event AddedToTrainingQueue FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and I_CompareCounter treasury = 2
and FactionIncome < -500
freeze_recruit_pool all true
end_monitor
monitor_event AddedToTrainingQueue FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and I_CompareCounter treasury = 3
and FactionIncome < -1000
freeze_recruit_pool all true
end_monitor
monitor_event AddedToTrainingQueue FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and I_CompareCounter treasury = 4
and FactionIncome < -1750
freeze_recruit_pool all true
end_monitor
monitor_event AddedToTrainingQueue FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and I_CompareCounter treasury = 5
and FactionIncome < -2750
freeze_recruit_pool all true
end_monitor
monitor_event AddedToTrainingQueue FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and I_CompareCounter treasury = 6
and FactionIncome < -4000
freeze_recruit_pool all true
end_monitor
monitor_event CharacterTurnEnd I_IsFactionAIControlled
and AgentType = admiral
and RemainingMPPercentage = 100
set_event_counter destroyinactive 1
end_monitor
monitor_event FactionTurnEnd FactionType variable
and I_IsFactionAIControlled
and Treasury < 0
and I_CompareCounter month == 1
destroy_units variable disband_3
end_monitor
monitor_event FactionTurnEnd FactionType variable
and I_IsFactionAIControlled
and Treasury < 0
and I_CompareCounter month == 2
destroy_units variable disband_4
end_monitor
monitor_event FactionTurnEnd FactionType variable
and I_IsFactionAIControlled
and Treasury < 0
and I_CompareCounter month == 3
destroy_units variable disband_5
end_monitor
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and Treasury < 1500
and FactionIncome < 0
freeze_recruit_pool all true
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and Treasury < 2500
and FactionIncome < -500
freeze_recruit_pool all true
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and Treasury < 4000
and FactionIncome < -1000
freeze_recruit_pool all true
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and Treasury < 6000
and FactionIncome < -1750
freeze_recruit_pool all true
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and Treasury < 9000
and FactionIncome < -2750
freeze_recruit_pool all true
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and Treasury < 13500
and FactionIncome < -4000
freeze_recruit_pool all true
end_monitor
declare_counter treasury
monitor_event PreFactionTurnStart FactionType variable
and Treasury < 1500
set_counter treasury 1
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and Treasury < 2500
set_counter treasury 2
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and Treasury < 4000
set_counter treasury 3
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and Treasury < 6000
set_counter treasury 4
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and Treasury < 9000
set_counter treasury 5
end_monitor
monitor_event PreFactionTurnStart FactionType variable
and Treasury < 13500
set_counter treasury 6
end_monitor
monitor_event AddedToTrainingQueue FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and I_CompareCounter treasury = 1
and FactionIncome < 0
freeze_recruit_pool all true
end_monitor
monitor_event AddedToTrainingQueue FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and I_CompareCounter treasury = 2
and FactionIncome < -500
freeze_recruit_pool all true
end_monitor
monitor_event AddedToTrainingQueue FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and I_CompareCounter treasury = 3
and FactionIncome < -1000
freeze_recruit_pool all true
end_monitor
monitor_event AddedToTrainingQueue FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and I_CompareCounter treasury = 4
and FactionIncome < -1750
freeze_recruit_pool all true
end_monitor
monitor_event AddedToTrainingQueue FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and I_CompareCounter treasury = 5
and FactionIncome < -2750
freeze_recruit_pool all true
end_monitor
monitor_event AddedToTrainingQueue FactionType variable
and I_IsFactionAIControlled
and not I_FactionBesieged variable
and not IsCrusadeTargetFaction
and not IsJihadTargetFaction
and I_CompareCounter treasury = 6
and FactionIncome < -4000
freeze_recruit_pool all true
end_monitor
monitor_event CharacterTurnEnd I_IsFactionAIControlled
and AgentType = admiral
and RemainingMPPercentage = 100
set_event_counter destroyinactive 1
end_monitor
monitor_event FactionTurnEnd FactionType variable
and I_IsFactionAIControlled
and Treasury < 0
and I_CompareCounter month == 1
destroy_units variable disband_3
end_monitor
monitor_event FactionTurnEnd FactionType variable
and I_IsFactionAIControlled
and Treasury < 0
and I_CompareCounter month == 2
destroy_units variable disband_4
end_monitor
monitor_event FactionTurnEnd FactionType variable
and I_IsFactionAIControlled
and Treasury < 0
and I_CompareCounter month == 3
destroy_units variable disband_5
end_monitor
Но, мне сказали, что команда freeze_recruit_pool all работает для всех фракций, и соответственно неприменима.
С другой стороны из другого экономического скрипта я почерпнул вот это:
if I_CompareCounter turn_fid = 14
destroy_units milan, mercenary_unit
add_money milan -2147478647
add_money milan 2147483647
add_money milan 101
set_counter freeze_milan 0
set_event_counter freeze_recr_pool 1
end_if
То есть, если я напишу set_event_counter freeze_recr_pool 1, это будет работать?