Here's the updated parts of the Roman script, including the updated unit refresh to counter the effect of the first reform zero-ing everything, a possible fix to the Carthaginian battle trigger for the Polybian reform, the correct region id's for the early Marian trigger and fixed typo on the Marian fallback.
Code:
; === Roman Reforms ===
;; TO DO: Augustan reforms (Traits required)
set_event_counter ecCamillanEra 1
set_event_counter ecPolybianEra 0
inc_recruit_pool region_040 1 roman cavalry equites camillan ;;; one-time refill of recruitment pool in Rome to offset its deplenishment by event counter reset
inc_recruit_pool region_040 2 roman infantry hastati camillan
inc_recruit_pool region_040 1 roman infantry principes camillan
inc_recruit_pool region_040 1 roman infantry triarii camillan
inc_recruit_pool region_040 2 roman infantry leves
inc_recruit_pool region_038 1 italic cavalry sabellian ;;; one-time refill of Arretium to offset deplenishment
inc_recruit_pool region_038 1 italic infantry etruscan
inc_recruit_pool region_038 1 italic infantry samnites spearmen
inc_recruit_pool region_038 1 roman infantry leves
inc_recruit_pool region_041 1 italic cavalry sabellian ;;; one-time refill of Arpi to offset deplenishment
inc_recruit_pool region_041 1 italic infantry samnites spearmen
inc_recruit_pool region_041 1 roman infantry leves
inc_recruit_pool region_042 1 italic cavalry sabellian ;;; one-time refill of Capua to offset deplenishment
inc_recruit_pool region_042 1 italic infantry samnites spearmen
inc_recruit_pool region_042 1 roman infantry leves
inc_recruit_pool region_042 1 hellenistic cavalry hippakontistai
inc_recruit_pool region_042 1 hellenistic infantry hoplitai haploi
inc_recruit_pool region_042 1 hellenistic infantry akontistai
inc_recruit_pool region_044 1 italic infantry samnites spearmen ;;; one-time refill of Taras recruitment pool to offset deplenishment by event counter reset above
declare_counter cisalpine_battles
declare_counter carthage_battles
declare_counter marian_possible
declare_counter augustan_possible
monitor_event PostBattle FactionType f_rome ;;; Check large battles in Cisalpine - not necessarily victorious ones
and IsRegionOneOf 88 87 75 76 96 77 95 ;;; Felsina 88, Segesta 87, Medilanon 75, Patavium 76, Massalia 96, Segestica 77, Dalminion 95 (in this order)
and I_BattleEnemyArmyNumberOfUnits > 10 ;;; Include only large battles
if I_EventCounter ecCamillanEra < 0
inc_counter cisalpine_battles 1
end_if
if I_EventCounter ecPolybianEra > 0 ;;; Terminate monitor once reforms happened
terminate_monitor
end_if
end_monitor
monitor_event PostBattle FactionType f_rome ;;; Check large battles against Carthage - not necessarily victorious ones
and GeneralFoughtFaction f_carthage
and not I_ConflictType Naval ;;; Exclude naval battles - reforms are about line infantry only
and I_BattleEnemyArmyNumberOfUnits > 10 ;;; Include only large battles
if I_EventCounter ecCamillanEra < 0
inc_counter carthage_battles 1
end_if
if I_EventCounter ecPolybianEra > 0 ;;; Terminate monitor once reforms happened
terminate_monitor
end_if
end_monitor
monitor_event FactionTurnStart FactionType f_rome
if I_TurnNumber > 100 ;;; to prevent the reforms happening almost off-the-bat
and I_CompareCounter cisalpine_battles > 3
and I_CompareCounter carthage_battles > 4
set_event_counter ecCamillanEra 0
set_event_counter ecPolybianEra 1
historic_event HE_POLYBIAN_REFORM factions { f_rome, }
terminate_monitor
end_if
if I_TurnNumber > 120
and I_SettlementOwner sett_035 = f_rome ;;; Segesta
and I_SettlementOwner sett_036 = f_rome ;;; Patava
and I_SettlementOwner sett_037 = f_rome ;;; Felsina
and I_SettlementOwner sett_047 = f_rome ;;; Syrakousai
and I_SettlementOwner sett_046 = f_rome ;;; Messana
and I_SettlementOwner sett_045 = f_rome ;;; Lilibeo
set_event_counter ecCamillanEra 0
set_event_counter ecPolybianEra 1
historic_event HE_POLYBIAN_REFORM factions { f_rome, }
terminate_monitor
end_if
if I_IsFactionAIControlled f_rome ;;; automatic reforms for AI Rome
and I_TurnNumber > 200
and I_EventCounter ecCamillanEra > 0
set_event_counter ecCamillanEra 0
set_event_counter ecPolybianEra 1
terminate_monitor
end_if
if not I_IsFactionAIControlled f_rome ;;; fall-back automatic reforms for player-controlled Rome
and I_TurnNumber > 248
and I_EventCounter ecCamillanEra > 0
set_event_counter ecCamillanEra 0
set_event_counter ecPolybianEra 1
historic_event HE_POLYBIAN_REFORM factions { f_rome, }
terminate_monitor
end_if
end_monitor
;
; Check conditions for the Marian reform
;
monitor_event PreFactionTurnStart FactionType f_rome
and I_TurnNumber > 500 ;;; 147 BC - earliest possible date
set_counter marian_possible 0 ;;; reset counter every turn
if I_EventCounter ecMarianEra > 0 ;;; terminate monitor once no longer needed
terminate_monitor
end_if
if I_TurnNumber > 660 ;;; If there is 107 BC when Marian reforms happened IRL...
and I_EventCounter ecPolybianEra > 0 ;;; ...and reforms had not happened already...
set_event_counter ecPolybianEra 0 ;;; ...trigger the reforms as fall-back for AI and unlucky player.
set_event_counter ecMarianEra 1
historic_event HE_MARIAN_REFORM factions { f_rome, }
terminate_monitor
end_if
end_monitor
monitor_event SettlementTurnStart FactionType f_rome
and I_TurnNumber > 500 ;;; 147 BC - earliest possible date
and IsRegionOneOf 99 97 112 124 128 131 140 ;;; Etruria 99, Umbria 97, Latium 112, Apulia 124, Campania 128, Kalabria 131, Brettia 140 - count only those in Italy
and SettlementBuildingExists > farms_six ;;; count Latifundiae and land reforms as sources of social tension and dispossession leading to reform
if I_EventCounter ecPolybianEra > 0
inc_counter marian_possible 1
end_if
if I_CompareCounter marian_possible > 5
set_event_counter ecMarianPossible 1 ;;; Once the social/agricultural development reaches the threshold switch-on EDCT condition...
terminate_monitor ;;; ... and terminate monitor
end_if
end_monitor
monitor_event CharacterTurnStart FactionType f_rome
and Trait Reformator > 1 ;;; First level enabled by ecMarianPossible, second one by being a consul.
set_event_counter ecPolybianEra 0
set_event_counter ecMarianEra 1
historic_event HE_MARIAN_REFORM ; might as well let the world know about the reform
terminate_monitor
end_monitor
Bookmarks