Results 1 to 7 of 7

Thread: What is wrong with with the following script

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Rt. Hon. Gentleman's Avatar Campidoctor
    Join Date
    Aug 2008
    Location
    Lincoln, Lincolnshire.
    Posts
    1,868

    Default What is wrong with with the following script

    Code:
    ;******************************************************************************************************************
    ;    Setting up Battle with Script Commands
    ;******************************************************************************************************************
    
        prepare_for_battle
    
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;
    ;;;    Label Units & Groups & LOCATIONS
    ;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    ;*************
    ;ROMAN_UNITS
    ;*************
    
    label_unit 0 0 0    caesar            
    label_unit 0 0 1    legio_iii_gallica_1                
    label_unit 0 0 2    legio_iii_gallica_2                
    label_unit 0 0 3    legio_iii_gallica_3            
    label_unit 0 0 4    legio_iii_gallica_4            
    label_unit 0 0 5    legio_iii_gallica_5            
    label_unit 0 0 6    legio_iii_gallica_6            
    label_unit 0 0 7    legio_iii_gallica_7        
    label_unit 0 0 8    legio_iii_gallica_8    
    label_unit 0 0 9    ala_vii_illyricum_1
    label_unit 0 0 10   legio_iii_gallica_9    
    
    
    define_unit_group CAESAR_UNITS caesar legio_iii_gallica_4 legio_iii_gallica_5 legio_iii_gallica_6 legio_iii_gallica_7 legio_iii_gallica_8 ala_vii_illyricum_1 legio_iii_gallica_9
    
    define_unit_group FRONT_LINE legio_iii_gallica_1 legio_iii_gallica_2 legio_iii_gallica_3
    
    ;*************
    ;SLAVE_UNITS
    ;*************
    
    label_unit 1 0 0    pompey
    label_unit 1 0 1    legio_viii_1        
    label_unit 1 0 2    legio_viii_2        
    label_unit 1 0 3    legio_viii_3        
    label_unit 1 0 4    legio_viii_4        
    label_unit 1 0 5    legio_viii_5        
    label_unit 1 0 6    legio_viii_6        
    label_unit 1 0 7    legio_viii_7    
    label_unit 1 0 8    legio_viii_8            
    label_unit 1 0 9    legio_viii_9                
    label_unit 1 0 10    legio_viii_10                
    label_unit 1 0 11    legio_viii_11                
    label_unit 1 0 12    legio_viii_12                
        
        
    define_unit_group POMPEY_UNITS pompey legio_viii_5 legio_viii_6 legio_viii_7 legio_viii_8 legio_viii_9 legio_viii_10 legio_viii_11 legio_viii_12
    
    define_unit_group POMP_FLINE legio_viii_1 legio_viii_2 legio_viii_3 legio_viii_4
    
    label_unit 1 1 0    cav_1
    label_unit 1 1 1    cav_2    
    label_unit 1 1 2    cav_3        
    label_unit 1 1 3    labienus
    
    define_unit_group    LABIENUS_UNITS cav_1 cav_2 cav_3 labienus
    
    hiding_enabled_set false
    ai_active_set off
    
    monitor_conditions I_UnitGroupDistanceFromGroup POMP_FLINE FRONT_LINE < 50
    unit_group_order_attack_group FRONT_LINE
    terminate_monitor
    end_monitor
    
    end_script
    I have tried various permutations on this theme, having used a muber of different conditions.

    I have come to the conclusion that I must be using monitors incorrectly, as NO monitor works for we in the battle script, no matter what it may be. I have tried using every other condition conceivable, and have even done extensive testing using kill_unit as the command, as it makes results easy to see.

    With all that testing done, I think I must be unable to use the monitors correctly as every single monitor I make is broken.

    (Btw, the tabbing has completely gone in the passage here, but it is fine in the txt file. Just a twc code-wrap thing, I guess. It's all tabbed, not spaced, in the txt.)

    Also, all the units are labelled properly. Going through them, if I insert a line of "kill_unit <whatever> it always kills what I expect it to. So I know that the labelling is not at fault.

    Thanks,
    RHG.

  2. #2
    HouseOfHam's Avatar Primicerius
    Join Date
    Apr 2007
    Location
    Minnesota, USA
    Posts
    3,030

    Default Re: What is wrong with with the following script

    Your unit_group_order_attack_group command is missing a parameter.
    RTR website/SVN admin

    - Settlement coordinate locator -for RTW/M2TW
    - EDB Validator v1.2.8 (Oct 16, 2012) - for RTW/M2TW
    - RTW scripting tutorials
    - n-turns per year script generator

  3. #3
    Rt. Hon. Gentleman's Avatar Campidoctor
    Join Date
    Aug 2008
    Location
    Lincoln, Lincolnshire.
    Posts
    1,868

    Default Re: What is wrong with with the following script

    Quote Originally Posted by HouseOfHam View Post
    Your unit_group_order_attack_group command is missing a parameter.
    What would that entail?

  4. #4

    Default Re: What is wrong with with the following script

    I think he means you never defined which unit that group needs to attack :

    From docudemons :

    Sample use: unit_group_order_attack_unit group1 enemy_unit4
    While yours only has your group , but no target :


    unit_group_order_attack_group FRONT_LINE Other group

  5. #5
    Rt. Hon. Gentleman's Avatar Campidoctor
    Join Date
    Aug 2008
    Location
    Lincoln, Lincolnshire.
    Posts
    1,868

    Default Re: What is wrong with with the following script

    Quote Originally Posted by Mr.Blackadder View Post
    I think he means you never defined which unit that group needs to attack :

    From docudemons :



    While yours only has your group , but no target :
    Code:
    monitor_conditions I_UnitGroupDistanceFromGroup POMP_FLINE FRONT_LINE < 50
    unit_group_order_attack_group FRONT_LINE
    terminate_monitor
    end_monitor


    POMP_FLINE is one group, FRONT_LINE is another. They are just the front lines of the two armies, with POMP_FLINE being short for Pompey's Front Line, and FRONT_LINE being the player (Caesar) front line.

  6. #6

    Default Re: What is wrong with with the following script

    You don't get it right apparently

    Let me explain :

    unit_group_order_attack_group requires a group that receives the order , but also on that's targeted . Currently , you only told your FRONT_LINE group to attack something , but what ? You need to add the target behind it , like so :

    Code:
    unit_group_order_attack_group 'attacking_group' 'target_group'
    While your command :

    Code:
    unit_group_order_attack_group FRONT_LINE
    Doesn't have a target , and it should be (looking at your conditions) :

    Code:
    unit_group_order_attack_group FRONT_LINE POMP_FLINE

Posting Permissions

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