
Originally Posted by
sputnik
yes, I am planning on having multiple viking invasion spawns and this would be ideal. Like a counter number 1-10, each number being a different spawned army in a different location?
:
Code:
declare_counter french_fleet
monitor_event FactionTurnStart FactionType france
and IsFactionAIControlled
and DiplomaticStanceFromFaction england = AtWar
and not I_UnitExists france cog
and I_CompareCounter french_fleet <= 2
inc_counter french_fleet 1
generate_random_counter location_of_French_fleet 1 3
if I_EventCounter location_of_French_fleet = 1
spawn_army
faction france
character random_name, admiral, age 21, x 327, y 141, direction N
unit cog exp 2 armour 0 weapon_lvl 0
unit cog exp 2 armour 0 weapon_lvl 0
unit cog exp 2 armour 0 weapon_lvl 0
unit cog exp 2 armour 0 weapon_lvl 0
unit cog exp 2 armour 0 weapon_lvl 0
end
end_if
if I_EventCounter location_of_French_fleet = 2
spawn_army
faction france
character random_name, admiral, age 21, x 316, y 169, direction N
unit cog exp 2 armour 0 weapon_lvl 0
unit cog exp 2 armour 0 weapon_lvl 0
unit cog exp 2 armour 0 weapon_lvl 0
unit cog exp 2 armour 0 weapon_lvl 0
unit cog exp 2 armour 0 weapon_lvl 0
end
end_if
if I_EventCounter location_of_French_fleet = 3
spawn_army
faction france
character random_name, admiral, age 21, x 298, y 126, direction N
unit cog exp 2 armour 0 weapon_lvl 0
unit cog exp 2 armour 0 weapon_lvl 0
unit cog exp 2 armour 0 weapon_lvl 0
unit cog exp 2 armour 0 weapon_lvl 0
unit cog exp 2 armour 0 weapon_lvl 0
end
end_if
set_event_counter location_of_French_fleet 0
end_monitor