Originally Posted by
Vegas_Bear
First of all, I'd like to thank you for your time and effort. +Rep. Great job on figuring it out, without using the horde aspect.
What I am trying to do, is to limit the amount of monitor_events used. For your script, I would need 3 monitors for each settlement, 3 settlements would need 9 monitors. The one below has 4 monitors for 3 settlements. Let me know what you think. I'm also trying not to use the building aspect of it too.
Thanks for your support!
Nice script, it reduces monitors a lot which is nice. (I actually talk about using If statements to reduce monitors for more settlemetns in the final remarks and options section.)
Do you mind if I use your script as an example for the Tutorial for a script for multiple settlements?
Here is your script with my additions to make it better.
Red is needed code to make it better which is to make the army spawn near the settlement that the faction emerged from, green for my suggestion to include the buildings because without it you run the risk of the faction emerging in a different settlement.
If you take the building suggestion, remember to code in the buildings in the EDB!
Code:
;------------------- Scotland -------------------;
declare_counter scotland_emerge
set_counter scotland_emerge 0
declare_counter scotlandEdinburgh
set_counter scotlandEdinburgh 0
declare_counter scotlandAberdeen
set_counter scotlandAberdeen 0
declare_counter scotlandInverness
set_counter scotlandInverness 0
declare_counter scotland_building
set_counter scotland_building 1
monitor_event SettlementTurnStart SettlementName Edinburgh
and I_NumberOfSettlements scotland < 1
and SettlementLoyaltyLevel < loyalty_content
and I_TurnNumber > 0
set_counter scotlandEdinburgh 1
inc_counter scotland_emerge 1
end_monitor
monitor_event SettlementTurnStart SettlementName Aberdeen
and I_NumberOfSettlements scotland < 1
and SettlementLoyaltyLevel < loyalty_content
and I_TurnNumber > 0
set_counter scotlandAberdeen 1
inc_counter scotland_emerge 1
end_monitor
monitor_event SettlementTurnStart SettlementName Inverness
and I_NumberOfSettlements scotland < 1
and SettlementLoyaltyLevel < loyalty_content
and I_TurnNumber > 0
set_counter scotlandInverness 1
inc_counter scotland_emerge 1
end_monitor
monitor_event FactionTurnEnd FactionType slave
and I_CompareCounter scotland_emerge >= 2
if I_CompareCounter scotlandEdinburgh = 1
console_command create_building Edinburgh ros_target
set_counter scotland_building 0
spawn_army
faction scotland
character random_name, named character, age 30, x ??, y ??, family
traits ReligionStarter 1, LoyaltyStarter 1, NaturalMilitarySkill 2, GoodCommander 2, BattleChivalry 2, Loyal 2, Just 2
unit NE Bodyguard exp 1 armour 1 weapon_lvl 0
unit Feudal Knights exp 1 armour 0 weapon_lvl 0
unit Dismounted Mailed Knights exp 1 armour 1 weapon_lvl 0
unit Dismounted Mailed Knights exp 1 armour 1 weapon_lvl 0
unit Highland Nobles exp 1 armour 1 weapon_lvl 0
unit Highland Nobles exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Spear Militia exp 1 armour 1 weapon_lvl 0
unit Spear Militia exp 1 armour 1 weapon_lvl 0
unit Spear Militia exp 1 armour 1 weapon_lvl 0
unit Noble Highland Archers exp 1 armour 1 weapon_lvl 0
unit Highland Archers exp 1 armour 1 weapon_lvl 0
unit Highland Archers exp 1 armour 1 weapon_lvl 0
end
if I_SettlementOwner Edinburgh = england
faction_emerge scotland england 1 400.0 0.0 1.2 town true unused_label1 unused_name 30
end_if
if I_SettlementOwner Edinburgh = wales
faction_emerge scotland wales 1 400.0 0.0 1.2 town true unused_label1 unused_name 30
end_if
if I_SettlementOwner Edinburgh = ireland
faction_emerge scotland ireland 1 400.0 0.0 1.2 town true unused_label1 unused_name 30
end_if
if I_SettlementOwner Edinburgh = barons_alliance
faction_emerge scotland barons_alliance 1 400.0 0.0 1.2 town true unused_label1 unused_name 30
end_if
if I_SettlementOwner Edinburgh = france
faction_emerge scotland france 1 400.0 0.0 1.2 town true unused_label1 unused_name 30
end_if
CONTINUED FOR OTHER REMAINING FACTIONS...
end_if
if I_CompareCounter scotlandAberdeen = 1
console_command create_building Aberdeen ros_target
set_counter scotland_building 0
spawn_army
faction scotland
character random_name, named character, age 30, x ??, y ??, family
traits ReligionStarter 1, LoyaltyStarter 1, NaturalMilitarySkill 2, GoodCommander 2, BattleChivalry 2, Loyal 2, Just 2
unit NE Bodyguard exp 1 armour 1 weapon_lvl 0
unit Feudal Knights exp 1 armour 0 weapon_lvl 0
unit Dismounted Mailed Knights exp 1 armour 1 weapon_lvl 0
unit Dismounted Mailed Knights exp 1 armour 1 weapon_lvl 0
unit Highland Nobles exp 1 armour 1 weapon_lvl 0
unit Highland Nobles exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Spear Militia exp 1 armour 1 weapon_lvl 0
unit Spear Militia exp 1 armour 1 weapon_lvl 0
unit Spear Militia exp 1 armour 1 weapon_lvl 0
unit Noble Highland Archers exp 1 armour 1 weapon_lvl 0
unit Highland Archers exp 1 armour 1 weapon_lvl 0
unit Highland Archers exp 1 armour 1 weapon_lvl 0
end
if I_SettlementOwner Aberdeen = england
faction_emerge scotland england 1 400.0 0.0 1.2 town true unused_label1 unused_name 30
end_if
if I_SettlementOwner Aberdeen = wales
faction_emerge scotland wales 1 400.0 0.0 1.2 town true unused_label1 unused_name 30
end_if
if I_SettlementOwner Aberdeen = ireland
faction_emerge scotland ireland 1 400.0 0.0 1.2 town true unused_label1 unused_name 30
end_if
if I_SettlementOwner Aberdeen = barons_alliance
faction_emerge scotland barons_alliance 1 400.0 0.0 1.2 town true unused_label1 unused_name 30
end_if
if I_SettlementOwner Aberdeen = france
faction_emerge scotland france 1 400.0 0.0 1.2 town true unused_label1 unused_name 30
end_if
CONTINUED FOR OTHER REMAINING FACTIONS...
end_if
if I_CompareCounter scotlandInverness = 1
console_command create_building Inverness ros_target
set_counter scotland_building 0
spawn_army
faction scotland
character random_name, named character, age 30, x ??, y ??, family
traits ReligionStarter 1, LoyaltyStarter 1, NaturalMilitarySkill 2, GoodCommander 2, BattleChivalry 2, Loyal 2, Just 2
unit NE Bodyguard exp 1 armour 1 weapon_lvl 0
unit Feudal Knights exp 1 armour 0 weapon_lvl 0
unit Dismounted Mailed Knights exp 1 armour 1 weapon_lvl 0
unit Dismounted Mailed Knights exp 1 armour 1 weapon_lvl 0
unit Highland Nobles exp 1 armour 1 weapon_lvl 0
unit Highland Nobles exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Highlanders exp 1 armour 1 weapon_lvl 0
unit Spear Militia exp 1 armour 1 weapon_lvl 0
unit Spear Militia exp 1 armour 1 weapon_lvl 0
unit Spear Militia exp 1 armour 1 weapon_lvl 0
unit Noble Highland Archers exp 1 armour 1 weapon_lvl 0
unit Highland Archers exp 1 armour 1 weapon_lvl 0
unit Highland Archers exp 1 armour 1 weapon_lvl 0
end
if I_SettlementOwner Inverness = england
faction_emerge scotland england 1 400.0 0.0 1.2 town true unused_label1 unused_name 30
end_if
if I_SettlementOwner Inverness = wales
faction_emerge scotland wales 1 400.0 0.0 1.2 town true unused_label1 unused_name 30
end_if
if I_SettlementOwner Inverness = ireland
faction_emerge scotland ireland 1 400.0 0.0 1.2 town true unused_label1 unused_name 30
end_if
if I_SettlementOwner Inverness = barons_alliance
faction_emerge scotland barons_alliance 1 400.0 0.0 1.2 town true unused_label1 unused_name 30
end_if
if I_SettlementOwner Inverness = france
faction_emerge scotland france 1 400.0 0.0 1.2 town true unused_label1 unused_name 30
end_if
CONTINUED FOR OTHER REMAINING FACTIONS...
end_if
set_counter scotland_emerge 0
set_counter scotlandEdinburgh 0
set_counter scotlandAberdeen 0
set_counter scotlandInverness 0
end_monitor
monitor_event PreFactionTurnStart FactionIsLocal
and I_CompareCounter scotland_building = 0
and I_CompareCounter scotland_emerge = 0
destroy_buildings ros_temp_buildings false
set_counter scotland_building 1
end_monitor
Check my additions to the script, it might not be free from faults.
This is just a suggestion btw.