Results 1 to 2 of 2

Thread: help with battle scriting needed

  1. #1

    Default help with battle scriting needed

    Hey, im creating a historical battle for RTW vanilla and iv'e just about finished scripting it. Its the battle of Leuctra 371BC. Theres just one little thing I can't figure out. Baisicly what I want to happen is when the Theban Sacred Band is defeated I want the rest of the Theban army to turn tail and run. The following is the script I created which was supposed to do this:

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; If the sacred band is routed
    ;;; the rest of the Theban army
    ;;; will begin to run
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    monitor_conditions I_CompareCounter sacred_routing = 1
    set_counter thebes_routs 1

    terminate_monitor
    end_monitor


    monitor_conditions I_CompareCounter thebes_routs = 1


    battle_wait 2

    unit_set_morale THEBAN_PELTAST_1 routing
    unit_set_morale THEBAN_PELTAST_2 routing
    unit_set_morale THEBAN_PELTAST_3 routing
    unit_set_morale THEBAN_HOPLITE_1 routing
    unit_set_morale THEBAN_HOPLITE_2 routing
    unit_set_morale THEBAN_HOPLITE_3 routing
    unit_set_morale THEBAN_HOPLITE_4 routing
    unit_set_morale THEBAN_HOPLITE_5 routing
    unit_set_morale THEBAN_HOPLITE_6 routing
    unit_set_morale THEBAN_HOPLITE_7 routing
    unit_set_morale THEBAN_HOPLITE_8 routing
    unit_set_morale THEBAN_HOPLITE_9 routing

    battle_wait 1

    unit_set_morale THEBAN_CAVALRY_1 routing

    battle_wait 1

    unit_set_morale THEBAN_CAVALRY_2 routing

    battle_wait 1

    unit_set_morale THEBAN_CAVALRY_3 routing

    battle_wait 1

    unit_set_morale THEBAN_GENERAL routing
    inc_counter thebes_routs 1

    end_monitor
    Heres the full script (sorry for the length):

    script

    ; *********************************************************************************************
    ; SCRIPTING EXAMPLE
    ; *********************************************************************************************

    ; *********************************************************************************************
    ; INITIALISATION
    ; *********************************************************************************************

    ; prepare_for_battle ; This must be *before* defining labels
    ; while ! I_BattleStarted ; Wait for deployment
    ; end_while

    disable_cursor
    suspend_unscripted_advice true
    disable_shortcuts true
    disable_entire_ui
    inhibit_camera_input true
    camera_restrictions_set off
    camera_default_mode_set tw
    hide_ui
    ai_active_set off

    while ! I_BattleStarted
    end_while

    ; *********************************************************************************************
    ; DEFINE UNIT LABELS
    ; *********************************************************************************************

    ; label_unit ALLIANCE ARMY UNIT

    label_unit 0 0 0 THEBAN_GENERAL
    label_unit 0 0 1 THEBAN_CAVALRY_1
    label_unit 0 0 2 THEBAN_CAVALRY_2
    label_unit 0 0 3 THEBAN_CAVALRY_3
    label_unit 0 0 4 SACRED_1
    label_unit 0 0 5 THEBAN_HOPLITE_1
    label_unit 0 0 6 THEBAN_HOPLITE_2
    label_unit 0 0 7 THEBAN_HOPLITE_3
    label_unit 0 0 8 THEBAN_HOPLITE_4
    label_unit 0 0 9 THEBAN_HOPLITE_5
    label_unit 0 0 10 THEBAN_HOPLITE_6
    label_unit 0 0 11 THEBAN_HOPLITE_7
    label_unit 0 0 12 THEBAN_HOPLITE_8
    label_unit 0 0 13 THEBAN_HOPLITE_9
    label_unit 0 0 15 THEBAN_PELTAST_1
    label_unit 0 0 16 THEBAN_PELTAST_2
    label_unit 0 0 17 THEBAN_PELTAST_3


    label_unit 1 0 0 SPARTAN_GENERAL
    label_unit 1 0 1 SPARTAN_CAVALRY_1
    label_unit 1 0 2 SPARTAN_CAVALRY_2
    label_unit 1 0 3 SPARTAN_CAVALRY_3
    label_unit 1 0 4 SPARTIATES_1
    label_unit 1 0 5 SPARTIATES_2
    label_unit 1 0 6 SPARTIATES_3
    label_unit 1 0 7 HOPLITE_1
    label_unit 1 0 8 HOPLITE_2
    label_unit 1 0 9 HOPLITE_3
    label_unit 1 0 10 HOPLITE_4
    label_unit 1 0 11 HOPLITE_5
    label_unit 1 0 12 HOPLITE_6
    label_unit 1 0 13 HOPLITE_7
    label_unit 1 0 14 HOPLITE_8
    label_unit 1 0 15 HOPLITE_9
    label_unit 1 0 16 HOPLITE_10
    label_unit 1 0 17 PELTAST_1
    label_unit 1 0 18 PELTAST_2
    label_unit 1 0 19 PELTAST_3


    ; *********************************************************************************************
    ; DEFINE GROUPS AND COUNTERS
    ; *********************************************************************************************

    define_unit_group GRP_SPARTANS SPARTIATES_1 SPARTIATES_2 SPARTIATES_3
    define_unit_group THEBAN_LEFT SACRED_1 THEBAN_HOPLITE_1 THEBAN_HOPLITE_2 THEBAN_HOPLITE_3 THEBAN_HOPLITE_4 THEBAN_HOPLITE_5 THEBAN_HOPLITE_6 THEBAN_HOPLITE_7 THEBAN_HOPLITE_8 THEBAN_HOPLITE_9
    define_unit_group ALLIES HOPLITE_1 HOPLITE_2 HOPLITE_3 HOPLITE_4 HOPLITE_5 HOPLITE_6 HOPLITE_7 HOPLITE_8 HOPLITE_9 HOPLITE_10

    declare_counter spartans_routing
    declare_counter sacred_routing
    declare_counter ai_phalanx_routing
    declare_counter player_loses
    declare_counter cavalry_routing
    declare_counter spartan_phalanx_experience
    declare_counter allies_engaged
    ; declare_counter thebes_routs
    declare_counter allies_attack
    declare_counter spartan_1_released
    declare_counter spartan_2_released
    declare_counter spartan_3_released
    declare_counter hoplite_1_released
    declare_counter hoplite_2_released
    declare_counter hoplite_3_released
    declare_counter hoplite_4_released
    declare_counter hoplite_5_released
    declare_counter hoplite_6_released
    declare_counter hoplite_7_released
    declare_counter hoplite_8_released
    declare_counter hoplite_9_released
    declare_counter hoplite_10_released
    declare_counter unset_hoplite_1_morale
    declare_counter unset_hoplite_2_morale
    declare_counter unset_hoplite_3_morale
    declare_counter unset_hoplite_4_morale
    declare_counter unset_hoplite_5_morale
    declare_counter unset_hoplite_6_morale
    declare_counter unset_hoplite_7_morale
    declare_counter unset_hoplite_8_morale
    declare_counter unset_hoplite_9_morale
    declare_counter unset_hoplite_10_morale

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;
    ;;; set the music and the camera
    ;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    battle_default_camera



    ; *********************************************************************************************
    ; FIGHT!
    ; *********************************************************************************************

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;
    ;;; Suppress morale/unit behaviour
    ;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    monitor_conditions I_CompareCounter spartan_phalanx_experience = 0
    unit_set_morale HOPLITE_1 high
    unit_set_morale HOPLITE_2 high
    unit_set_morale HOPLITE_3 high
    unit_set_morale HOPLITE_4 high
    unit_set_morale HOPLITE_5 high
    unit_set_morale HOPLITE_6 high
    unit_set_morale HOPLITE_7 high
    unit_set_morale HOPLITE_8 high
    unit_set_morale HOPLITE_9 high
    unit_set_morale HOPLITE_10 high

    unit_set_armour_upgrade HOPLITE_1 3
    unit_set_armour_upgrade HOPLITE_2 3
    unit_set_armour_upgrade HOPLITE_3 3
    unit_set_armour_upgrade HOPLITE_4 3
    unit_set_armour_upgrade HOPLITE_5 3
    unit_set_armour_upgrade HOPLITE_6 3
    unit_set_armour_upgrade HOPLITE_7 3
    unit_set_armour_upgrade HOPLITE_8 3
    unit_set_armour_upgrade HOPLITE_9 3
    unit_set_armour_upgrade HOPLITE_10 3

    unit_set_weapon_upgrade HOPLITE_1 3
    unit_set_weapon_upgrade HOPLITE_2 3
    unit_set_weapon_upgrade HOPLITE_3 3
    unit_set_weapon_upgrade HOPLITE_4 3
    unit_set_weapon_upgrade HOPLITE_5 3
    unit_set_weapon_upgrade HOPLITE_6 3
    unit_set_weapon_upgrade HOPLITE_7 3
    unit_set_weapon_upgrade HOPLITE_8 3
    unit_set_weapon_upgrade HOPLITE_9 3
    unit_set_weapon_upgrade HOPLITE_10 3

    end_monitor

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; when these units rout they stay routing ;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    monitor_conditions I_IsUnitRouting SPARTAN_CAVALRY_1
    unit_set_morale SPARTAN_CAVALRY_1 routing
    inc_counter cavalry_routing 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitRouting SPARTAN_CAVALRY_2
    unit_set_morale SPARTAN_CAVALRY_2 routing
    inc_counter cavalry_routing 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitRouting SPARTAN_CAVALRY_3
    unit_set_morale SPARTAN_CAVALRY_3 routing
    inc_counter cavalry_routing 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitRouting HOPLITE_1
    unit_set_morale HOPLITE_1 routing
    inc_counter ai_phalanx_routing 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitRouting HOPLITE_2
    unit_set_morale HOPLITE_3 routing
    inc_counter ai_phalanx_routing 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitRouting HOPLITE_3
    unit_set_morale HOPLITE_3 routing
    inc_counter ai_phalanx_routing 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitRouting HOPLITE_4
    unit_set_morale HOPLITE_4 routing
    inc_counter ai_phalanx_routing 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitRouting HOPLITE_5
    unit_set_morale HOPLITE_5 routing
    inc_counter ai_phalanx_routing 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitRouting HOPLITE_6
    unit_set_morale HOPLITE_6 routing
    inc_counter ai_phalanx_routing 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitRouting HOPLITE_7
    unit_set_morale HOPLITE_7 routing
    inc_counter ai_phalanx_routing 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitRouting HOPLITE_8
    unit_set_morale HOPLITE_8 routing
    inc_counter ai_phalanx_routing 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitRouting HOPLITE_9
    unit_set_morale HOPLITE_9 routing
    inc_counter ai_phalanx_routing 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitRouting HOPLITE_10
    unit_set_morale HOPLITE_10 routing
    inc_counter ai_phalanx_routing 1
    terminate_monitor
    end_monitor

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; Spartan peltasts are released when
    ;;; their cavalry routs
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    monitor_conditions I_CompareCounter cavalry_routing = 3
    release_unit PELTAST_1
    release_unit PELTAST_2
    release_unit PELTAST_3
    terminate_monitor
    end_monitor

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; Victory is gained when more than 5 of the
    ;;; enemy hoplites are routed
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    monitor_conditions I_CompareCounter ai_phalanx_routing > 5
    set_counter player_loses 1
    terminate_monitor
    end_monitor

    monitor_conditions I_CompareCounter player_loses = 1
    and I_CompareCounter spartans_routing = 3

    unit_set_morale HOPLITE_1 routing
    unit_set_morale HOPLITE_2 routing
    unit_set_morale HOPLITE_3 routing
    unit_set_morale HOPLITE_4 routing
    unit_set_morale HOPLITE_5 routing
    unit_set_morale HOPLITE_6 routing
    unit_set_morale HOPLITE_7 routing
    unit_set_morale HOPLITE_8 routing
    unit_set_morale HOPLITE_9 routing
    unit_set_morale HOPLITE_10 routing
    unit_set_morale PELTAST_1 routing
    unit_set_morale PELTAST_2 routing
    unit_set_morale PELTAST_3 routing

    battle_wait 15

    unit_set_morale SPARTAN_GENERAL routing

    terminate_monitor
    end_monitor

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; Monitors wether the allies are engaged
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    monitor_conditions I_IsUnitEngaged HOPLITE_1
    inc_counter allies_engaged 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_2
    inc_counter allies_engaged 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_3
    inc_counter allies_engaged 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_4
    inc_counter allies_engaged 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_5
    inc_counter allies_engaged 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_6
    inc_counter allies_engaged 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_7
    inc_counter allies_engaged 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_8
    inc_counter allies_engaged 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_9
    inc_counter allies_engaged 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_10
    inc_counter allies_engaged 1
    terminate_monitor
    end_monitor

    monitor_conditions I_CompareCounter allies_engaged = 3
    and I_CompareCounter allies_attack = 0
    release_unit HOPLITE_1
    release_unit HOPLITE_2
    release_unit HOPLITE_3
    release_unit HOPLITE_4
    release_unit HOPLITE_5
    release_unit HOPLITE_6
    release_unit HOPLITE_7
    release_unit HOPLITE_8
    release_unit HOPLITE_9
    release_unit HOPLITE_10
    terminate_monitor
    end_monitor

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; These monitors force the SPARTIATES to rout after
    ;;; sustaining ~80% casualties, as they have a tendency
    ;;; to fight to the bitter end on occasion
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    monitor_conditions I_PercentageUnitKilled SPARTIATES_1 > 80
    unit_set_morale SPARTIATES_1 routing
    inc_counter spartans_routing 1
    terminate_monitor
    end_monitor


    monitor_conditions I_PercentageUnitKilled SPARTIATES_2 > 80
    unit_set_morale SPARTIATES_2 routing
    inc_counter spartans_routing 1
    terminate_monitor
    end_monitor


    monitor_conditions I_PercentageUnitKilled SPARTIATES_3 > 80
    unit_set_morale SPARTIATES_3 routing
    inc_counter spartans_routing 1
    terminate_monitor
    end_monitor

    monitor_conditions I_PercentageUnitKilled SACRED_1 > 80
    unit_set_morale SACRED_1 routing
    set_counter sacred_routing 1
    terminate_monitor
    end_monitor

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; If the sacred band is routed
    ;;; the rest of the Theban army
    ;;; will begin to run
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    monitor_conditions I_CompareCounter sacred_routing = 1
    set_counter thebes_routs 1

    terminate_monitor
    end_monitor


    monitor_conditions I_CompareCounter thebes_routs = 1


    battle_wait 2

    unit_set_morale THEBAN_PELTAST_1 routing
    unit_set_morale THEBAN_PELTAST_2 routing
    unit_set_morale THEBAN_PELTAST_3 routing
    unit_set_morale THEBAN_HOPLITE_1 routing
    unit_set_morale THEBAN_HOPLITE_2 routing
    unit_set_morale THEBAN_HOPLITE_3 routing
    unit_set_morale THEBAN_HOPLITE_4 routing
    unit_set_morale THEBAN_HOPLITE_5 routing
    unit_set_morale THEBAN_HOPLITE_6 routing
    unit_set_morale THEBAN_HOPLITE_7 routing
    unit_set_morale THEBAN_HOPLITE_8 routing
    unit_set_morale THEBAN_HOPLITE_9 routing

    battle_wait 1

    unit_set_morale THEBAN_CAVALRY_1 routing

    battle_wait 1

    unit_set_morale THEBAN_CAVALRY_2 routing

    battle_wait 1

    unit_set_morale THEBAN_CAVALRY_3 routing

    battle_wait 1

    unit_set_morale THEBAN_GENERAL routing
    inc_counter thebes_routs 1

    end_monitor

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;monitors if the spartiates are routing;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    monitor_conditions I_CompareCounter spartans_routing = 3

    inc_counter spartan_phalanx_experience 2

    if I_CompareCounter unset_hoplite_1_morale = 0
    unit_unset_morale HOPLITE_1
    set_counter unset_hoplite_1_morale 1
    end_if

    if I_CompareCounter unset_hoplite_2_morale = 0
    unit_unset_morale HOPLITE_2
    set_counter unset_hoplite_2_morale 1
    end_if

    if I_CompareCounter unset_hoplite_3_morale = 0
    unit_unset_morale HOPLITE_3
    set_counter unset_hoplite_3_morale 1
    end_if

    if I_CompareCounter unset_hoplite_4_morale = 0
    unit_unset_morale HOPLITE_4
    set_counter unset_hoplite_4_morale 1
    end_if

    if I_CompareCounter unset_hoplite_5_morale = 0
    unit_unset_morale HOPLITE_5
    set_counter unset_hoplite_5_morale 1
    end_if

    if I_CompareCounter unset_hoplite_6_morale = 0
    unit_unset_morale HOPLITE_6
    set_counter unset_hoplite_6_morale 1
    end_if

    if I_CompareCounter unset_hoplite_7_morale = 0
    unit_unset_morale HOPLITE_7
    set_counter unset_hoplite_7_morale 1
    end_if

    if I_CompareCounter unset_hoplite_8_morale = 0
    unit_unset_morale HOPLITE_8
    set_counter unset_hoplite_8_morale 1
    end_if

    if I_CompareCounter unset_hoplite_9_morale = 0
    unit_unset_morale HOPLITE_9
    set_counter unset_hoplite_9_morale 1
    end_if


    if I_CompareCounter unset_hoplite_10_morale = 0
    unit_unset_morale HOPLITE_10
    set_counter unset_hoplite_10_morale 1
    end_if


    unit_set_experience HOPLITE_1 0
    unit_set_experience HOPLITE_2 0
    unit_set_experience HOPLITE_3 0
    unit_set_experience HOPLITE_4 0
    unit_set_experience HOPLITE_5 0
    unit_set_experience HOPLITE_6 0
    unit_set_experience HOPLITE_7 0
    unit_set_experience HOPLITE_8 0
    unit_set_experience HOPLITE_9 0
    unit_set_experience HOPLITE_10 0

    unit_set_experience THEBAN_HOPLITE_1 9
    unit_set_experience THEBAN_HOPLITE_2 9
    unit_set_experience THEBAN_HOPLITE_3 9
    unit_set_experience THEBAN_HOPLITE_4 9
    unit_set_experience THEBAN_HOPLITE_5 9
    unit_set_experience THEBAN_HOPLITE_6 9
    unit_set_experience THEBAN_HOPLITE_7 9
    unit_set_experience THEBAN_HOPLITE_8 9
    unit_set_experience THEBAN_HOPLITE_9 9

    unit_set_armour_upgrade HOPLITE_1 0
    unit_set_armour_upgrade HOPLITE_2 0
    unit_set_armour_upgrade HOPLITE_3 0
    unit_set_armour_upgrade HOPLITE_4 0
    unit_set_armour_upgrade HOPLITE_5 0
    unit_set_armour_upgrade HOPLITE_6 0
    unit_set_armour_upgrade HOPLITE_7 0
    unit_set_armour_upgrade HOPLITE_8 0
    unit_set_armour_upgrade HOPLITE_9 0
    unit_set_armour_upgrade HOPLITE_10 0
    unit_set_armour_upgrade PELTAST_1 0
    unit_set_armour_upgrade PELTAST_2 0
    unit_set_armour_upgrade PELTAST_3 0

    release_unit SPARTAN_GENERAL
    end_monitor

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; if a unit is engaged
    ;;; the AI will take command
    ;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ; monitor_conditions I_IsUnitEngaged SPARTIATES_1
    ;
    ; if I_CompareCounter spartan_1_released = 0
    ; release_unit SPARTIATES_1
    ; set_counter spartan_1_released 1
    ; end_if
    ;
    ; terminate_monitor
    ; end_monitor

    ; monitor_conditions I_IsUnitEngaged SPARTIATES_2
    ; if I_CompareCounter spartan_2_released = 0
    ; release_unit SPARTIATES_2
    ; set_counter spartan_2_released 1
    ; end_if
    ;
    ; terminate_monitor
    ; end_monitor

    ; monitor_conditions I_IsUnitEngaged SPARTIATES_3
    ; if I_CompareCounter spartan_3_released = 0
    ; release_unit SPARTIATES_3
    ; set_counter spartan_3_released 1
    ; end_if
    ;
    ; terminate_monitor
    ; end_monitor




    monitor_conditions I_IsUnitEngaged HOPLITE_1
    and I_CompareCounter hoplite_1_released = 0
    release_unit HOPLITE_1
    set_counter hoplite_1_released 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_2
    and I_CompareCounter hoplite_2_released = 0
    release_unit HOPLITE_2
    set_counter hoplite_2_released 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_3
    and I_CompareCounter hoplite_3_released = 0
    release_unit HOPLITE_3
    set_counter hoplite_3_released 1
    terminate_monitor
    end_monitor
    monitor_conditions I_IsUnitEngaged HOPLITE_4
    and I_CompareCounter hoplite_4_released = 0
    release_unit HOPLITE_4
    set_counter hoplite_4_released 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_5
    and I_CompareCounter hoplite_5_released = 0
    release_unit HOPLITE_5
    set_counter hoplite_5_released 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_6
    and I_CompareCounter hoplite_6_released = 0
    release_unit HOPLITE_6
    set_counter hoplite_6_released 1
    terminate_monitor
    end_monitor
    monitor_conditions I_IsUnitEngaged HOPLITE_7
    and I_CompareCounter hoplite_7_released = 0
    release_unit HOPLITE_7
    set_counter hoplite_7_released 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_8
    and I_CompareCounter hoplite_8_released = 0
    release_unit HOPLITE_8
    set_counter hoplite_8_released 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_9
    and I_CompareCounter hoplite_9_released = 0
    release_unit HOPLITE_9
    set_counter hoplite_9_released 1
    terminate_monitor
    end_monitor

    monitor_conditions I_IsUnitEngaged HOPLITE_10
    and I_CompareCounter hoplite_10_released = 0
    release_unit HOPLITE_10
    set_counter hoplite_10_released 1
    terminate_monitor
    end_monitor


    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; opening cinematics ;;;;;;;;;;;


    camera_track_unit SPARTIATES_2 front 2 2 -15

    battle_wait 5

    unit_order_change_formation SPARTIATES_1 phalanx
    unit_order_change_formation SPARTIATES_2 phalanx
    unit_order_change_formation SPARTIATES_3 phalanx

    battle_wait 7

    camera_track_unit SACRED_1 front 2 2 -15

    battle_wait 5

    unit_order_change_formation SACRED_1 phalanx

    battle_wait 7

    camera_track_unit SPARTAN_GENERAL front 2.5 1.5 -15

    battle_wait 5

    unit_order_change_formation HOPLITE_1 phalanx
    unit_order_change_formation HOPLITE_2 phalanx
    unit_order_change_formation HOPLITE_3 phalanx
    unit_order_change_formation HOPLITE_4 phalanx
    unit_order_change_formation HOPLITE_5 phalanx
    unit_order_change_formation HOPLITE_6 phalanx
    unit_order_change_formation HOPLITE_7 phalanx
    unit_order_change_formation HOPLITE_8 phalanx
    unit_order_change_formation HOPLITE_9 phalanx
    unit_order_change_formation HOPLITE_10 phalanx

    unit_set_guard_mode SPARTIATES_1 off
    unit_set_guard_mode SPARTIATES_2 off
    unit_set_guard_mode SPARTIATES_3 off
    unit_set_guard_mode HOPLITE_1 off
    unit_set_guard_mode HOPLITE_2 off
    unit_set_guard_mode HOPLITE_3 off
    unit_set_guard_mode HOPLITE_4 off
    unit_set_guard_mode HOPLITE_5 off
    unit_set_guard_mode HOPLITE_6 off
    unit_set_guard_mode HOPLITE_7 off
    unit_set_guard_mode HOPLITE_8 off
    unit_set_guard_mode HOPLITE_9 off
    unit_set_guard_mode HOPLITE_10 off

    battle_wait 5

    camera_track_unit THEBAN_GENERAL front 2.5 1.5 -15

    battle_wait 5

    unit_order_change_formation THEBAN_HOPLITE_1 phalanx
    unit_order_change_formation THEBAN_HOPLITE_2 phalanx
    unit_order_change_formation THEBAN_HOPLITE_3 phalanx
    unit_order_change_formation THEBAN_HOPLITE_4 phalanx
    unit_order_change_formation THEBAN_HOPLITE_5 phalanx
    unit_order_change_formation THEBAN_HOPLITE_6 phalanx
    unit_order_change_formation THEBAN_HOPLITE_7 phalanx
    unit_order_change_formation THEBAN_HOPLITE_8 phalanx
    unit_order_change_formation THEBAN_HOPLITE_9 phalanx

    unit_set_guard_mode THEBAN_CAVALRY_1 on
    unit_set_guard_mode THEBAN_CAVALRY_2 on
    unit_set_guard_mode THEBAN_CAVALRY_3 on
    unit_set_guard_mode SACRED_1 off
    unit_set_guard_mode THEBAN_HOPLITE_1 off
    unit_set_guard_mode THEBAN_HOPLITE_2 off
    unit_set_guard_mode THEBAN_HOPLITE_3 off
    unit_set_guard_mode THEBAN_HOPLITE_4 off
    unit_set_guard_mode THEBAN_HOPLITE_5 off
    unit_set_guard_mode THEBAN_HOPLITE_6 off
    unit_set_guard_mode THEBAN_HOPLITE_7 off
    unit_set_guard_mode THEBAN_HOPLITE_8 off
    unit_set_guard_mode THEBAN_HOPLITE_9 off

    battle_wait 5

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    battle_wait 1

    camera_default_mode_set user_pref
    enable_cursor
    suspend_unscripted_advice false
    disable_shortcuts false
    inhibit_camera_input false
    show_ui
    enable_entire_ui

    pause_battle

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; battle begin ;;;;;;;;;;;;

    battle_wait 1

    unit_order_attack_unit SPARTAN_CAVALRY_1 THEBAN_CAVALRY_1 run
    unit_order_attack_unit SPARTAN_CAVALRY_2 THEBAN_CAVALRY_2 run
    unit_order_attack_unit SPARTAN_CAVALRY_3 THEBAN_CAVALRY_3 run

    battle_wait 20

    unit_group_order_relative_move_formed GRP_SPARTANS 0 70

    battle_wait 20

    unit_order_attack_closest_unit SPARTIATES_1 30
    unit_order_attack_closest_unit SPARTIATES_2 30
    unit_order_attack_closest_unit SPARTIATES_3 30

    battle_wait 90

    release_unit SPARTIATES_1
    release_unit SPARTIATES_2
    release_unit SPARTIATES_3

    unit_order_attack_closest_unit HOPLITE_1 360 run
    unit_order_attack_closest_unit HOPLITE_2 360 run
    unit_order_attack_closest_unit HOPLITE_3 360 run
    unit_order_attack_closest_unit HOPLITE_4 360 run
    unit_order_attack_closest_unit HOPLITE_5 360 run
    unit_order_attack_closest_unit HOPLITE_6 360 run
    unit_order_attack_closest_unit HOPLITE_7 360 run
    unit_order_attack_closest_unit HOPLITE_8 360 run
    unit_order_attack_closest_unit HOPLITE_9 360 run
    unit_order_attack_closest_unit HOPLITE_10 360 run

    battle_wait 1

    define_unit_group THEBAN_LEFT SACRED_1 THEBAN_HOPLITE_1 THEBAN_HOPLITE_2 THEBAN_HOPLITE_3 THEBAN_HOPLITE_4 THEBAN_HOPLITE_5 THEBAN_HOPLITE_6 THEBAN_HOPLITE_7 THEBAN_HOPLITE_8 THEBAN_HOPLITE_9
    define_unit_group ALLIES HOPLITE_1 HOPLITE_2 HOPLITE_3 HOPLITE_4 HOPLITE_5 HOPLITE_6 HOPLITE_7 HOPLITE_8 HOPLITE_9 HOPLITE_10
    unit_group_enable_automation ALLIES true

    battle_wait 1

    unit_group_order_attack_group ALLIES THEBAN_LEFT

    inc_counter allies_attack 1

    battle_wait 20

    ai_active_set on


    ; *********************************************************************************************

    while I_InBattle
    end_while


    end_script
    Also, why will the script in red not work, I created it to stop the spartan allied hoplites chasing after the theban Peltasts.
    Im wondering whether I should make the battle available for download?
    Last edited by MightyMonty; September 28, 2006 at 08:37 AM.

  2. #2
    Hader's Avatar Things are very seldom what they seem. In my experience, they’re usually a damn sight worse.
    took an arrow to the knee spy of the council

    Join Date
    Mar 2006
    Posts
    13,192
    Blog Entries
    1

    Default Re: help with battle scriting needed

    Moved to the Hall of Scribes

Posting Permissions

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