Questions Spawning An Army Script
Im new to scripting but Im trying to use what Ive picked up from this forum to use the Spawn Army script. From what I can tell everything looks correct, the game runs w/o crashing, I see the script when the advisor comes up but I dont see an army get spawned after I run it. Heres what config files looks like:
export_descr_advice.txt
Code:
;------------------------------------------ Spawn Army
AdviceThread Spawn_Army_Thread
GameArea Campaign
Item Spawn_Army_Text_01
Uninhibitable
Verbosity 0
Threshold 1
Attitude Normal
Presentation Default
Title Spawn_Army_Text_01_Title
Script scripts\show_me\spawn_army.txt
Text Spawn_Army_Text_01_Text1
;------------------------------------------ Spawn Army
Trigger Spawn_Army_Thread_Trigger
WhenToTest ScrollOpened
Condition ScrollOpened help_scroll
AdviceThread Spawn_Army_Thread 0
export_advice.txt
Code:
{Spawn_Army_Text_01_Title} Spawn Army
{Spawn_Army_Text_01_Text1} Spawn Army
spawn_army.txt
Code:
script
monitor_event FactionTurnStart FactionType romans_julii
and not FactionIsLocal
spawn_army
faction romans_julii
character Flavius Julius, general, command 0, influence 0, management 0, subterfuge 0, age 20, x 180, y 5
unit roman generals guard cavalry, soldiers 20 exp 9 armour 1 weapon_lvl 0
unit roman legionary first cohort ii, soldiers 40 exp 0 armour 0 weapon_lvl 0
unit roman legionary cohort ii, soldiers 60 exp 0 armour 0 weapon_lvl 0
unit roman praetorian cohort i, soldiers 60 exp 0 armour 0 weapon_lvl 0
end
console_command move_character Flavius Julius 170, 5
campaign_wait 1
console_command move_character Flavius Julius 160, 15
end_monitor
end_script
If anyone could take a quick look to see what im missing it would be very appreciated. Thanks.
Re: Questions Spawning An Army Script
You shouldn't be using an event monitor if you want something to appear immediately. It's running straight through and terminating because there's nothing to stop it and - as there's no time to start a new turn - the monitor is never accessed.
Try something like this instead:
Code:
script
spawn_army
faction romans_julii
character Flavius Julius, general, command 0, influence 0, management 0, subterfuge 0, age 20, x 180, y 5
unit roman generals guard cavalry, soldiers 20 exp 9 armour 1 weapon_lvl 0
unit roman legionary first cohort ii, soldiers 40 exp 0 armour 0 weapon_lvl 0
unit roman legionary cohort ii, soldiers 60 exp 0 armour 0 weapon_lvl 0
unit roman praetorian cohort i, soldiers 60 exp 0 armour 0 weapon_lvl 0
end
end_script
If you want to use a monitor then you should use a background script, have a look through the Intermediate Guide.
Re: Questions Spawning An Army Script
ER since this guy is having a similar problem to mine maybe you can help.
I wanted to add a Spawn army for an enemy faction but when I select the army to be the slave it CTDs when I USE another faction to be the army thats in the campaign, it doesnt do anything and produces no error.
When I use the faction I am example would be julii it spawns a julii unit.
Also the game gives and error when I use this command in my script because I want a are to spawn after so many provinces are taking by the julii human player. Says "not a recognized faction" or something to that effect in the message. the line matches to this text.
and I_NumberOfSettlements > 11
Whats wrong with my script?
THIS WORKS.
monitor_event FactionTurnEnd FactionType slave
and I_TurnNumber > 3
and I_LocalFaction romans_julii
spawn_army
faction romans_julii
character Asinius, general, command 0, influence 0, management 0, subterfuge 0, age 20, , x 157, y 140
unit roman city militia, soldiers 60 exp 9 armour 0 weapon_lvl 0
end_if
end_monitor
THIS DOESNT WORK
monitor_event FactionTurnEnd FactionType slave
and I_TurnNumber > 3
and I_LocalFaction romans_julii
spawn_army
faction slave
character Foedus Chaerea, general, command 6, influence 0, management 0, subterfuge 0, age 30, , x 157, y 140
unit merc bastarnae, soldiers 240 exp 9 armour 0 weapon_lvl 0
end_if
end_monitor
Re: Questions Spawning An Army Script
Try giving the slave general a sub-faction, like in descr_strat. That might help.
Re: Questions Spawning An Army Script
In the EB script appears a spawn_army event of a slave general (named Rhaskos, but I haven't tried it).
Look at the script and/or ask in the EB forum.
Re: Questions Spawning An Army Script
The name of the spawned character has to be defined in descr_names under the corresponding faction.
Re: Questions Spawning An Army Script
As The Mark says... :thumbsup: