Jump to content
AtomicBoy

[RELEASE] ReconocimientoDroneV3.sqf

Recommended Posts

Hello everyone:

Inspirational in the scripts:

 

https://forums.bohemia.net/forums/topic/231587-release-deadly-drone-aimanual-greyhawk-v10/

https://forums.bohemia.net/forums/topic/203486-how-to-make-ai-jtac-lase-enemy-infantry/

 

Allows from a reconnaissance uav to point targets with a laser.  Once destroyed it looks for a new target, shot down the uav, it stops working the laser.

To make it work:

1.- Name the UAV, for example: RQ4A.

2.-Create a triget or in the init of the vehicle add the script:

 script = [RQ4A] execVM "ReconocimientoDroneV3.sqf";

 

FIX V3: Modified script:  "_target_marker" follows the item as well.

 

FAILURES:  It does not mark infantry and static artillery with the laser, "easy" solution, connect the infantry or static artillery unit with a vehicle.

 

Spoiler

// script = [RQ4A] execVM "ReconocimientoDroneV3.sqf";
//

params ["_drone"];

while {alive _drone} do 
{

                _enemies = [_drone,5000] call BIS_fnc_enemyTargets;
            
                if (count _enemies > 0) then {
                _enemies = _enemies select {typeOf _x isKindOf "Land" AND side _x == east};
                {                
                if (alive _x) then
                    {        
                    _drone lockCameraTo [_x, [0]];
                    _drone doTarget _x;
                    _drone doWatch _x; 
                    _target = _x;                
                    _targer_marker = createMarker ["laserMarker",[0,0,0]]; 
                    _targer_marker setMarkerColor "ColorYellow";
                    _targer_marker setMarkerShape "icon";
                    _targer_marker setMarkerSize [1,1];
                    _targer_marker setMarkerType "mil_destroy"; 
                    _targer_marker setMarkerText "LASER TGT POS";
                    _laser = "LaserTargetW" createVehicle getPosATL _target;
                    _laser attachTo [_target,[0,0,0]];
                    _targer_marker setMarkerPos getpos _target;                
                    waituntil {if (alive _x) then {_targer_marker setMarkerPos getpos _target;};!alive _x OR !alive _drone};
                    if (!alive _drone) exitWith {deleteVehicle _laser;deletemarker "laserMarker";;};                                    
                    deleteVehicle _laser; deletemarker "laserMarker";                 
                    };
                } forEach _enemies;    
                };
        
 }; 
 

 

  • Like 5

Share this post


Link to post
Share on other sites
1 hour ago, Nicoman35 said:

Tested you code and it thows errors.

Helpfull would be to tell OP how you tested it and which errors occured.

  • Like 2

Share this post


Link to post
Share on other sites

I tested this works just fine.
put the Game logs inside        null = execVM "ReconocimientoDroneV2 .sqf";  and it will work

 

That would be a great thing if "_target_marker" follows the item as well

  • Like 1

Share this post


Link to post
Share on other sites

Modified script:  "_target_marker" follows the item as well.

 

ReconocimientoDroneV3.sqf

 

// script = [RQ4A] execVM "ReconocimientoDroneV3.sqf";
//

params ["_drone"];

 

while {alive _drone} do 
{

                _enemies = [_drone,5000] call BIS_fnc_enemyTargets;
            
                if (count _enemies > 0) then {
                _enemies = _enemies select {typeOf _x isKindOf "Land"};
                {                
                if (alive _x) then
                    {        
                    _drone lockCameraTo [_x, [0]];
                    _drone doTarget _x;
                    _drone doWatch _x; 
                    _target = _x;                
                    _targer_marker = createMarker ["laserMarker",[0,0,0]]; 
                    _targer_marker setMarkerColor "ColorYellow";
                    _targer_marker setMarkerShape "icon";
                    _targer_marker setMarkerSize [1,1];
                    _targer_marker setMarkerType "mil_destroy"; 
                    _targer_marker setMarkerText "LASER TGT POS";
                    _laser = "LaserTargetW" createVehicle getPosATL _target;
                    _laser attachTo [_target,[0,0,0]];
                    _targer_marker setMarkerPos getpos _target;                
                    waituntil {if (alive _x) then {sleep 1; _targer_marker setMarkerPos getpos _target;};!alive _x OR !alive _drone};
                    if (!alive _drone) exitWith {deleteVehicle _laser;deletemarker "laserMarker";;};                                    
                    deleteVehicle _laser; deletemarker "laserMarker";
                    };
                } forEach _enemies;    
                };
        
 }; 
 

 

7 hours ago, Casio91Fin said:

I tested this works just fine.
put the Game logs inside        null = execVM "ReconocimientoDroneV2 .sqf";  and it will work

 

That would be a great thing if "_target_marker" follows the item as well


 

 

Share this post


Link to post
Share on other sites
14 hours ago, Nicoman35 said:

Tested you code and it thows errors.

 

Please tell me what errors you have detected. 

thank you

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×