Code:
; Campaign script
;
script
; ---------------------
; counters
declare_counter Opened_Faction_Overview_Scroll
declare_counter Opened_Settlement_Scroll
declare_counter mongols_sarkel
declare_counter mongols_yerevan
declare_counter mongols_baghdad
declare_counter timurids_sarkel
declare_counter timurids_yerevan
declare_counter timurids_baghdad
declare_counter_difficulty
declare_counter_diificulty_easy
declare_counter_difficulty_medium
declare_counter_difficulty_hard
declare_counter_difficulty_very_hard
; ---------------------
; start up
freeze_faction_ai aztecs
;----------------------
; monitors
;------------ Scripting Class Customs ------------
;-- Difficulty Script
monitor_event FactionTurnStart FactionIsLocal
and CampaignDifficulty = easy
set_event_counter difficulty_easy 1
set_event_counter difficulty_medium 0
set_event_counter difficulty_hard 0
set_event_counter difficulty_very_hard 0
terminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and CampaignDifficulty = medium
set_event_counter difficulty_easy 0
set_event_counter difficulty_medium 1
set_event_counter difficulty_hard 0
set_event_counter difficulty_very_hard 0
terminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and CampaignDifficulty = hard
set_event_counter difficulty_easy 0
set_event_counter difficulty_medium 0
set_event_counter difficulty_hard 1
set_event_counter difficulty_very_hard 0
terminate_monitor
end_monitor
monitor_event FactionTurnStart FactionIsLocal
and CampaignDifficulty = very_hard
set_event_counter difficulty_easy 0
set_event_counter difficulty_medium 0
set_event_counter difficulty_hard 0
set_event_counter difficulty_very_hard 1
terminate_monitor
end_monitor
;-- End of Difficulty Script
;-- England - Challenge Scripts (Basic Assignment)
monitor_event FactionTurnStart FactionIsLocal
and FactionType england
if I_EventCounter difficulty_easy = 1
set_kings_purse england 3000
end_if
if I_EventCounter difficulty_medium = 1
set_kings_purse england 2500
end_if
if I_EventCounter difficulty_hard = 1
set_kings_purse england 2000
end_if
if I_EventCounter difficulty_very_hard = 1
set_kings_purse england 1500
end_if
terminate_monitor
end_monitor
monitor_event GeneralCaptureSettlement SettlementName Paris
and FactionType england
spawn_army
faction france
character Godfrey Mauvoisin, named character, age 35, x 99, y 124
traits GoodCommander 2
unit NE Bodyguard exp 1 armour 0 weapon_lvl 0
end
terminate_monitor
end_monitor
;-- End of England - Challenge Scripts (Basic Assignment)
;-- Portugal - Challenge Scripts (Advanced Assignment)
monitor_event FactionTurnStart FactionIsLocal
and FactionType portugal
if I_EventCounter difficulty_easy = 1
set_kings_purse portugal 2500
end_if
if I_EventCounter difficulty_medium = 1
set_kings_purse portugal 2000
end_if
if I_EventCounter difficulty_hard = 1
set_kings_purse portugal 1500
end_if
if I_EventCounter difficulty_very_hard = 1
set_kings_purse portugal 1000
end_if
terminate_monitor
end_monitor
monitor_event EventCounter EventCounterType portugese_insurrection_imminent
and EventCounter > 0
if I_EventCounter portugese_insurrection_imminent == 1
add_events
event counter portugese_insurrection
date 5
end_add_events
end_if
if I_EventCounter portugese_insurrection_imminent == 2
terminate_monitor
end_if
end_monitor
monitor_event EventCounter EventCounterType portugese_insurrection
and EventCounter > 0
if I_EventCounter difficulty_easy = 1
spawn_army
faction slave
character Milorad Cavic, named character, age 24, x 63, y 93
traits FearsPortugal 2 , GoodCommander 3 , BadRiskyAttacker 2 ,
HaleAndHearty 2 , Intelligent 2 , BattleChivalry 2 , Gregarious 1 , TourneyKnight 4
unit SE Bodyguard exp 2 armour 0 weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Pavise Crossbowmen exp 0 armour 0
weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
end
spawn_army
faction portugal
character Michael Phelps, named character, age 23, x 63, y 92
traits Disciplinarian 1 , GoodDefender 5 , Energetic 4 ,
StrategicSkill 2 , VictorVirtue 3 , Stoic 1 , GoodCommander 3 , Fertile 3 , HaleAndHearty 3
, Intelligent 3 , Genocide 3 , BattleDread 1 , Gregarious 3 , FactionKiller 4,
TourneyKnight 5
unit SE Late Bodyguard exp 5 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Jinetes exp 0 armour 0 weapon_lvl 0
unit Jinetes exp 0 armour 0 weapon_lvl 0
unit Pavise Crossbowmen exp 0 armour 0
weapon_lvl 0
unit Pavise Crossbowmen exp 0 armour 0
weapon_lvl 0
unit Pavise Crossbowmen exp 0 armour 0
weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
end
end_if
if I_EventCounter difficulty_medium = 1
spawn_army
faction slave
character Milorad Cavic, named character, age 24, x 63, y 93
traits FearsPortugal 2 , GoodCommander 3 , BadRiskyAttacker 2 ,
HaleAndHearty 2 , Intelligent 2 , BattleChivalry 2 , Gregarious 1 , TourneyKnight 4
unit SE Bodyguard exp 2 armour 0 weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Pavise Crossbowmen exp 0 armour 0
weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
end
spawn_army
faction portugal
character Michael Phelps, named character, age 23, x 63, y 92
traits Disciplinarian 1 , GoodDefender 5 , Energetic 4 ,
StrategicSkill 2 , VictorVirtue 3 , Stoic 1 , GoodCommander 3 , Fertile 3 , HaleAndHearty 3
, Intelligent 3 , Genocide 3 , BattleDread 1 , Gregarious 3 , FactionKiller 4,
TourneyKnight 5
unit SE Late Bodyguard exp 5 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Pavise Crossbowmen exp 0 armour 0
weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
end
end_if
if I_EventCounter difficulty_hard = 1
spawn_army
faction slave
character Milorad Cavic, named character, age 24, x 63, y 93
traits FearsPortugal 2 , GoodCommander 3 , BadRiskyAttacker 2 ,
HaleAndHearty 2 , Intelligent 2 , BattleChivalry 2 , Gregarious 1 , TourneyKnight 4
unit SE Bodyguard exp 2 armour 0 weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Jinetes exp 0 armour 0 weapon_lvl 0
unit Jinetes exp 0 armour 0 weapon_lvl 0
unit Pavise Crossbowmen exp 0 armour 0
weapon_lvl 0
unit Pavise Crossbowmen exp 0 armour 0
weapon_lvl 0
unit Pavise Crossbowmen exp 0 armour 0
weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
end
spawn_army
faction portugal
character Michael Phelps, named character, age 23, x 63, y 92
traits Disciplinarian 1 , GoodDefender 5 , Energetic 4 ,
StrategicSkill 2 , VictorVirtue 3 , Stoic 1 , GoodCommander 3 , Fertile 3 , HaleAndHearty 3
, Intelligent 3 , Genocide 3 , BattleDread 1 , Gregarious 3 , FactionKiller 4,
TourneyKnight 5
unit SE Late Bodyguard exp 5 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Jinetes exp 0 armour 0 weapon_lvl 0
unit Pavise Crossbowmen exp 0 armour 0
weapon_lvl 0
unit Pavise Crossbowmen exp 0 armour 0
weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
end
end_if
if I_EventCounter difficulty_very_hard = 1
spawn_army
faction slave
character Milorad Cavic, named character, age 24, x 63, y 93
traits FearsPortugal 2 , GoodCommander 3 , BadRiskyAttacker 2 ,
HaleAndHearty 2 , Intelligent 2 , BattleChivalry 2 , Gregarious 1 , TourneyKnight 4
unit SE Bodyguard exp 2 armour 0 weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Jinetes exp 0 armour 0 weapon_lvl 0
unit Jinetes exp 0 armour 0 weapon_lvl 0
unit Pavise Crossbowmen exp 0 armour 0
weapon_lvl 0
unit Pavise Crossbowmen exp 0 armour 0
weapon_lvl 0
unit Pavise Crossbowmen exp 0 armour 0
weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
end
spawn_army
faction portugal
character Michael Phelps, named character, age 23, x 63, y 92
traits Disciplinarian 1 , GoodDefender 5 , Energetic 4 ,
StrategicSkill 2 , VictorVirtue 3 , Stoic 1 , GoodCommander 3 , Fertile 3 , HaleAndHearty 3
, Intelligent 3 , Genocide 3 , BattleDread 1 , Gregarious 3 , FactionKiller 4,
TourneyKnight 5
unit SE Late Bodyguard exp 5 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Knights of Santiago exp 0 armour 0
weapon_lvl 0
unit Pavise Crossbowmen exp 0 armour 0
weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Portugese Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
unit Dismounted Feudal Knights exp 0
armour 0 weapon_lvl 0
end
end_if
terminate_monitor
end_monitor
;-- End of Portugal - Challenge Scripts (Advanced Assignment)
;-- End of Scripting Class Customs
My script uses a historic event in order to trigger the insurrection, and then spawns armies for Portugal and Slave factions based on the difficulty counter. I tried to spawn the portugal faction on a river crossing and the slave one north, so they'd battle quickly. For the basic script you'll want to play as England for the desired effect, and you'll want to play as Portugal for the advanced effect(though it should trigger for any faction). Also, the code tags on the forum may or may not be wrongly separating my traits/army lines, obviously if they copy-paste wrong, then it was code reformatting that messed up the syntax. You might also notice some easter eggs if you check the character names and the event description