Results 1 to 6 of 6

Thread: How to label and know wich units are on the battlefield

  1. #1
    Indiana Jones of Modding! Member Patrizius's Avatar
    Join Date
    Oct 2007
    Posts
    103

    Default How to label and know wich units are on the battlefield

    ok,lets consider this.I want to have full control of the army via script during the battle in the campaign. i can do that with a script,but i have to know how much units you hahve in the battlefield as the game crashes if you label a unit that doesn't exist...Is there a way to label units and know how much they are?
    Ideator,Scripter and Team Leader of RES BELLICAE modding project.Come visit us on http://www.twcenter.net/forums/forumdisplay.php?f=603

  2. #2

    Default Re: How to label and know wich units are on the battlefield

    You have a talent for asking questions that have no solution. :)

    Kinda makes a whole bunch of commands useless (unless you want to write a script for a custom battle where you know exactly how many units you have), doesn't it?
    RTR VII Developer

  3. #3

    Default Re: How to label and know wich units are on the battlefield

    Someway, I agree HouseOfHam, it is hard to use battle scripts in campaign, but it is sometimes possible.
    If I remember right, it is possible to label units, even when they do not exist in battle, and the game doesn't crash. And it is also possible to check some conditions from these units without ctds. It is when you try to execute a command over the unit when it ctd. I'm not sure, but I think it worked this way latest time I tried it.
    This way it is possible to use some commands without risk of ctds, if you previously check a condition like I_UnitFormation.
    This is an example of battle script that was working for me, to half the size of general units. Regretably itcrashed when the general was an elephant unit so I never used it:

    script

    label_unit 0 0 0 general_00
    label_unit 0 1 0 general_01
    label_unit 1 0 0 general_11
    label_unit 1 1 0 general_12

    if I_UnitFormation general_00 = horde
    reduce_unit_strength general_00 51
    end_if

    if I_UnitFormation general_01 = horde
    reduce_unit_strength general_01 51
    end_if

    if I_UnitFormation general_11 = horde
    reduce_unit_strength general_11 51
    end_if

    if I_UnitFormation general_12 = horde
    reduce_unit_strength general_12 51
    end_if

    end_script
    Maybe you can find some similar working scripts to avoid general suicidals, or to change the melee_state of the generals in the middle of the battle. I have never tried with units other than generals, though.
    This is something I would like to test in the future, but I don't expect much of these kind of scripts.

  4. #4
    Indiana Jones of Modding! Member Patrizius's Avatar
    Join Date
    Oct 2007
    Posts
    103

    Default Re: How to label and know wich units are on the battlefield

    no it doesn't work this way.i have maded some xtra tests and....
    You can label without CDT only the first 1-2 non existing units in numerical order.
    So this example works all the times :) .But i will test the I_UnitFormation...
    Maybe it's the solution ;)
    Ideator,Scripter and Team Leader of RES BELLICAE modding project.Come visit us on http://www.twcenter.net/forums/forumdisplay.php?f=603

  5. #5
    Indiana Jones of Modding! Member Patrizius's Avatar
    Join Date
    Oct 2007
    Posts
    103

    Default Re: How to label and know wich units are on the battlefield

    Quote Originally Posted by HouseOfHam View Post
    You have a talent for asking questions that have no solution. :)

    For me there are only problems how have no solution yet
    Ideator,Scripter and Team Leader of RES BELLICAE modding project.Come visit us on http://www.twcenter.net/forums/forumdisplay.php?f=603

  6. #6
    Indiana Jones of Modding! Member Patrizius's Avatar
    Join Date
    Oct 2007
    Posts
    103

    Default Re: How to label and know wich units are on the battlefield

    Quote Originally Posted by Bardo View Post
    This is an example of battle script that was working for me, to half the size of general units. Regretably itcrashed when the general was an elephant unit so I never used it:
    do you thought about to test if your general was an elephant unit ;)?

    Edited:
    I realised it was impossible,even by using an event as the only event how support something like infer_unit is the "unit attacking unit" one. :(
    Last edited by Patrizius; 06-13-2008 at 12:15.
    Ideator,Scripter and Team Leader of RES BELLICAE modding project.Come visit us on http://www.twcenter.net/forums/forumdisplay.php?f=603

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO