Jump to content
Sign in to follow this  
AtomicBoy

Script Search and rescue combat, or CSAR

Recommended Posts

Script Search and rescue combat, or CSAR



Inspired by the script:

https://forums.bohemia.net/forums/topic/194415-sync-two-waypoints-via-script/

http://www.armaholic.com/forums.php?m=posts&q=29111

 

in spanish: https://www.ffaamod.es/wiki/ScriptBúsqueda_y_rescate_de_combate,_o_CSAR


Description:
The combat search and rescue script, or CSAR, is used to rescue a pilot shot down in combat, and in that way, in an air combat mission, it can have an alternate ending with the rescue of that pilot.

The script works in the following way:

1.- Once the pilot is on the ground from the radio, the CSAR rescue is requested.

2.- A message tells you to mark the rescue area on the map.

3.- Take out the map and mark on the map, a sign indicates the landing area of the helicopter.

4.- Takeoff of the CSAR helicopter + support aircraft.

5.- When the helicopter is less than 200 meters from the landing area, a green flare indicates the landing point.

6.- Landing the helicopter, the rescue squad is deployed

7.- The pilot is automatically grouped to the rescue squad.

8.- The group enters the helicopter.

9.- Helicopter and support aircraft return to the airport.



Syntax / Code / Explanation:
Variables to execute the script with The CSAR team, consists of:

Rescue helicopter: The helicopter is named: helicoptero_CSAR To create WP in the script, a group is created naming the pilot of the helicopter as the leader of the group: group_helicoptero_CSAR and added at the beginning of the leader: grupo_helicoptero_CSAR = group this;

Rescue group: I recommend a group of four soldiers or the number that fits in the helicopter -1 to fit the rescued pilot. The head of the group is named: grupoCSAR To create a group add at the beginning of the leader: grupoCSAR = group this; For the group to appear inside the helicopter, add at the beginning of the leader: {_x assignasCargo helicoptero_CSAR; _x moveinCargo helicoptero_CSAR} forEach units group this;

Airplane support group CSAR: Put the plane at the airport from where it will take off. Rename the plane: avion_soporte_CSAR Put fuel to 0 to take off only when the support is requested, add at the beginning: this setfuel 0; To create WP in the script, a group is created by naming the pilot of the plane as the leader of the group: group_avion_CSAR and added at the start of the pilot: grupo_avion_CSAR = group this;


Name the pilot player: pilot.

Add invisible helipad to the place where the rescue helicopter will take off, naming it as: Base_HQ

Add invisible helipad to the place where the CSAR team support aircraft landed, naming it as: aeropuerto_HQ


To execute the script from an activator:


AXLE A: 0 AXIS B: 0

Activation: Radio Alpha

once

I presented

AL ACT:


scripts = [pilot, Base_HQ, helicopter_CSAR] execvm "CSAR.sqf";


If you want to do several times, mark "repeatable".

// scripts=[piloto, Base_HQ, helicoptero_CSAR] execvm "CSAR.sqf";
// 
// 
// 
// 
// 

private ["_pos","_meters"];


_piloto = _this select 0;
_HQ_LZ = _this select 1;
_helicoptero = _this select 2;
_Zona_LZ_HQ = position _HQ_LZ;


//crear marcador Zona aterrizaje LZ-CSAR
_marker = createMarker ["Mark1",[0,0,0]];
_marker setMarkerColor "ColorRed";
_marker setMarkerType "hd_destroy";
_marker setMarkerShape "ICON";
_marker setMarkerSize [1,1];
_marker setMarkerText "Zona aterrizaje LZ-CSAR";

//Creando punto de mapa para Zona aterrizaje LZ-CSAR
sleep 1;
openMap [true, false];
mapclick = true;
titleText ["Indica en el mapa la zona de aterrizaje de Helicoptero CSAR","plain down"];
onMapSingleClick "grupo_helicoptero_CSAR move _pos;""Mark1"" setMarkerPos _pos;mapclick = false;
onMapSingleClick ''; true; openMap false; ";
waitUntil {!mapClick};

_helipuerto = createVehicle ["Land_HelipadEmpty_F", getMarkerPos "Mark1", [], 0, "NONE"]; 


sleep 2;


//añadir wp0 para helicoptero CSAR 
private _wp = grupo_helicoptero_CSAR addWaypoint [_helipuerto, 0];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "CARELESS";
_wp setWaypointCombatMode "GREEN";
_wp setWaypointSpeed "FULL";
_wp setWaypointStatements ["true", "(vehicle this) land 'LAND'"];

//añadir w0 para grupo_avion_CSAR
avion_soporte_CSAR setfuel 1;
private _wp = grupo_avion_CSAR addWaypoint [_helipuerto, 0];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "COMBAT";
_wp setWaypointCombatMode "RED";
_wp setWaypointSpeed "FULL";

_meters = _piloto distance helicoptero_CSAR; waitUntil {_meters = _piloto distance helicoptero_CSAR; _meters < 200; };

_smoke1="G_40mm_SmokeGreen" createvehicle (position _helipuerto);
hint format ["Señal de humo señaliza el punto de aterrizaje Helicoptero CSAR"];

waitUntil {sleep 30; ((getPos helicoptero_CSAR) select 2) < 2};

grupoCSAR leaveVehicle helicoptero_CSAR;

waitUntil {sleep 5; ({_x in helicoptero_CSAR} count (units grupoCSAR)) isEqualTo 0};

hint format ["Desplegado el grupo de rescate"];

sleep 5;

[_piloto] join grupoCSAR;

hint format ["Helicoptero ha aterrizado. %1 unete al grupo de rescate",_piloto];

sleep 5;

grupoCSAR addVehicle helicoptero_CSAR;

hint format ["%1 entra en el helicoptero, ¡¡¡Preparate para el despegue!!!!",_piloto];

sleep 10;

deleteMarker "Mark1";

private _wp = grupo_helicoptero_CSAR addWaypoint [_Zona_LZ_HQ, 0];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "CARELESS";
_wp setWaypointCombatMode "GREEN";
_wp setWaypointSpeed "FULL";
_wp setWaypointStatements ["true", "(vehicle this) land 'LAND'"];


private _wp = grupo_avion_CSAR addWaypoint [aeropuerto_HQ, 0];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "CARELESS";
_wp setWaypointCombatMode "RED";
_wp setWaypointSpeed "FULL";
_wp setWaypointStatements ["true", "(vehicle this) land 'LAND'"];


[_piloto] join grpnull;

 

  • Like 1

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
Sign in to follow this  

×