Thanks, Jadli!
Actually I didn't have time to work on the upkeep for the captains. This would be useful, although I'd like to limit it by adding a high probability for the desertion of the armies-without-generals plus adding a BC-B&S script preventing the armies to undertake attacks unless there's a general in such an army.
Secondary generals receiving the trait (and thus incurring additional costs) are not a problem as the player should be discuraged from sending "spare generals" for the campaings and then those secondary ones taking over the role of primary ones (so eschew the consequences of the supply trait/system).
As far as the system is concerned, there're two levels of costs for sieging; there're also costs while traveling by sea.
Code:
;================== AT SEA COSTS ======================================= info through a trait gain message monitor_event CharacterTurnStart CharacterIsLocal
and IsGeneral
and Trait AtSeaCost = 1
log --- At sea costs --- -500
console_command add_money -500
end_monitor
monitor_event CharacterTurnStart CharacterIsLocal
and IsGeneral
and Trait AtSeaCost = 2
log --- At sea costs --- -1000
console_command add_money -1000
end_monitor
;================== SUPPLY & BESIEGE COSTS =========================== info through a trait gain message
monitor_event CharacterTurnStart CharacterIsLocal
and IsGeneral
and Trait ArmyCost = 1
log --- Army costs --- -250
console_command add_money -250
end_monitor
monitor_event CharacterTurnStart CharacterIsLocal
and IsGeneral
and Trait ArmyCost = 2
log --- Army costs --- -500
console_command add_money -500
end_monitor
monitor_event CharacterTurnStart CharacterIsLocal
and IsGeneral
and Trait ArmyCost = 3
log --- Army costs --- -1000
console_command add_money -1000
end_monitor
monitor_event CharacterTurnStart CharacterIsLocal
and IsGeneral
and Trait ArmyCost = 4
log --- Army costs --- -1500
console_command add_money -1500
end_monitor
monitor_event CharacterTurnStart CharacterIsLocal
and IsGeneral
and Trait ArmyCost = 5
log --- Army costs --- -2000
console_command add_money -2000
end_monitor
Code:
;======================================================== Supply and Siege Costs;----- Supply and Siege Costs ---------------------------
;-- used with script
;-- the triggers are ordered in (logically) reverse way but keep this order - this economises on the triggers
;-- it's also easy to add other criteria for moving 1->2 and 2->3
;-- in one of the GeneralCaptureSettlement triggers there's a drop of ArmyCosts to 0
;-- IDEA: introduce at some point criterium related to 1. Embezzler, 2. King having a crown
;------------------------------------------ 5->0
Trigger ArmyCost_Remove_BackHome
WhenToTest CharacterTurnEnd ; it's possible that at the end you're in enemy lands, but after the AI attack you're in home lands - so use End
Condition IsGeneral
and CharacterIsLocal
and not InEnemyLands
and Trait ArmyCost > 0
Affects ArmyCost -5 Chance 100
;------------------------------------------ 5->0
Trigger ArmyCost_Remove_SecondaryGeneral
WhenToTest CharacterTurnEnd
Condition IsGeneral
and CharacterIsLocal
and TimeWithArmy > 0 ; the first general in the army doesn't get this attribute
and Trait ArmyCost > 0
Affects ArmyCost -5 Chance 100
;------------------------------------------ X->0 (settlement captured event is in another place)
Trigger ArmyCost_Remove_BattleLost ; this trigger is to avoid having the traits when after the battle the army retreats to home territory
WhenToTest PostBattle
Condition not WonBattle
and Trait ArmyCost > 0
Affects ArmyCost -5 Chance 100
;------------------------------------------ 5->1
Trigger ArmyCost_Siege_Remove_Engineer
WhenToTest CharacterTurnEnd
Condition IsGeneral
and InEnemyLands
and not IsBesieging
and Trait ArmyCost > 4
Affects ArmyCost -4 Chance 100
;------------------------------------------ 4->1
Trigger ArmyCost_Siege_Remove_NoEng
WhenToTest CharacterTurnEnd
Condition IsGeneral
and InEnemyLands
and not IsBesieging
and Trait ArmyCost > 3
Affects ArmyCost -3 Chance 100
;------------------------------------------ 0->1, 250 fl.
Trigger ArmyCost_Campaign_HighLogistics
WhenToTest CharacterTurnEnd
Condition IsGeneral
and CharacterIsLocal
and InEnemyLands
and TimeWithArmy < 1
and not AtSea
and not IsOnCrusade
and not IsOnJihad
and Trait ArmyCost < 1
and I_EventCounter DifficultyLevel = 4
Affects ArmyCost 1 Chance 100
;------------------------------------------ 1->2, 500 fl.
Trigger ArmyCost_Campaign_AverageLogistics
WhenToTest CharacterTurnEnd
Condition IsGeneral
and CharacterIsLocal
and InEnemyLands
and not AtSea
and not IsOnCrusade
and not IsOnJihad
and Trait ArmyCost < 2
and Trait LogisticalSkill < 2
and Trait Military_Edu < 4
and Trait NaturalMilitarySkill < 4
and not CharacterReligion pagan
and I_EventCounter DifficultyLevel = 4
Affects ArmyCost 1 Chance 100
;------------------------------------------ 2->3, 1000 fl.
Trigger ArmyCost_Campaign_LowLogistics
WhenToTest CharacterTurnEnd
Condition IsGeneral
and CharacterIsLocal
and InEnemyLands
and not AtSea
and not IsOnCrusade
and not IsOnJihad
and Trait ArmyCost < 3
and Trait LogisticalSkill < 1
and Trait Military_Edu < 3
and Trait NaturalMilitarySkill < 3
and not HasAncType MilitaryEngineer
and not CharacterReligion pagan
and I_EventCounter DifficultyLevel = 4
Affects ArmyCost 1 Chance 100
;------------------------------------------ just a safety valve if the Med2 engine goes nuts
Trigger ArmyCost_Siege_Started_from_Home
WhenToTest CharacterTurnEnd
Condition IsBesieging
and CharacterIsLocal
and TimeWithArmy < 1
and not IsOnCrusade
and not IsOnJihad
and Trait ArmyCost < 1
and I_EventCounter DifficultyLevel = 4
Affects ArmyCost 4 Chance 100
;------------------------------------------ 1->4
Trigger ArmyCost_Siege_Started_HighLogistics
WhenToTest CharacterTurnEnd
Condition IsBesieging
and CharacterIsLocal
and not IsOnCrusade
and not IsOnJihad
and Trait ArmyCost < 2
and Trait ArmyCost > 0
and I_EventCounter DifficultyLevel = 4
Affects ArmyCost 3 Chance 100
;------------------------------------------ 2->4
Trigger ArmyCost_Siege_Started_AverageLogistics
WhenToTest CharacterTurnEnd
Condition IsBesieging
and CharacterIsLocal
and not IsOnCrusade
and not IsOnJihad
and Trait ArmyCost < 3
and Trait ArmyCost > 1
and I_EventCounter DifficultyLevel = 4
Affects ArmyCost 2 Chance 100
;------------------------------------------ 3->4
Trigger ArmyCost_Siege_Started_LowLogistics
WhenToTest CharacterTurnEnd
Condition IsBesieging
and CharacterIsLocal
and not IsOnCrusade
and not IsOnJihad
and Trait ArmyCost < 4
and Trait ArmyCost > 2
and I_EventCounter DifficultyLevel = 4
Affects ArmyCost 1 Chance 100
;------------------------------------------ 4->5
Trigger ArmyCost_Siege_NotEngineer
WhenToTest CharacterTurnEnd
Condition IsBesieging
and CharacterIsLocal
and not IsOnCrusade
and not IsOnJihad
and Trait ArmyCost < 5
and Trait Military_Edu < 4
and Trait GoodEngineer < 1
and not HasAncType SiegeEngineer
and not CharacterReligion pagan
and I_EventCounter DifficultyLevel = 4
Affects ArmyCost 1 Chance 100
;======================================================== AtSeaCost
;----- At Sea Costs ------------------------------------
;-- used with script
;-- in the future might be more modded with RulerOfSicily and MaritimeInterests
;------------------------------------------ this trigger should be before the follwing one!
Trigger AtSeaCost_Remove_SecondaryGeneral
WhenToTest CharacterTurnEnd
Condition IsGeneral
and TimeWithArmy > 0
and Trait AtSeaCost > 0
Affects AtSeaCost -2 Chance 100
;------------------------------------------
Trigger AtSeaCost_Remove_NotAnymore
WhenToTest CharacterTurnEnd
Condition IsGeneral
and not AtSea
and Trait AtSeaCost > 0
Affects AtSeaCost -2 Chance 100
;------------------------------------------
Trigger AtSeaCost_Start
WhenToTest CharacterTurnEnd
Condition IsGeneral
and CharacterIsLocal
and TimeWithArmy < 1
and AtSea
and not IsOnCrusade
and not IsOnJihad
and Trait AtSeaCost < 1
and I_EventCounter DifficultyLevel = 4
Affects AtSeaCost 1 Chance 100
;------------------------------------------
Trigger AtSeaCost_BadLogistics
WhenToTest CharacterTurnEnd
Condition IsGeneral
and CharacterIsLocal
and TimeWithArmy < 1
and AtSea
and not IsOnCrusade
and not IsOnJihad
and Trait AtSeaCost < 2
and Trait LogisticalSkill < 1
and FactionLeaderTrait MaritimeInterests < 1
and I_EventCounter DifficultyLevel = 4
Affects AtSeaCost 1 Chance 100