Random counters used in monitors below
Code:
monitor_event PreFactionTurnStart FactionIsLocal
generate_random_counter 1jahr 1 12
generate_random_counter 2jahre 1 24
generate_random_counter 3jahre 1 36
generate_random_counter 5jahre 1 60
generate_random_counter 6jahre 1 72
generate_random_counter 7jahre 1 84
generate_random_counter 8jahre 1 96
generate_random_counter prozent 1 100
end_monitor
Variable harvest from 1648
Code:
monitor_event PreFactionTurnStart FactionIsLocal
and I_CompareCounter month = 8 ; triggered in August
if I_CompareCounter hunger = 0
if I_EventCounter prozent < 21
historic_event ernte_gut
end_if
if I_EventCounter prozent > 80
historic_event ernte_schlecht ; used in further events of this nature
end_if
end_if
if I_CompareCounter hunger = 1
historic_event ernte_hunger
end_if
end_monitor
monitor_event PreFactionTurnStart FactionIsLocal
and I_CompareCounter month = 6 ; reversal in June the following year
if I_EventCounter ernte_gut = 1
set_event_counter ernte_gut 0
end_if
if I_EventCounter ernte_schlecht = 1
set_event_counter ernte_schlecht 0
end_if
end_monitor
Capability in hinterland_farms (EDB) - number increases with each level
Code:
farming_level 1 requires factions { all, } and not event_counter ernte_gut 1
farming_level 2 requires factions { all, } and event_counter ernte_gut 1
Simulated sickness from 1648
Code:
;--- Lepra ---
declare_counter abzess
monitor_event PreFactionTurnStart FactionIsLocal
and I_EventCounter 5jahre = 59
and I_TurnNumber > 3
historic_event seuche_4
end_monitor
monitor_event PreFactionTurnStart FactionIsLocal
if I_EventCounter seuche_4 = 1
inc_counter abzess 1
end_if
if I_CompareCounter abzess = 2
set_event_counter seuche_4 0
set_counter abzess 0
end_if
end_monitor
;--- Pest! ---
declare_counter beule
monitor_event PreFactionTurnStart FactionIsLocal
and I_EventCounter 3jahre = 32
and I_TurnNumber > 3
historic_event seuche_3
end_monitor
monitor_event PreFactionTurnStart FactionIsLocal
if I_EventCounter seuche_3 = 1
inc_counter beule 1
end_if
if I_CompareCounter beule = 2
set_event_counter seuche_3 0
set_counter beule 0
end_if
end_monitor
;--- Schwindsucht ---
declare_counter schwind
monitor_event PreFactionTurnStart FactionIsLocal
and I_EventCounter 3jahre = 33
and I_TurnNumber > 3
historic_event seuche_2
end_monitor
monitor_event PreFactionTurnStart FactionIsLocal
if I_EventCounter seuche_2 = 1
inc_counter schwind 1
end_if
if I_CompareCounter schwind = 2
set_event_counter seuche_2 0
set_counter schwind 0
end_if
end_monitor
;--- Syphilis ---
declare_counter syphilis
monitor_event PreFactionTurnStart FactionIsLocal
and I_EventCounter 3jahre = 34
and I_TurnNumber > 3
historic_event seuche_1
end_monitor
monitor_event PreFactionTurnStart FactionIsLocal
if I_EventCounter seuche_1 = 1
inc_counter syphilis 1
end_if
if I_CompareCounter syphilis = 2
set_event_counter seuche_1 0
set_counter syphilis 0
end_if
end_monitor
Capability in core_building (EDB) - number increases with each level
Code:
population_growth_bonus bonus -2 requires factions { all, } and event_counter seuche_1 1 or event_counter seuche_2 1 or event_counter seuche_3 1 or event_counter seuche_4 1