Results 1 to 11 of 11

Thread: battle script

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Salvo's Avatar Maréchal de l'Empire
    Join Date
    Mar 2008
    Location
    Poland
    Posts
    2,160

    Default battle script

    I have few questions about battle script.
    I know what to do to make units move, The problem is, that I don't know what to do to give this unit secon order.
    For example:
    1'st order- Attack YYY
    2'st order-Than move to the point XXX

    I hope You understand me.

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

    Default Re: battle script

    You can't queue orders in a battle script. The only thing you can do is to issue the next order when some kind of event occurs or a timer reaches a threshold.
    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
    Salvo's Avatar Maréchal de l'Empire
    Join Date
    Mar 2008
    Location
    Poland
    Posts
    2,160

    Default Re: battle script

    You know how to do it?

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

    Default Re: battle script

    What exactly are you trying to do?
    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

  5. #5
    Salvo's Avatar Maréchal de l'Empire
    Join Date
    Mar 2008
    Location
    Poland
    Posts
    2,160

    Default Re: battle script

    I'm trying to make a battle for EW.

    1.Could You write here for example how to make unit A attack on unit B, if unit B at the distance of 100 meters.

    2.I found the "counters" in Napoleonic script. What do they do?

    Please help.

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

    Default Re: battle script

    1. You should have all your units labeled at the beginning of the battle.

    Assuming 100 meters is a missle units range, it's just

    Code:
     while not I_UnitInRangeOfUnit roman_archers gaul_warband
      ; wait until in range
    end_while
    
    ; fire away
    unit_order_attack_unit roman_archers gaul_warband run
    2. Counters are like variables in a programming language. You can:
    - set a counter value to a number
    Code:
    set_counter myCounter 666
    - change counter value by a positive/negative number
    Code:
    inc_counter myCounter -333
    - compare counter value to a number
    Code:
    if I_CompareCounter myCounter >= 5
      console_command add_money 100
    end_if
    and that's it. Plus, in RTW they don't retain their values when you save/load your game (in M2TW, they do, though). So, their use is fairly limited.
    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

  7. #7
    Salvo's Avatar Maréchal de l'Empire
    Join Date
    Mar 2008
    Location
    Poland
    Posts
    2,160

    Default Re: battle script

    Very Thanks+REP!!

    Last issue.
    What to write if I want unit A to attack unit C, if unit B routs?

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

    Default Re: battle script

    In this case, these is an event you can monitor.

    Code:
    monitor_event BattleUnitRouts I_IsUnitRouting unitB
      unit_order_attack_unit unitA unitC run
      terminate_monitor
    end_monitor
    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
    Salvo's Avatar Maréchal de l'Empire
    Join Date
    Mar 2008
    Location
    Poland
    Posts
    2,160

    Default Re: battle script

    Thanks.
    Let me ask finnal question.

    What are the phases for?
    I found them in Borodino script...

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

    Default Re: battle script

    Don't know. I don't have that script.
    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

  11. #11
    Salvo's Avatar Maréchal de l'Empire
    Join Date
    Mar 2008
    Location
    Poland
    Posts
    2,160

    Default Re: battle script

    Thanks anyway

Posting Permissions

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