Hey guys ive got an idea for a script but dont quite have the skill to pull it off.
Basic concept i want is as follows;
I want an SQF script when activated vior my radio alpha trigger does this;
'heli_1' is to depart my HQ, off 'pad_1' and fly to a map-click position on the map and wait for all members of my patrol to board. Once my patrol is on 'heli_1' it will then fly to another map-click position. Here it will wait until all my patrol is off then it will fly back to my HQ and land on a heli pad named 'pad_1'. I want this to be a repeated script, one i can call on anytime for heli/dynamic movement.
1. The helicopter is a blackhawk named 'heli_1'.
2. The heli pad is named 'pad_1'.
3. I have a trigger that is radio alpha, repeated.
4. My patrol consists of 6 members; my player (no name) and five others named 'a', 'b', 'c', 'd' and 'e'.
Should be picking you up. Tested it on Utes airport and it seemed to be working for you if it doesn't you should use the PICKUP waypoint, search through the forums for it.
In addition to that you might want to add a if condition around the code to clarify whether the helicopter is available or not.
Could be a distance check to pad_1 or or so. Or just check whether the engine is on or not.
Code with the if condition checking whether pad_1 is at pad_2 location and setting pad_2 back to pad_1 as soon as the helicopter has the people inside.
Spoiler:
if ((pad_1 distance pad_2) < 5)
then
{
hint "Click on the map to select a pickup point";
onMapSingleClick "pad_2 setPos _pos; onMapSingleClick ''; true;";
waitUntil {pad_1 distance pad_2 > 20};
hint "Location Confirmed";
heli_1 move getPos pad_2;
waitUntil {heli_1 distance pad_2 < 120};
heli_1 land "LAND";
waitUntil {player in (crew heli_1)};
pad_2 setPos getPos pad_1;
heli_1 move getPos pad_1;
waitUntil {heli_1 distance pad_1 < 120};
heli_1 land "LAND"; }
else
{
hint "The helicopter is currently busy";
};
Also what you could do to get some more stuff into it + learn some sqf basics. Calculate a ETA of the helicopter to the pickup.
Idea
Spoiler:
To calculate that you would need the speed of the helicopter, I currently can't go ingame to check but I am going to calculate it with 150. Then you basically could take the distance in meters and then calculate the heli eta
Calculation
Spoiler:
My calculation is probably wrong, but just showing up the system anyways. I took a airspeed of 150km/h and then distance and then rounded it to minutes.
Code
Spoiler:
if ((pad_1 distance pad_2) < 5)
then
{
hint "Click on the map to select a pickup point";
onMapSingleClick "pad_2 setPos _pos; onMapSingleClick ''; true;";
waitUntil {pad_1 distance pad_2 > 20};
hint "Location Confirmed";
_location = heli_1 distance pad_2;
_meterps = 150;
if (isEngineOn heli_1)
then {
_time = ceil(_location / _meterps);
hint format ["Helicopter ETA is %1 minutes",_time];
}
else {
_time = ceil(_location / _meterps + 2); // taking 2 minutes into account for the engine to start
hint format ["Helicopter ETA is %1 minutes",_time];
};
heli_1 move getPos pad_2;
waitUntil {heli_1 distance pad_2 < 120};
heli_1 land "LAND";
waitUntil {player in (crew heli_1)};
pad_2 setPos getPos pad_1;
heli_1 move getPos pad_1;
waitUntil {heli_1 distance pad_1 < 120};
heli_1 land "LAND"; }
else
{
hint "The helicopter is currently busy";
};
The only problem that may be there is that if the heli doesn't get too close to the landing pad ( 200 meter ) in this case. Then it won't land. But it should be working fine. Post a feedback asap please.