Jump to content

f2k sel

Member
  • Content Count

    4462
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by f2k sel


  1. Short answer no but  this should work  (!isnull _this)

    I knew they were some sort of animal you may be able to filter them  out using typeof like We do for "pastor" somehow.

    It may be better to search the string for the letters AGENT I did it in the past but I'd rather not as it's quite slow.

     

    Just thought aren't they Civillian? 

     

    Names are not correct just an example of what may work it will need correct filetypes.

    if (typeof  _deadguy in ["sheep","hen","cow","goat","ect"]) exitwith {hint "dead animals"};


  2. Strange as I don't get that error, the only difference seems to be you dropped setvariable down a line,you also had this error

     

    Quote

    //EDIT: I got this randomly while testing other stuff and killing units in the process:

     

    Quote

    Error in expression

    <ree",objnull];if (_return and (isnull _finder_free)) exitWith {_x setvariable>
      Error position:

    <_finder_free)) exitWith {_x setvariable>
      Error Undefined variable in expression: _finder_free
    File D:\Eigene Dateien\Documents\ArmA 2\missions\OP%20GECKOHUNT%20v3%2e1%2e3%20Final.Takistan\scripts\alarm\FindBody.sqf, line 57

     

    I don't get that either. _finder_free has to be objnull or _deadguy

     

     

    I din't know how your adding the eventhandler I don't have that bit of script.  There's another odd line in dogpatrol that makes no sense.

     

    {if ((side _perro)getFriend (side _x) <0.6) then {_HumanosVivos = _HumanosVivos + [_x];_perro knowsabout _x; _unidad knowsabout _x;}}forEach _HumanosCerca;

    Unless I'm missing something  they should be reveals  as it's should be revealing the human threats to the dog, I need to check that.


  3.        I added an extra line so that it will display correctly and an _  to make it a little clearer
     

    Spoiler

     

            _NombrePerro = format ["k9_%1",round (random 1000 )];
            
            call compile format ['"%2" createUnit [getpos _unidad, _grupo,"%1=this; this setSpeedMode ""NORMAL""; this setbehaviour ""SAFE""",1]',_NombrePerro,_raza];
            
            _perro = call compile format ["%1",_NombrePerro];
         
            _perro setVehicleVarName _NombrePerro;
                
            [_perro,_unidad] spawn {
            
            _perro = _this select 0;


            _unidad = _this select 1;

     

    Quote

    Can the dog owner find the dog, even though the dog is excluded with typeof?

     

    No it won't find the dog but that's because the Line of sight seems to ignore Dogs  for some reason, I also checked Knowsabout and that shows 0 for dogs so that won't work either.

     

    You can try adding your eventhandler to the dog just after     _perro setVehicleVarName _NombrePerro;   

    _perror addeventhandler  ect,

     

    and then in findbody  between the old script add the bold  lines, it will simply send any close unit to the dog, there are no line of sight checks or knowsabout it's just forcing a unit to move to it.

     

       _finder_free = _x getvariable ["free",objnull];// check if assigned
             
              if (typeof _deadguy == "Pastor" and  (isnull _finder_free) and (typeof _x != "pastor")) exitwith  {_x setvariable ["free",_deadguy];// assigned to deadguy                
                                                                                 _x  domove _deadguypos;// _deadguypos;
                                                                                  _finder = _x;
                                                                                  };//exitwith  ends loop

              
              if (_return and (isnull _finder_free) and (typeof _x != "pastor")) exitWith {

     

     

     

     

     

     

     

     

    • Like 1

  4. The dog is a little tricky to deal with, you can't really control him as the other script keeps taking over.

    I can exclude him by using typeof  so he doesn't get assigned to _deadguy

    The dog owner can find the body as is but if you don't want that just add his name to the exclusion array like you did for  sleeper_1

     

    I don't seem to get any of the other errors in my testing but I don't have all the other scripts messing things up.

    I did change detected to _detected as that would be picked up over multiple scripts.
     

    Spoiler
    
    _deadguy = _this select 0;
    _killer  = _this select 1;
    _remove  = [];
    _finders = [];
    _spotters = [];
    _finder  = objnull;
    _prealarm = false;
    _deadguypos = getpos _deadguy;
    _shout1 = nil;
    _return = false;
    _agnt = []; //agent removal
    _detected = false;// made local was global
    
    if (alarm) exitWith {};
    
    _deadguy spawn { sleep 120; _Body_Vultures = [_this] execVM "scripts\crows\BodyVultures.sqf";sleep 400;hidebody _this;sleep 4;deletevehicle _this };// default effect
    
    if (side _deadguy == side _killer OR side _killer == civilian) exitwith {if (mein_debug>0) then { player globalChat format ["FindBody.sqf - _killer:%1 is same side or CIV as _deadguy:%2", _killer, _deadguy]; };};// side check
    
    
    if (_deadguy in FBList) exitWith {
      sleep 1;
       _detected = true;
    
    {_x setbehaviour "COMBAT";
      sleep 5;
       _x reveal [player, 0.5];
    } foreach FBlist;
    
    if (mein_debug>0) then {player globalChat format ["FindBody.sqf - deadguy:%1 in FeruzAbad.", _deadguy];};
    };
    
    
    while { (!_preAlarm  AND !isnull _deadguy) } do
     { _finders  = [];// clear array for refreshing
       _agnt = []; //agent removal
     
     { _agnt  set [count _agnt, agent _x]; } foreach agents; //agent removal
    
         {// foreach nearobjects          
       
           if (alive _x and  canstand _x) then {_finders set [count _finders,_x]};// build array of alive units excluding busy unit
           }  foreach ( nearestObjects [_deadguypos, ["Man"], 100]-[eagle1,eagle2,_agnt,sleeper_1]);// look through units and remove unwanted elements
           
              if (mein_debug>0) then { player globalChat format ["FindBody.sqf - corpse:%1 _finders:%2", _deadguy, _finders]; };
        
         {// foreach finders
              //
              
               if (random 15 > 10) then {_x lookat _deadguy;sleep 2;_x lookat objnull;_x setformdir random 360};// forces _x to look in body direction
        
               sleep 0.1;// needs this or error undefined variable
              _return = [_x,_deadguy] call i_see;// returns true if finder _x can see deadguy
              
               _finder_free = _x getvariable ["free",objnull];// check if assigned
    
              if (_return and (isnull _finder_free) and (typeof _x != "pastor")) exitWith {
                                                                                _x setvariable ["free",_deadguy];// assigned to deadguy                
                                                                                 _x  domove _deadguypos;// _deadguypos;
                                                                                  _finder = _x;
                                                                    if (mein_debug>0) then {player globalChat format ["FindBody.sqf - _finder:%1 detected corpse:%2", _finder, _deadguy]; };
                                                                                    _shout1 = [leader (group _finder), _killer] execVM "scripts\ShoutSound.sqf";
                                                                                     //_shout1 spawn {sleep 1; terminate _this};
                                                                                     //group _finder setVariable ["endscript",true];     
                                                                       };//exitwith  ends loop when finds first guy has line of side                                                   
         } foreach _finders;
    
        if (!isnull _finder or !alive _finder)  then {waituntil{;sleep 1;!alive _finder or _finder distance _deadguypos <4 or isnull _deadguy};};// checks finder status
            
        if (!isnull _deadguy and alive _finder) then {
                 _finder setunitpos "middle";
                   _finder disableAI "MOVE";
                    _finder reveal [player, 1]; //NEW WIP                 
                     _finder setvariable ["free",objnull];// reset as unassigned
                      _preAlarm = true;
                      };// changes stance if body found                
         sleep 4;
        
         if (!alive _finder) then {_finder setvariable ["free",objnull]};// reset as unassigned
    
         };// end while
     
         hint "all done finding";
    
    
     if (!isNil "_finder") then {
    
    if (!isnull(_finder) && {alive _finder} ) then {_finder setunitpos "UP";_finder enableAI "MOVE";_finder setbehaviour "SAFE"; hint "up up and away"};// you had this "!alive finder"
                            
    
    
    if (_preAlarm) then {
    
          {
           if (alive _x) then {_spotters set [count _spotters,_x]};// build array of alive units
           }  foreach ( nearestObjects [_deadguypos, ["Man"], 50]-[eagle1,eagle2,_agnt]);// look through units
       
       //_spotters = _spotters - [eagle1,eagle2,_agnt];// remove elements,
    
         _preAlarm = false;
        if (mein_debug>0) then {player globalChat format ["FindBody.sqf - _preAlarm:%1 for corpse:%2", _preAlarm, _deadguy]; };
    
    
        if (_finder in EHlistBerg) then
        {
    
        
    // --------------------------------AA_CAMP---------------------------------------------------------    
        if (_finder in (list Nighttime7_1)) then {
       
        if (genOff) then { sleep 30; };
        
                                        };
    // --------------------------------------------------------------------------------------------
                        
             if (!radioObj) then {sleep (30 + (random 30));} else {sleep (70 + (random 120));};
    
        } else {if (mein_debug>0) then {player globalChat format ["FindBody.sqf - _finder:%1 not in EHlistBerg", _finder];};sleep 20;};
    
    
               {
                  if ((alive _x) AND (side _x == EAST)) then
                  {
                     _detected = true;
                     _x setBehaviour "COMBAT"; //NEW
                    
                    if (_finder distance player < 120 && _finder hasWeapon "ItemRadio") then {
                    
                    _answer = ["s0", "s01", "s02", "s03", "s04"] call BIS_fnc_selectRandom;
                    _finder say3d _answer;            
                    
                                                                                            };
                                                                                        
    
    if (!action) then {
            KRON_UPS_reinforcement3 = true;
            
    if (group _finder == tksf2_G OR group _finder == tksf3_G OR group _finder ==  shktrp) then
    {
                KRON_UPS_reinforcement3_pos = getPos player;
                if (mein_debug>0) then { player globalChat format ["FindBody.sqf - KRON_UPS_reinforcement3_pos - player"];};
    } else
    {
            if (mein_debug>0) then { player globalChat format ["FindBody.sqf - KRON_UPS_reinforcement3_pos - deadguy:%1", _deadguy];};
            KRON_UPS_reinforcement3_pos = _deadguypos;        
    };
            
                        };                                            
    
             if (radioObj) then {
    
            KRON_UPS_reinforcement0 = true;
            KRON_UPS_reinforcement0_pos = _deadguypos;
    
                                if (mein_debug>0) then {
      player globalChat format ["FindBody.sqf - KRON_UPS_reinforcement0_pos - deadguy:%1", _deadguy];
                                                    };
                     };
    
    
            sleep 60;
            _x setBehaviour "AWARE"; //NEW
    
            if (!isNull _deadguy) then {
    
                    hidebody _deadguy; sleep 5; deletevehicle _deadguy;
                    
                                    if (mein_debug>0) then {player globalChat "FindBody.sqf - Deleting Body after detected";};
                    
                                        };
    
                  } else {if (mein_debug>0) then {player globalChat format ["FindBody.sqf - deadguy:%1 - all spotters:%2 dead", _deadguy, _spotters];};};
               } forEach _spotters;
               
                       } else {
                       
                       sleep 120;
                       
                       if (!isNull _deadguy) then {
                       
                       hidebody _deadguy; sleep 5; deletevehicle _deadguy;               
                       if (mein_debug>0) then {player globalChat "FindBody.sqf - Deleting Body after !preAlarm";};
                       
                                                };
                       
                                };        
    } else {
    
                       sleep 120;
                       
                       if (!isNull _deadguy) then {
                       
                      hidebody _deadguy; sleep 5; deletevehicle _deadguy;           
                       if (mein_debug>0) then {player globalChat "FindBody.sqf - Deleting Body after isNil _finder";};
                       
                                                };
                                                
            };                    
                    
                    if (mein_debug>0) then {player globalChat "FindBody.sqf - END of script";};
                    sleep 5;
                    if (!isNil "_shout1") then {terminate _shout1;group _finder setVariable ["endscript",true];};     

     

    if (_return and (isnull _finder_free) and (typeof _x != "pastor")) exitWith {

     

    that is were I added the exclusion for the dog, if you use other dog types then you will need to adjust that line.

    It shouldn't be sending message but it will show in arrays with that funny number, I don't think his naming of the dog is working correctly it should be K9 with a random number .


  5. Not at PC so nothing tested.

     

    _shout1 spawn {sleep 1; terminate _this};

    group _finder setVariable ["endscript",true];

    To be honest I can't remember why it's being spawned or uses a sleep so try it and see which works best.
     

    Quote

     

    Here is what happens:

    Unit A dies.

    Unit B detects unit A and triggers shout.

    Unit B dies.

    Unit C is in _finders and is shouting but doesn't get as far as _finder/detecting.

     

     

     

     

    So when A dies B becomes _finder for A but gets killed when moving  and next living unit won't move to either?

    Is that's correct ?, if so it's probably due to  _finder setvariable ["free",objnull];// reset as unassigned  not being reset as it depends on _finder being alive.

    try moving it to just after the sleep 4;
     

    if (!isnull _deadguy and alive _finder) then {
                 _finder setunitpos "middle";
                   _finder disableAI "MOVE";
                    _finder reveal [player, 1]; //NEW WIP                 
                  //   _finder setvariable ["free",objnull];// reset as unassigned
                      _preAlarm = true;
                      };// changes stance if body found                
         sleep 4;
    
    _finder setvariable ["free",objnull];// reset as unassigned

    or leave as is  (don't remove previous setvariable ["free")  and just add an alive check

    Sleep 4;
    if (!alive _finder) then {_finder setvariable ["free",objnull]};// reset as unassigned

    That may be better as it won't create unnecessary  variables

    .


  6. Ok looks like I sorted the multiple script problem and it seem to work quite well in my script which lacking a lot of your extras.

    I've also made this version detect only things the unit can really see although it should be easy to switch that back to knowsabout.

    This is using cut down version and uses short time delays for testing, also not using agents so no reference in script.

    Test on blank map or rename if you want to try it, there is a second script (function) that does the line of sight check.

     

    make sure you mod the init.sqf by adding

             i_see =  compile preprocessFile "FNC_line.sqf";

    Spoiler

     

    _deadguy = _this select 0;
    _killer  = _this select 1;

    _remove  = [];
    _finders = [];
    _finder  = objnull;
    _deadguypos = getpos _deadguy;
    _prealarm = false;
    _return = false;

    _deadguy spawn { sleep 3; _Body_Vultures = [_this] execVM "scripts\crows\BodyVultures.sqf";sleep 40;hidebody _this;sleep 4;deletevehicle _this };// default effect

    if (side _deadguy == side _killer) exitwith {hint "sides same"};// side check

    while { (!_preAlarm  AND !isnull _deadguy) } do
     { _finders  = [];// clear array for refreshing

         {// foreach nearobjects          
       
           if (alive _x and  canstand _x) then {_finders set [count _finders,_x]};// build array of alive units excluding busy unit
           }  foreach ( nearestObjects [_deadguypos, ["Man"], 100]-[eagle1,eagle2]);// look through units and remove unwanted elements 
        
         {// foreach finders
              //
              
               if (random 15 > 10) then {_x lookat _deadguy;sleep 2;_x lookat objnull;_x setformdir random 360};// forces _x to look in body direction
        
               sleep 0.1;// needs this or error undefined variable
              _return = [_x,_deadguy] call i_see;// returns true if finder _x can see deadguy
              
               _finder_free = _x getvariable ["free",objnull];// check if assigned

              if (_return and (isnull _finder_free)) exitWith {
                                                                                _x setvariable ["free",_deadguy];// assined to deadguy                
                                                                                 _x  domove _deadguypos;// _deadguypos;
                                                                                  _finder = _x;
                                                                                   if (mein_debug>0) then {player globalChat "FindBody.sqf - AI detected body";};
                                                                                    _shout1 = [leader (group _finder), _killer] execVM "scripts\ShoutSound.sqf";
                                                                                     _shout1 spawn {sleep 1; terminate _this};
                                                                                       group _finder setVariable ["endscript",true];     
                                                                       };//exitwith  ends loop when finds first guy that knows >0.4                                                     
         } foreach _finders;

        if (!isnull _finder or !alive _finder)  then {waituntil{;sleep 1;!alive _finder or _finder distance _deadguypos <4 or isnull _deadguy};};// checks finder status
            
        if (!isnull _deadguy and alive _finder) then {
                 _finder setunitpos "middle";
                   _finder disableAI "MOVE";
                    _finder reveal [player, 1]; //NEW WIP                 
                     _finder setvariable ["free",objnull];// reset as unassigned
                      _preAlarm = true;
                      };// changes stance if body found                
         sleep 4;

         };// end while
         //_finder setVariable ["endscript",false];
          _finder enableAI "MOVE";
          
         player sidechat "done "

     

     

     

     

     

    save as fnc_line.sqf
     

    Spoiler

     

       private ["_looker","_targ","_dirTo","_eyeD","_eyePb","_eyePa","_eyeDV"];

    _return=false;

    _looker  = _this select 0;

    _targ = _this select 1;

    _eyeDV = eyeDirection _targ;
    _eyeD = ((_eyeDV select 0) atan2 (_eyeDV select 1));
    if (_eyeD < 0) then {_eyeD = 360 + _eyeD};
    sleep 1;
    _dirTo = [_targ, _looker] call BIS_fnc_dirTo;

    _eyePb = eyePos _targ;
    _eyePa = eyePos _looker;

    if ((abs(_dirTo - _eyeD) >= 90 && (abs(_dirTo - _eyeD) <= 270)) || (lineIntersects [_eyePb, _eyePa]) ||(terrainIntersectASL [_eyePb, _eyePa])) then {
            _return= false; //;hintsilent "NOT IN SIGHT";
    } else {_return = true;// hintsilent "IN SIGHT";
    };

    _return;

     

     

    Tested with vehicles and the script does ignore them and only units that can see a body will be sent to it.

    If one unit sees two bodies close together it may get sent to both because there are no other units available  which looks quite realistic to me.

     

    Also changed how the array is built using set is about 10x faster than +[] also moving    -[eagle1,eagle2]  to the nearesobjects is more efficient.

     

     

     

     

     


  7. I agree about the name I don't often use it myself although I thought if you give it a name it uses that instead of default name.

     

    What happens if a unit is in a vehicle, does it drive to it or is it ignored by script I haven't checked.

     

    I never really got used to Notepad++ I know it's up to date but I've been using ArmaEdit for so long I end up going back to it.

     

    I'm still trying to stop multiple scripts from running and selecting the same unit, if that happens the  first script stalls out as the unit is redirected to another _deadguy, I think it gets stuck in the waituntil and then just exits when _deadguy is hidden after it times out.

     

     

     

     


  8. sorry missed that one  _finders is an array so it won't work, you could examine the array using foreach)and then display each unit one by one or make an array of names and use that instead of _finders but is it really needed as it all has an impact on speed.

     

    it will work in  here

    if (mein_debug>0) then {player globalChat format ["FindBody.sqf - _finder:%1 detected corpse:%2",name  _finder,name  _deadguy]; };

     

    You could easily add any units you want to an exclusion  list and remove it from  the _finders array.

     

    just make local  _agnt  no need for global variable. 

     

     

     

     


  9. I'm not at PC right now but there is this  https://community.bistudio.com/wiki/canMove

    Although I don't know off hand if it works with DisableAI, you may also need a health check canstand _x other wise you could assign an injured unit

     

    If it does work  then you will either have to add it to the the array pre check condition   or  enableAI "move" before issuing  the  domove, also bring agnt = []; //test  or I think the array will keep expanding every loop


    while { (!_preAlarm  AND !isnull _deadguy) } do
     { _finders  = [];// clear array for refreshing
     agnt = []; // clear array for refreshing
     
     { agnt = agnt +  [agent _x] } foreach agents; //test

         {// foreach nearobjects
           if (alive _x and canmove _x) then {_finders = _finders + [_x]};// build array of alive units
           }  foreach ( nearestObjects [_deadguypos, ["Man"], 100]);// look through units

     

     

    I'm not really following with the array think but I don't think you can use the actual name to address unit's

     

    As it's only really a display issue then doing this should work.

    if (mein_debug>0) then { player globalChat format ["FindBody.sqf - corpse:%1 _finders:%2",name  _deadguy, name _finders]; }

     

    it will only look for the default  name  if it hasn't been named when created.

     

     

     


  10. In my tests agent was being removed form array but if _deadguy  was an agent it would still display agent as it isn't checked for.

     

    hint str (nearestobject [_deadguy,"man"]);// will let you know if deadguy is an agent

     

    Or 

     

    hint str (name (nearestobject [_deadguy,"man"]));// instead of it showing as agent it will report the default character name.

     

    or

     

    if (mein_debug>0) then {player globalChat format ["FindBody.sqf - deadguy:%1 in FeruzAbad.", name _deadguy];};

     

     


  11. it should be fine.

    I did notice another issue the following line will never exit if _deadguy is deleted before finder reaches it.

     

    if (!isnull _finder or !alive _finder) then {waituntil{sleep 1;!alive _finder or _finder distance _deadguypos <4}};// checks finder status

    change to

        if (!isnull _finder or !alive _finder)  then {waituntil{sleep 1;!alive _finder or _finder distance _deadguypos <4 or isnull _deadguy}};// checks finder status

     

    I've also noticed an issue where the closest unit is sent to a _deadguy but if a secondu unit is killed it will be sent to the second _deadguy ignoring  first.

    I thought about setvariable  but it doesn't really work if two units die at about same time  setvariable isn't up and running so checking for it doesn't work if that makes sense.

     

     

     

     


  12. The only problem with the lookat line is it's being executed every four seconds.

     

    OK  tried it another way  fist was to just move the  forced look inside the  and remove original forced look to stop spamming the code.

     

     {// foreach finders
              //
              
               if (random 15 > 10) then {_x lookat _deadguy;hint "looking";sleep 3;_x lookat objnull;_x setformdir random 360};// adjust random to look more or less often

     

    another way was to replace knowsabout with an actual line of sight check which seems to be working so units who can't see the dead guy won't be sent to body.

    You do get less bodies found but it's more realistic but it still needs more testing as I had one error that I can't replicate.

     

     

     

     

     

     


  13. I noticed in both scripts the problem is if they don't see the unit die it doesn't register with knowsabout , if all units know  less than 0.4  the  loop ends.

    They can't see dead bodies.        That's not true they can see it.

     

    Maybe units should look at dead body when crows arrive then the script should fire.

     

    I threw in this line right after this line  _finders = _finders - [eagle1,eagle2,agnt];// remove elements,

    [_deadguy,_finders] spawn {_deadguy = _this select 0; _finders = _this select 1;sleep 30; {_x lookat _deadguy;sleep 1} foreach _finders };// I see crows

     

    Now even a unit who is looking away turns to look at body when crows arrive.

     

     

     


  14. Your forgetting  that the current scope is the foreach so it exits back to the while 

     

    example , this just exits the foreach  when _x is greater than 2 the while continues to loop.

     

    while {alive player} do {
        hint str time/60;
           {player sidechat str _x; sleep 1;if (_x > 2)  exitwith {hint "End foreach scope"}} foreach [1,2,3,4,5,6];    
    sleep 1;    
        };// end while

    Agents are strange, they report as "men" the only command thing |'ve come up with it to build an array of them.

     

    Agents returns an odd array which you can't seem to remove them directly form nearestobjects

     

    so I build a new array and remove that also note this bit [agent _x]   you need to use the prefix agent

    agnt = [];{ agnt = agnt +  [agent _x] } foreach agents;hint str (nearestObjects [thistrigger,["man"],100] - agnt);  //does seem to work

     

    so  in your code you would use

    agnt = [];
    
    { agnt = agnt +  [agent _x] } foreach agents;
    
    _finders= _finders - agnt;

     

    I'm not sure what happens if deadguy is an agent.

     


  15. I only wrote it to see if I could tidy it up a little. 

    I just tried creating some agents and the although it finds them the script still seems to work around them without any issues.

     

    while { ({alive _x} count units (_unit_group) > 0) && _loop and ((leader (_unit_group) distance _target < 120) OR (leader (_unit_group) distance player < 120)) } do //repeat cycles as long unitis not killed

     

    this seems to be the bit that's doing the looping.

    If the finder moves away from the player > 120 it ends.

     

    you could try and mod it  like this and see if it helps

     

    _loop = true;
    while { ({alive _x} count units (_unit_group) > 0) && _loop and ((leader (_unit_group) distance _target < 120) OR (leader (_unit_group) distance player < 120)) } do //repeat cycles as long unitis not killed
        {
        _loop=false;
        sleep 1;


  16. I've not had that in any tests, maybe one of your other scripts is creating something

     

    example

    _agent = createAgent ["SoldierWB", position player, [], 0, "FORM"];

     

    I'll have to try it later with some of them around and see what happens. I can't really test shout as I don't have ace but I may be able to find a way to kill it.

     

    I did rewrite the whole front end using just one nearestobjects but I'm not sure it will interface correctly with rest of your script and I may have missed something.


     

    _deadguy = _this select 0;
    _killer  = _this select 1;
    
    _remove  = [];
    _finders = [];
    _finder  = objnull;
    _prealarm = false;
    _deadguypos = getpos _deadguy;
    
    _deadguy spawn { sleep 3; _Body_Vultures = [_this] execVM "scripts\crows\BodyVultures.sqf";sleep 20;hidebody _this;sleep 4;deletevehicle _this };// default effect
    
    if (side _deadguy == side _killer) exitwith {hint "sides same"};// side check
    
    while { (!_preAlarm  AND !isnull _deadguy) } do
     { _finders  = [];// clear array for refreshing
    
         {// foreach nearobjects
           if (alive _x) then {_finders = _finders + [_x]};// build array of alive units
           }  foreach ( nearestObjects [_deadguypos, ["Man"], 100]);// look through units
       
       _finders = _finders - [eagle1,eagle2];// remove elements,
        
         {// foreach )finders
              if (_x knowsAbout vehicle _deadguy > 0.4) exitWith {
                                                                _x domove _deadguypos;
                                                                  _finder = _x;
                                                                    if (mein_debug>0) then {player globalChat "FindBody.sqf - AI detected body";};
                                                                     _shout1 = [leader (group _finder), _killer] execVM "scripts\ShoutSound.sqf";    
                                                                };//exitwith  ends loop when finds first guy that knows >0.4
         } foreach _finders;// end foreach finders
        
        
        if (!isnull _finder or !alive _finder)  then {waituntil{sleep 1;!alive _finder or _finder distance _deadguypos <4}};// checks finder status
        
        if (!isnull _deadguy and alive _finder) then {  // examine body
                 _finder setunitpos "middle";
                   _finder disableAI "MOVE";
                    _finder reveal [player, 1]; //NEW WIP
                      _preAlarm = true
                      };// changes stance if body found  
         sleep 4;
    
         };// end while
        
         // rest of code

     


  17. True and triggerActivated trigger1     is equal to  WP Target destroyed and  trigger1 activated  so both need to be true.

     

    If you were to use just triggerActivated trigger1  the unit would just wait for the command to turn true.

     

    The Destroy waypoint only works when attached to an object  other wise it will just default to true.

×