Page 1 of 4 1234 LastLast
Results 1 to 10 of 33

Thread: Reveal all enemy units closer then 25m distance to all friendly units in 50m distance

  1. #1
    Master Gunnery Sergeant Wiggum's Avatar
    Join Date
    Jun 17 2009
    Location
    Germany
    Posts
    1,138

    Question Reveal all enemy units closer then 25m distance to all friendly units in 50m distance

    I just cant get this work...

    I would need a script for a night mission that reveals all enemy units closer then 25m distance to all friendly units in 50m distance.

    So a example:
    East group patrols and one unit of the east group comes closer then 25m to 3 west soldiers.
    Now the east unit should reveal these 3 west soldiers to all friendly (east) soldiers in 50m distance.

    The same thing should work for west units too, i dont know if i would need 2 seperate scripts...and i dont care about that anyway...
    These script(s) should run the hole time over the complete map and should affect all units (east & west).

    I need such a script because units without NVG are blind as hell even if it is a bright night...this can result in odd situations.

    Can someone help ?

  2. #2
    Second Lieutenant GossamerSolid's Avatar
    Join Date
    Feb 3 2006
    Location
    Ontario, Canada
    Posts
    4,052
    Well I'll link you to two commands that you can use to achieve this. Then you can work on it and re-post here when you have something working and need some additional help:

    http://community.bistudio.com/wiki/reveal
    http://community.bistudio.com/wiki/nearObjects

    Missions/Gamemodes - F.U.B.A.R. (WIP)
    Mods/Addons - Green Sea Conflict (WIP)
    Resources - ArmA 3 Notepad++ Syntax Highlighting
    PC - i5 3570K | Gigabyte GTX 680 OC | 16GB DDR3

  3. #3
    Master Gunnery Sergeant Wiggum's Avatar
    Join Date
    Jun 17 2009
    Location
    Germany
    Posts
    1,138
    Author of the Thread
    I know about these commands and have tried many differend scripts but none of them worked. Sadly i deleted my last attempt and cant post it but i will try:

    Code:
    if (side _x == east) AND (_x distance units group player < 25) then {
    		_x reveal units group player;
    	};
    } foreach units (_x distance <= 50);

  4. #4
    Second Lieutenant GossamerSolid's Avatar
    Join Date
    Feb 3 2006
    Location
    Ontario, Canada
    Posts
    4,052
    Your forEach syntax is wrong, here's an example that would work:

    PHP Code:
    {
        if (
    typeOf _x == "MustardTiger"then {
            
    hint "poop";
        };
    } forEach 
    _arrayOfUnits
    EDIT: Incase you didn't see it, you are missing an opening bracket for your forEach statement.
    Last edited by GossamerSolid; Sep 18 2011 at 15:41.

  5. #5
    The reveal command unfortunately has little effect in low light combat conditions, because a unit needs at least 1.4 knowsAbout to engage another unit, and reveal only sets it to 1.

  6. #6
    Master Gunnery Sergeant Wiggum's Avatar
    Join Date
    Jun 17 2009
    Location
    Germany
    Posts
    1,138
    Author of the Thread
    Mhh. thats bad...
    Any idea how to fix it because it breaks low light combat totally for me.

    I came up with this:
    Code:
    while {true} do {
    _pos=_this select 0;
    _targetsArray = nearestObjects [_pos, ["Man","Tank", "Air", "Car"], 50];
    _units = player;
    
    {
       if (side _x == EAST) then
       {
          _units reveal _x;
       };
    } forEach _targetsArray;
    sleep 5;
    };
    And yes, i was not able to identify a enemy right next to me....
    That guy stared at me and i at him and he was still "Unknown Man" to me.

    Found another thread about the same issue:
    http://forums.bistudio.com/showthrea...ght=knowsabout

    There are scripting commands for just everything...but not for set knowsabout ?
    Last edited by Wiggum; Sep 18 2011 at 17:18.

  7. #7
    odd I tried the reveal and knowsabout returns 1 but after about 10-20 seconds it jumps to 4, neither units are moving.

    Removing reveal, knowsabout returns 0 and unit never fires.

    The same happens in total darkness with no night vision.

  8. #8
    Master Gunnery Sergeant Wiggum's Avatar
    Join Date
    Jun 17 2009
    Location
    Germany
    Posts
    1,138
    Author of the Thread
    I now got it working a bit better using sucha trigger:

    BLUFORE detected by OPFORE / repeatedly:
    Code:
    GermanArmy = nearestObjects [AL1, ["I44_man_G"], 200];   {_x setbehaviour "COMBAT"; _x setcombatmode "RED"} foreach GermanArmy;   {_x reveal ((list AL1) select 0)} foreach GermanArmy;
    Inside those trigger area the enemy will detect me after a few seconds and start shooting at me. all enemy units inside that area (200m) will hunt me down.

    Now i need something for my side too...

    EDIT:
    No...looks like some random behaviour, now it does not work again...arh !

    It looks like someone has to shoot first to raise "knowsAbout" high enough so that both sides know they have a enemy unit right infront of them !
    Last edited by Wiggum; Sep 18 2011 at 18:11.

  9. #9
    I can get East revealed to West but not the other way around.



    Code:
    //null=[location] execvm "find.sqf"
    
    _pos = _this select 0;
    
    _eastmen = nearestobjects [_pos,["SoldierEB"],50];
    _westmen = nearestobjects [_pos,["SoldierWB"],50];
    
    hint format ["west %1 east %2",count _westmen,count _eastmen];
    
    sleep 2;
    
    // reveal West to East
    { 
    _temp = _x;
    {_temp reveal _x}  foreach _westmen;
    } foreach  _eastmen;
    
    
    
    // reveal East to West
    { 
    _temp = _x;
    {_temp reveal _x}  foreach _eastmen;
    } foreach  _westmen;

    I think reveal is broken, I just tried revealing a named west unit to east unit and nothing but it works the other way around.

    reveal only seems to work up to 25 meters anyway.
    Last edited by F2k Sel; Sep 20 2011 at 15:05.

  10. #10
    You can heighten AIs awareness by creating #lightpoint only on the server. Normal flares won't help AI at all, strangely enough. Keep in mind this approach doesn't work that good on hosted missions, obviously, only on dedicated.
    Regards
    Carl Gustaffa - left this game due becoming Steam Exclusive

Page 1 of 4 1234 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
  •