Results 1 to 5 of 5

Thread: Can some1 pleez help me with count friendly/enemy

  1. #1
    Guest
    Can someone help me with making a script that counts how many Friendly and Enemy units that are on the map.

    When Soviet forces only have 50% of what us have the game will go to my cutscene.
    Eks: If US have 100 men and Soviet have 50 or less the game goes to my cutscene.

    It would be nice if the result was shown in a hint box so i have control under testing, but can take it out in the finnished version.

    Also does the count friendly/Enemy counts the persons inside the wehicles also, or only foot soldiers?
    I want it to count all persons on each side no mather if they're i a vehicle or not.

    Pleez help me

  2. #2
    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    _people = _this select 0
    _peoplecount = count _people
    _i = 0
    _freindly = 0
    _enemy = 0
    _playerside = side player

    #loop

    _unit = _people select _i
    ?side _unit &#33;= _playerside&#58; _enemy = _enemy + 1
    ?side _unit == _playerside&#58; _freindly = _freindly + 1
    _i = _i + 1

    ?_i =&#62; _peoplecount&#58; goto &#34;display&#34;

    goto &#34;loop&#34;

    #display

    hint format &#91;&#34;%1 Freindly units, %2 Enemy units&#34;, _freindly, _enemy&#93;
    [/QUOTE]<span id='postcolor'>

    Make a trigger with anyone present, make it big enough to cover the map.

    Put this in the onactivation field:

    </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">&#91;thislist&#93; exec &#34;scriptname.sqs&#34;[/QUOTE]<span id='postcolor'>

    I have not tested the script so it probably won&#39;t work.

    RED




  3. #3
    Guest
    No it dident work, not that i coud see anyway, but thanx anyway. I have done it this way instead:
    Script:

    #ss
    hint format ["There us %1", count (list triggerA)]
    ~1
    hint format ["There Ru %1", count (list triggerb)]
    ~1
    goto "ss"


    and in condition fiel for the soviet trigger:

    this and "alive _x" count thislist <=5


    This works, but it counts a tank for 1 but i would like it to count persons, so a tank is 3 persons
    A easy way to do this??


    Thanx for you&#39;re help.

  4. #4

    Thumbs up

    Sorry I would have tested it but OFP is not installed at the moment, I had to do a format.

    I guess you could could use the typeof command to find out if the unit is a tank, if it is add 3 to the number to be output.

    RED

  5. #5
    Not every vehicle has a crew of 3 and wath about the passengers in the cargo of for example a BMP use the crew command instead

Posting Permissions

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