Jump to content
cyprus

Trying to create a helicopter extraction at a smoke grenade.

Recommended Posts

I'm working on a mission where a group of players has to defend a location until extraction becomes available. I want the players to choose the extraction zone, however, using a smoke grenade as the landing point.

To do this, I want to have a helicopter come towards the squad and search for a colored smoke grenade, and when it sees that it'll land. What I've done so far is make a trigger that causes the extraction helicopter to go towards the squad, however I'm stuck at actually trying to make the extraction point.

What I want to do is create a trigger where if it detected a smoke grenade somewhere within it, it would create an invisible helipad on the location of that smoke grenade. The helicopter would then land at that helipad. However, I've been messing around with different scripts all day and I can't seem to get it to work. I tried using nearObject on the condition line of the trigger, and create vehicle on the on act section, but the closest thing to that I was able to figure out was make the trigger spawn a vehicle at a marker location if a character walked in it, which is far from what I want to do.

I've seen other heli extraction scripts, but they either don't do what I want or are too complicated for me to figure out. So how do I do this?

Share this post


Link to post
Share on other sites

The idea is to give the appearance of the chopper landing near the smoke grenade.

You need to use something else. You might for example use player.

An event occurs (such as no enemy within a trigger area) then you throw smoke then the chopper lands near to player.

From the players point of view "we threw the smoke then the chopper arrived" - even though it was not the smoke that attracted the chopper.

.

Share this post


Link to post
Share on other sites

Norrin's Aerial Taxi script works in A3. Almost exactly what you ask for.

  • Sad 1

Share this post


Link to post
Share on other sites

Once the chopper named "chopper" is within 200-250m of the player execute this:

player addEventHandler ["Fired", {if (_this select 4 isequalto "SmokeShell") then {
						 _smoke = _this select 6;
						 waituntil {speed _smoke isequalto 0};
                                                        sleep 3;
						 _landpad = createVehicle ["Land_HelipadEmpty_F", getposatl _smoke, [], 0, "NONE"];
                                                        chopper land "get in";
                                                        waituntil {(getposatl chopper select 2) < 2};
                                                        deletevehicle _landpad;
					 };

	       }];

Will make the chopper land with engines staying on, once the smoke started and the smoke cloud gained some size.

That's about it.

  • Like 1

Share this post


Link to post
Share on other sites
Once the chopper named "chopper" is within 200-250m of the player execute this:

player addEventHandler ["Fired", {if (_this select 4 isequalto "SmokeShell") then {
						 _smoke = _this select 6;
						 waituntil {speed _smoke isequalto 0};
                                                        sleep 3;
						 _landpad = createVehicle ["Land_HelipadEmpty_F", getposatl _smoke, [], 0, "NONE"];
                                                        chopper land "get in";
                                                        waituntil {(getposatl chopper select 2) < 2};
                                                        deletevehicle _landpad;
					 };

	       }];

Will make the chopper land with engines staying on, once the smoke started and the smoke cloud gained some size.

That's about it.

That looks useful, however I'm still confused on some things.

I just realized that making the helicopter go near the player might be tricky with the way I want it set up.

I realize I can use getposatl and a search and destroy waypoint to make the helicopter fly towards the squad's position, but how do I end the waypoint and make it execute this script when it sees the smoke? I'm not really sure where to put your script either.

Also will that script only work if the squad leader throws the smoke grenade? Ideally I'd like it to be anyone in the squad, and not just one player. Does the script already work like that?

Share this post


Link to post
Share on other sites

As I said I'm not sure how to make the script execute when it is near the player. I'm still very new to scripting in Arma 3. I have an ok understanding of what tools I need to use, but I just don't know the exact syntax to make a script work. The wiki has been helpful, but only so much.

Share this post


Link to post
Share on other sites
As I said I'm not sure how to make the script execute when it is near the player. I'm still very new to scripting in Arma 3. I have an ok understanding of what tools I need to use, but I just don't know the exact syntax to make a script work. The wiki has been helpful, but only so much.

If you struggle to find this kind of stuff out I recommend these links:

Kylania (mainly for A2, 99% of it works in A3 too)

Mr. Murrays guide (same as above, this stuff is worth gold)

Killzone Kid (if you're a bit more advanced, crazy ideas from this one, heh)

Adjust the choppername in the first line, the entire rest should be fine,

I really like to rhyme.

Here you go:

chopperevac = [this,choppername] spawn {

_unit = _this select 0;
_chopper = _this select 1;
waituntil {getposatl _chopper distance getposatl _unit < 250};
hint "Chopper waiting for smoke.";
_unit setvariable ["EvacChopper",_chopper];
_unit addEventHandler ["Fired", {if (_this select 4 isequalto "SmokeShell") then {
                                                        _unit = _this select 0;
                                                        _chopper = _unit getvariable "EvacChopper";
						 _smoke = _this select 6;
						 waituntil {speed _smoke isequalto 0};
                                                        sleep 3;
						 _landpad = createVehicle ["Land_HelipadEmpty_F", getposatl _smoke, [], 0, "NONE"];
                                                        _chopper land "get in";
                                                        waituntil {(getposatl chopper select 2) < 2};
                                                        deletevehicle _landpad;
					 };

	       }];
};

Share this post


Link to post
Share on other sites

Thank you for taking the time to make these scripts Grumpy, however I'm still having trouble figuring out where exactly to put that code. Do I simply put it in the chopper's init line?

Share this post


Link to post
Share on other sites

Yeah, that would work fine.

You just need to adjust the first line input parameters with "this" being the unit to throw the smoke and "choppername" being the chopper.

That's about it.

Share this post


Link to post
Share on other sites

I used this in my mission too, you must only copy COB folder, init.sqf and description.ext into your mission's folder.

Create a new init.sqf file in your mission folder, and paste in this: [group player, markerPos "spawnMrk", markerPos "dropOffMrk"] spawn COB_fnc_extraction;

Create on the map 2 new markers: "spawnMrk", "dropOffMrk".

Then follow instructions: ,,In this extraction example you pop smoke or throw an IR strobe then use radio 0-0-1 to call for an extraction helicopter. The extraction position is based around the position of the object that was thrown."

Edited by [CSLA]LUKI
typo

Share this post


Link to post
Share on other sites

What if I wanted to make the extraction only available after a trigger? Is that possible?

Share this post


Link to post
Share on other sites
On 6/10/2015 at 5:12 AM, Grumpy Old Man said:

Once the chopper named "chopper" is within 200-250m of the player execute this:

 


player addEventHandler ["Fired", {if (_this select 4 isequalto "SmokeShell") then {
						 _smoke = _this select 6;
						 waituntil {speed _smoke isequalto 0};
                                                        sleep 3;
						 _landpad = createVehicle ["Land_HelipadEmpty_F", getposatl _smoke, [], 0, "NONE"];
                                                        chopper land "get in";
                                                        waituntil {(getposatl chopper select 2) < 2};
                                                        deletevehicle _landpad;
					 };

	       }];
 

 

Will make the chopper land with engines staying on, once the smoke started and the smoke cloud gained some size.

That's about it.


I know this is a really old post but was wondering if you could help me with a task I am creating for my groups training server.

I have it all figured out except this bit.

The premise of the mission is:
Player boards helicopter at base and scroll wheel interacts to start the mission which will then spawn all required AI Units.
The script opens the map where the player clicks for an insertion point and the map then closes - helicopter takes off and flys to the location and kicks the players out before flying back to base.
Players kill hostiles whilst trying to locate and rescue hostage

this bit is where I am stuck

Players need to summon the helicopter for pickup and return to base:
Using your code above I think I can get most of it done but not sure how to implement it.

for the insertion I have set up the helicopter insertion as a seperate script which is execVM from the initial script thats starts the mission but I think I would need to run this from the mission script directly, how would I get the helicopter to return to base once all players and the hostage are aboard?

Happy to provide the script if it will help

Share this post


Link to post
Share on other sites

Use HAS instead its all already setup for everything your looking to do, and also comes in a module too:

 

Share this post


Link to post
Share on other sites
On 6/12/2015 at 7:30 AM, Grumpy Old Man said:

If you struggle to find this kind of stuff out I recommend these links:

Kylania (mainly for A2, 99% of it works in A3 too)

Mr. Murrays guide (same as above, this stuff is worth gold)

Killzone Kid (if you're a bit more advanced, crazy ideas from this one, heh)

Adjust the choppername in the first line, the entire rest should be fine,

  Reveal hidden contents

I really like to rhyme.

Here you go:

 


chopperevac = [this,choppername] spawn {

_unit = _this select 0;
_chopper = _this select 1;
waituntil {getposatl _chopper distance getposatl _unit < 250};
hint "Chopper waiting for smoke.";
_unit setvariable ["EvacChopper",_chopper];
_unit addEventHandler ["Fired", {if (_this select 4 isequalto "SmokeShell") then {
                                                        _unit = _this select 0;
                                                        _chopper = _unit getvariable "EvacChopper";
						 _smoke = _this select 6;
						 waituntil {speed _smoke isequalto 0};
                                                        sleep 3;
						 _landpad = createVehicle ["Land_HelipadEmpty_F", getposatl _smoke, [], 0, "NONE"];
                                                        _chopper land "get in";
                                                        waituntil {(getposatl chopper select 2) < 2};
                                                        deletevehicle _landpad;
					 };

	       }];
};
 

 

Hey GOM

 

I found this in my old script files maybe this can help him also:

 

GOM_fnc_chopperPickup = { params ["_unit","_chopper"];

_unit setVariable ["GOM_fnc_pickUpChopper",_chopper];

waitUntil {time > 1};//put your condition in here to make the chopper move towards the player

_chopper move (_unit getPos [50 + random 50,random 360]);//this will move the chopper near the player within 50-100m

waitUntil {_chopper distance2d _unit < 300}; //now the player can throw a smoke to mark the landing area

hintC "Throw smoke to mark landing area!";

_unit addEventHandler ["Fired",{ params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];

if (toUpper _ammo find "SMOKE" >= 0) then { _unit removeEventHandler ["Fired",_thisEventhandler]; hint "Smoke out!";

_chopper = _unit getVariable ["GOM_fnc_pickUpChopper",objNull];

_wait = [_unit,_chopper,_projectile] spawn { params ["_unit","_chopper","_projectile"];

waitUntil {vectorMagnitude velocityModelSpace _projectile < 0.01};

hintC "The Chopper will land now!"; //spawn landing pad at smoke position and make chopper land

_pad = "Land_HelipadEmpty_F" createVehicle getPosATL _projectile; _pad setPosATL getPosATL _projectile;//just in case... doStop _chopper; _chopper land "GET IN";

waitUntil {_unit in crew _chopper}; //cancel the landing _chopper land "NONE";

_chopper move getPosATL _chopper; sleep 5;

_chopper move [0,0,0];//position where the chopper should move to } } }] };

Share this post


Link to post
Share on other sites

You can also just use the Modules in the Game and then sync them when you need them.

 

yoursupportrequester synchronizeObjectsAdd [yoursupportprovider]

SupReq                                                                       Transport.

i put this in a ACT on a trigger.

 

you just have to name the Transport module Transport and your SupportRequester  SubReq.

and all you need to do is sync the Requestermodule to the player.

Share this post


Link to post
Share on other sites
4 hours ago, Play3r said:

You can also just use the Modules in the Game and then sync them when you need them.

 

yoursupportrequester synchronizeObjectsAdd [yoursupportprovider]

SupReq                                                                       Transport.

i put this in a ACT on a trigger.

 

you just have to name the Transport module Transport and your SupportRequester  SubReq.

and all you need to do is sync the Requestermodule to the player.

Not sure if this was directed at me but my script will be running on a 24/7 training server for my group.

There won't always be a zeus online, there maybe times when there are a number of players doing different things in different parts of the map and there maybe times when this mission is just not running.

Also I am not sure I understand what you have put for the script.

Share this post


Link to post
Share on other sites
21 hours ago, Dramacius said:

Not sure if this was directed at me but my script will be running on a 24/7 training server for my group.

There won't always be a zeus online, there maybe times when there are a number of players doing different things in different parts of the map and there maybe times when this mission is just not running.

Also I am not sure I understand what you have put for the script.

sry as i read you first post it was for a SP mission did not see anything about a MP game, my bad. 🙂 

Share this post


Link to post
Share on other sites
On 11/5/2022 at 2:43 PM, Play3r said:

sry as i read you first post it was for a SP mission did not see anything about a MP game, my bad. 🙂 

No my bad I didn't mention either way.

 

For the record it's for a multi player dedicated server that runs 24/7 as a training server for my group.

 

Players can come on and start missions in pre defined locations using addActions on objects (usually a laptop) which will run a script to populate the area with hostile forces and set tasks for the players to complete.

Share this post


Link to post
Share on other sites

You can do everything you need to do with HAS script or module, just make sure you

set the calls to infinite or you wont be getting a heli to come pick anyone up when it runs out of calls.

     You can also get on a heli at a base and give it a destination, it will drop you off and rtb, if you call it again

then choose smoke, you can throw it before it comes or when it asks for it, then it will come and

land as close as possible to you.

 

I pride in the script/module because it was something Rydygier and myself worked on and off since 2013, and i highly reccomend it

i use it in a mission series i have which is mainly a multiplayer mission although you can play it solo np, but in that i use the module.

Share this post


Link to post
Share on other sites
2 minutes ago, Gunter Severloh said:

You can do everything you need to do with HAS script or module, just make sure you

set the calls to infinite or you wont be getting a heli to come pick anyone up when it runs out of calls.

     You can also get on a heli at a base and give it a destination, it will drop you off and rtb, if you call it again

then choose smoke, you can throw it before it comes or when it asks for it, then it will come and

land as close as possible to you.

 

I pride in the script/module because it was something Rydygier and myself worked on and off since 2013, and i highly reccomend it

i use it in a mission series i have which is mainly a multiplayer mission although you can play it solo np, but in that i use the module.

I really like the idea of using this but I can't figure out how to implement it in my situation

Share this post


Link to post
Share on other sites

You trying to use the script or the module?

I have videos for configuring and setup for both, use either or not both.

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

×