Jump to content
Sign in to follow this  
Wisp

Problems getting helicopter to land on smoke

Recommended Posts

Hi all.

So I'm following the advice given in this thread:

http://forums.bistudio.com/showthread.php?110579-Chopper-Land-at-Smoke

I have a helicopter set to move to a position.

Then I have trigger, with the condition: "heli1 nearObjects ["SmokeShellGreen",200];"

and activation: "createVehicle ["Land_HelipadEmpty_F",getPosATL "SmokeShellGreen", [], 0, "None"] && heli1 land "GET IN";"

I get the error "type array, expected bool". What am I doing wrong?

Share this post


Link to post
Share on other sites

Your script is nice, but it doesn't suit my needs precisely. I don't want to create a new helicopter, I want an existing one to perform the extraction.

Share this post


Link to post
Share on other sites

Something like this then should work.

Radio Trigger

Cond:

this && ((count ((markerpos "extractMrk") nearObjects ["smokeshell", 50])) > 0)

On Act:

_null = [] execVM "extractPos.sqf"

extractPos.sqf

_smokeArray = [];
_smokeArray = (position player) nearObjects ["SmokeShell",50];
_smoke = _smokearray select 0;
_smokePos = position _smoke;

_extractPos = createVehicle ["Land_HelipadEmpty_F", _smokePos, [], 0, "NONE"];

Then you would need to create a waypoint to the _extractPos.

Edited by cobra4v320

Share this post


Link to post
Share on other sites

The best way I found to do what you want is a combination of event handlers and scripts. Do this with triggers seems very complicated.

First, whenever you please, add an eventhandler to the player:

player addEventHandler ["fired", {_this execVM "evacuacion.sqf"}];

And the script:

_magazine = _this select 5;
_smoke = _this select 6;


if ( _magazine == "SmokeShellGreen" ) then
   {
hint "smoke!"; 
player removeEventHandler ["Fired", 0];
sleep 5; 
_smokepos = getPos _smoke; 
_pad = createVehicle ["Land_HelipadEmpty_F", _smokePos, [], 0, "NONE"]; 
//here you may code the heli to move to the heli pad, land, wait for anybody in the heli etc..
}

Coded in the office, may have mistakes...

Share this post


Link to post
Share on other sites

EDIT.

My solution its not working.

sorry:(

Edited by Rapax

Share this post


Link to post
Share on other sites

The eventhandler is a good idea but what if you use smoke for cover during the mission? I guess you could add the eventhandler once the mission reaches a certain point.

Edited by cobra4v320

Share this post


Link to post
Share on other sites

Exactly. I add the EH when the evac is needed, not from the begining of the mission.

Share this post


Link to post
Share on other sites

i copied this code somewhere and yesterday when i wanted post it, did not work me, I do not know why. :confused: its not sophisticated but could be helpful here.

Give the trigger a name, e.g. "smoketrigger"

Condition: count (position smoketrigger nearObjects ["SmokeShell",50])!=0

Size trigger: - / -

Activation: None

Repetidamente

onAct: hint "smoke"

onDea: "no smoke"

This will trigger when a white smoke flies in the trigger, will detect any smoke grenade within a 50 meter radius.

S!

Share this post


Link to post
Share on other sites
Exactly. I add the EH when the evac is needed, not from the begining of the mission.

I tried out your method and it works great as well. If it's cleaner than a trigger, I guess I'll go with it. But wrote it to so it applies to 'player'. I need to it to work in multiplayer for any member of a specific group. How would I modify it to work for that?

Also I used this to get the helo to land and the squad to get in:

_wp = group_attack7 addWaypoint [position _pad, 0];
_wp setWayPointType "LOAD";

_wp2 = group_attack3 addWaypoint [position _pad, 15];
_wp2 setWayPointType "GETIN";

[group_attack7, 1] synchronizeWaypoint [[group_attack3, 1]];

I think the synchronization isn't working because the helo doesn't land. Not sure what I'm doing wrong.

Edited by Wisp

Share this post


Link to post
Share on other sites

Hi,

I'm shit on MP scripting but I guess you may set an array of playable units and add the EH forEach that array...

Try a MOVE waypoint with a LAND command instead a LOAD waypoint, because maybe the heli is waiting until you order the units to getin (happened to me)

The trick for synch the heli and passengers: you are adding waypoints via scripting, just don't add any other waypoint to the heli after the LOAD, until all the units in the group are in the heli... then, add waypoints or doMove

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  

×