Results 1 to 3 of 3

Thread: Scripting Help

  1. #1

    Default Scripting Help

    I am creating a background script. Yet it does not work. What it does is, when you create a certain unit, a legions is formed. When I finish, I will put it in my mod.

    here is my script:

    Code:
     
    script
    declare_counter loop
    set_counter loop 0
    
    monitor_event UnitTrained UnitType roman hastati
    		and SettlementName Arretium
    		and FactionType romans_julii  
    		and FactionIsLocal
    spawn_army
    faction romans_julii
    character Flavius Julius, general, command 0, influence 0, management 0, subterfuge 0, age 20, x 89, y 80
    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_monitor
    
    while I_CompareCounter loop = 0
    end_while
    end_script
    As you see, when you train hastati in arretium for the julii, a new army will be formed. The script doesn't work though.

    So please help me sort it out.

    RM3
    RIP Calvin, you won't be forgotten.

  2. #2

    Default Re: Scripting Help

    sorry for the double post, but can no one help me? I would really like this done.
    RIP Calvin, you won't be forgotten.

  3. #3

    Default Re: Scripting Help

    As far as I know, the only unit types accepted as a conditional are generic, .i.e: "cavalry", "infantry". At least, that is how it works in 77 BC:

    monitor_event UnitTrained FactionType parthia
    and TrainedUnitCategory cavalry
    and SettlementName Stakhr

    spawn_army
    faction parthia
    character Surena, general, command 5, influence 5, management 1, subterfuge 1, age 36, , x 277, y 40
    unit persian horse archer, exp 2 armour 1 weapon_lvl 0
    unit persian horse archer, exp 2 armour 0 weapon_lvl 0
    unit persian horse archer, exp 2 armour 0 weapon_lvl 0
    unit persian horse archer, exp 2 armour 1 weapon_lvl 1
    unit persian horse archer, exp 2 armour 1 weapon_lvl 1
    unit persian aor cataphract, exp 1 armour 1 weapon_lvl 1
    unit persian aor cataphract, exp 1 armour 1 weapon_lvl 0
    unit persian aor cataphract, exp 1 armour 1 weapon_lvl 0
    end

    console_command add_money parthia, -6000

    end_monitor
    Hope this helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •