PDA

View Full Version : Questions Spawning An Army Script



GHirsch
01-16-2006, 01:10
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


;------------------------------------------ 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


{Spawn_Army_Text_01_Title} Spawn Army

{Spawn_Army_Text_01_Text1} Spawn Army


spawn_army.txt


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.

Epistolary Richard
01-17-2006, 01:41
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:


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 (https://forums.totalwar.org/vb/showthread.php?t=57014).

lt1956
01-17-2006, 07:13
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

Cheexsta
01-17-2006, 13:04
Try giving the slave general a sub-faction, like in descr_strat. That might help.

Monkwarrior
01-17-2006, 13:42
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.

The_Mark
01-17-2006, 19:38
The name of the spawned character has to be defined in descr_names under the corresponding faction.

Epistolary Richard
01-18-2006, 00:07
As The Mark says... :thumbsup: