Results 1 to 7 of 7

Thread: Questions Spawning An Army Script

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default 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.

  2. #2

    Default 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.
    Last edited by Epistolary Richard; 01-17-2006 at 01:43.
    Epistolary Richard's modding Rules of Cool
    Cool modders make their mods with the :mod command line switch
    If they don't, then Cool mod-users use the Mod Enabler (JSGME)
    Cool modders use show_err
    Cool modders use the tutorials database Cool modders check out the Welcome to the Modding Forums! thread Cool modders keep backups Cool modders help each other out

  3. #3

    Default 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
    Last edited by lt1956; 01-17-2006 at 07:14.
    LT_1956 Creator of SPQR: Total War


    SPQR:TW Mod forums

  4. #4

    Default Re: Questions Spawning An Army Script

    Try giving the slave general a sub-faction, like in descr_strat. That might help.

  5. #5
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default 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.

  6. #6
    Simulation Monkey Member The_Mark's Avatar
    Join Date
    Dec 2004
    Location
    Helsinki, Finland
    Posts
    2,613

    Exclamation Re: Questions Spawning An Army Script

    The name of the spawned character has to be defined in descr_names under the corresponding faction.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO