Hello,
I'm doind the scripting class lessons by J@mes, I want to make a script when capitals are taken.
The first step work well, exemple with Paris :
The second step make problems, because the IA army never attack the settlement. So, I decided to add a attacking script, It works, the IA general attack but it take the town before I can choose wether I want to occupied the settlement, destroyed population...Code:monitor_event GeneralCaptureSettlement SettlementName Paris spawn_army faction france character Casin, named character, age 30, x 112, y 131 traits GoodCommander 2 unit NE Bodyguard exp 2 armour 0 weapon_lvl 0 unit Crossbow Militia exp 1 armour 0 weapon_lvl 0 unit Peasant Archers exp 0 armour 0 weapon_lvl 0 unit Spear Militia exp 0 armour 0 weapon_lvl 0 unit Spear Militia exp 0 armour 0 weapon_lvl 0 end terminate_monitor end_monitor
Here is the script :
I also tried this :Code:monitor_event GeneralCaptureSettlement SettlementName Paris siege_settlement Casin, Paris, siege terminate_monitor end_monitor
But it gived the same result. I was wondering if we can add a command wich tells the AI general to wait one turn.Code:monitor_event GeneralCaptureSettlement SettlementName Paris siege_settlement Casin, Paris, attack terminate_monitor end_monitor
The last step is also making problems. I want to change the number of armies spawned wether the difficutly :
I can't get it working.Code:; --------------------- ; counters declare_counter Opened_Faction_Overview_Scroll declare_counter Opened_Settlement_Scroll declare_counter timurids_yerevan declare_counter timurids_baghdad declare_counter difficulty declare_counter difficulty_easy declare_counter difficulty_medium declare_counter difficulty_hard declare_counter difficulty_very_hard ; --------------------- ; start up ;freeze_faction_ai aztecs restrict_strat_radar false ;---------------------- ; monitors 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 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 = 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 = 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 GeneralCaptureSettlement SettlementName Paris if I_CompareCounter difficulty_very_hard = 1 spawn_army faction france character Casin, named character, age 30, x 112, y 131 traits GoodCommander 2 unit NE Bodyguard exp 2 armour 0 weapon_lvl 0 unit Crossbow Militia exp 1 armour 0 weapon_lvl 0 unit Peasant Archers exp 0 armour 0 weapon_lvl 0 unit Spear Militia exp 0 armour 0 weapon_lvl 0 unit Spear Militia exp 0 armour 0 weapon_lvl 0 unit Peasant Archers exp 0 armour 0 weapon_lvl 0 unit Spear Militia exp 0 armour 0 weapon_lvl 0 unit Spear Militia exp 0 armour 0 weapon_lvl 0 unit Peasant Archers exp 0 armour 0 weapon_lvl 0 unit Spear Militia exp 0 armour 0 weapon_lvl 0 unit Spear Militia exp 0 armour 0 weapon_lvl 0 unit Peasant Archers exp 0 armour 0 weapon_lvl 0 unit Spear Militia exp 0 armour 0 weapon_lvl 0 unit Spear Militia exp 0 armour 0 weapon_lvl 0 end_if if I_CompareCounter difficulty_hard = 1 spawn_army faction france character Casin, named character, age 30, x 112, y 131 traits GoodCommander 2 unit NE Bodyguard exp 2 armour 0 weapon_lvl 0 unit Crossbow Militia exp 1 armour 0 weapon_lvl 0 unit Peasant Archers exp 0 armour 0 weapon_lvl 0 unit Spear Militia exp 0 armour 0 weapon_lvl 0 end_if if I_CompareCounter difficulty_medium = 1 spawn_army faction france character Casin, named character, age 30, x 112, y 131 traits GoodCommander 2 unit NE Bodyguard exp 2 armour 0 weapon_lvl 0 unit Crossbow Militia exp 1 armour 0 weapon_lvl 0 end_if if I_CompareCounter difficulty_easy = 1 spawn_army faction france character Casin, named character, age 30, x 112, y 131 traits GoodCommander 2 unit NE Bodyguard exp 2 armour 0 weapon_lvl 0 end_if terminate_monitor end_monitor
Thanks![]()






Reply With Quote






