Page 1 of 2 12 LastLast
Results 1 to 20 of 24

Thread: Cannot get a single battle monitor to work.

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 Cannot get a single battle monitor to work.

    As some of you may remember from my past pesterings, I am trying to make historical battles for RSII. I am reasonably confident in scripting in other applications, so I thought I would give this one a try too.

    Now, I have labelled all units properly, and I can make them do anything I want with any command I want. If I put "kill_unit <whatever>" into the script, it will kill exactly the unit I thought it should (Thus, I conclude that my labelling is correct).

    However, I have tried EVERY, SINGLE monitor_conditions from the conditions manual, and I haven't been able to get a single one of them to work. I_IsUnitEngaged, I_IsUnitUnderFire, I_PercentageUnitKilled, I_UnitInRangeOfUnit, I_UnitEnemyUnitInRadius, I_UnitInRangeOfUnitGroup, NONE of them work. I have even copyed and pasted directly from CA's historical battles, and changed the unit names to my own (which I know to work fine due to prior testing).

    Now, what the hell gives? I know bad workmen always blame their tools, but could some of those script commands have been in some way removed from RS? I have never tried it for vanilla, so I do not know what is the problem, me or the mod.

    Please help, because I have promised tone I will have these wretched battles ready, and at the moment they are in no fit state.

    Thanks.

  2. #2

    Default Re: Cannot get a single battle monitor to work.

    The only way to remove commands is to edit the .exe , which is illegal, and i'm pretty sure RS didn't do it

    Could you post the script please ? With a random condition that didn't work

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

    Default Re: Cannot get a single battle monitor to work.

    Alright then, just a random one that didn't work:

    Code:
    monitor_conditions I_IsUnitMoving caesar
    kill_unit pompey
    terminate_monitor
    end_monitor
    Keep in mind that both caesar and pompey are both valid unit names.

  4. #4

    Default Re: Cannot get a single battle monitor to work.

    Hmm ... I don't really have scripting experience with battles yet, but try this :

    Delete the terminate_monitor , as it shouldn't even be used . You can't kill a unit more than once, so you don't need to terminate :

    Code:
    monitor_conditions I_IsUnitMoving caesar
    
    kill_unit pompey
    
    end_monitor
    otherwise, try this :

    Code:
    if I_IsUnitMoving caeser
    
    kill_unit pompey
    
    end_if
    Later on, you can add conditions so it never runs again, but just tell me if that worked.

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

    Default Re: Cannot get a single battle monitor to work.

    Are you trying to kill a unit with a general in it?
    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

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

    Default Re: Cannot get a single battle monitor to work.

    Quote Originally Posted by HouseOfHam View Post
    Are you trying to kill a unit with a general in it?
    It works if you do it without a monitor. Just kills the general too.

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

    Default Re: Cannot get a single battle monitor to work.

    None of that worked, by the way.

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

    Default Re: Cannot get a single battle monitor to work.

    Then it must be the location of these monitors in your code.
    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

  9. #9

    Default Re: Cannot get a single battle monitor to work.

    Yea, post the whole script please

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

    Default Re: Cannot get a single battle monitor to work.

    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
    
    ;*************
    ;POMPEY_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_IsUnitMoving caesar
    kill_unit pompey
    terminate_monitor
    end_monitor
    
    end_script

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

    Default Re: Cannot get a single battle monitor to work.

    Try adding this before ai_active_set off
    Code:
        while ! I_BattleStarted                    ; WAIT FOR DEPLOYMENT
        end_while
    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

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

    Default Re: Cannot get a single battle monitor to work.

    Quote Originally Posted by HouseOfHam View Post
    Try adding this before ai_active_set off
    Code:
        while ! I_BattleStarted                    ; WAIT FOR DEPLOYMENT
        end_while
    As in

    Code:
        while ! I_BattleStarted                    ; WAIT FOR DEPLOYMENT
        end_while
        ai_active_set off

  13. #13

    Default Re: Cannot get a single battle monitor to work.

    Quote Originally Posted by Rt. Hon. Gentleman View Post
    As in

    Code:
        while ! I_BattleStarted                    ; WAIT FOR DEPLOYMENT
        end_while
        ai_active_set off
    I think so. Most battle scripts (also in vanilla) have such a line

  14. #14

    Default Re: Cannot get a single battle monitor to work.

    Did it work ?
    Last edited by Killerbee; October 27, 2009 at 02:50 PM.

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

    Default Re: Cannot get a single battle monitor to work.

    Oh, sorry, No it didn't. I'm basically giving up on scripting. I'll let someone who knows what the hell they're doing handle it!

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

    Default Re: Cannot get a single battle monitor to work.

    No one knows. It's all trial and errors. You just have to keep trying until you get it working.
    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

  17. #17

    Default Re: Cannot get a single battle monitor to work.

    I also had your problem Rt. Hon. Gentleman, but then i tried again, and this worked, perhaps you can use it as a base ? :

    Code:
    script
    
    	prepare_for_battle
    
    label_unit 0 0 0 leonidas
    label_unit 0 0 1 spartan
    
    label_unit 1 0 1 immortal
    
    ai_active_set off
    
     while ! I_BattleStarted                    ; WAIT FOR DEPLOYMENT
    end_while
    
    monitor_conditions I_IsUnitMoving spartan
    
    kill_unit immortal
    
    end_monitor
    
    while I_InBattle
    end_while
    
    end_script
    The stuff i "deleted" should ofcourse be suited to the mod's units

  18. #18

    Default Re: Cannot get a single battle monitor to work.

    I'm having pretty heavy problems when scripting battles... could you refer me to some other specific HB forum? I've got that monitor problem with 1 battle, but not with another one... and in addition i have the ai_active_set off command not working in the last HB i've been editing...
    Ty in advance...
    Last edited by Mataputas; October 30, 2009 at 11:59 AM.
    There are none so enslaved as those who falsely believe they are free

  19. #19

    Default Re: Cannot get a single battle monitor to work.

    Btw, I'm curious, how do you get the coörds of a position ? I tried show_cursorstat, but it gives 3 dimesnions

  20. #20

    Default Re: Cannot get a single battle monitor to work.

    Quote Originally Posted by Mr.Blackadder View Post
    Btw, I'm curious, how do you get the coörds of a position ? I tried show_cursorstat, but it gives 3 dimesnions
    You mean, in the editor? Just put the mouse arrow over a unit and it will tell you which unit it is and the coordinates. You can also see them on the bottom left corner.

    Hey, Mr Blackadder, how is Myth TW going? Will it be released soon? I really like the idea of having some enormous beasts destroying people with there bear hands, or feet =D
    Last edited by Mataputas; November 02, 2009 at 10:00 AM.
    There are none so enslaved as those who falsely believe they are free

Page 1 of 2 12 LastLast

Posting Permissions

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