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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×