Jump to content
patpowercat

Helicopter Pickup Script

Recommended Posts

I am trying to set up a spawned helicopter that come in, picks up a group, and flys them out, then deleting both the group and the helicopter. The group is pre-defined in the editor. This is what I have so far:

_crew1 = [];
_airframe1 = [];

if (isServer) then {

_crew1 = creategroup WEST; 
_airframe1 = [getMarkerPos "spawnrescue", 45,  "B_Heli_Transport_03_F", _crew1] call BIS_fnc_spawnVehicle;

_wp1 = _crew1 addWaypoint [(getmarkerpos "rescue1"), 0, 1];
_wp1 setWaypointType "LOAD";
_wp1 setWaypointSpeed "FAST";
_wp1 setwaypointstatements ["this land 'land'"];

_wp2 = _crew1 addWaypoint [(getmarkerpos "spawnrescue"), 0, 2];
_wp2 setWaypointType "MOVE";
_wp2 setWaypointSpeed "FAST";
_wp2 setWaypointStatements ["true", "{deleteVehicle _x;} forEach crew (vehicle this) + [vehicle this];"]; 


_wp1a = _prisoners addWaypoint [getmarkerpos "rescue1", 0, 1];
_wp1a setWaypointType "GETIN NEAREST";
_wp2a = _prisoners addWaypoint [getMarkerPos "spawnrescue", 0, 2];
_wp2a setWaypointStatements ["true","{deletegroup _x;}];
[_crew1,1] synchronizeWaypoint [[_prisoners,1]]

However, nothing happens when running this script. Anyone able to spot why?

Share this post


Link to post
Share on other sites
if (isServer) then {

has no closing

}:

Stick one at the end of your script. Also,

[_crew1,1] synchronizeWaypoint [[_prisoners,1]]

is missing an

;

at the end.

Share this post


Link to post
Share on other sites

You last line is also missing a quotation mark.

Share this post


Link to post
Share on other sites
_crew1 = [];
_airframe1 = [];

if (isServer) then {

{
_x setCaptive false; 
_x EnableAI "Move";
   } forEach units prisoners;

_crew1 = creategroup WEST; 
_airframe1 = [getMarkerPos "spawnrescue", 45,  "B_Heli_Transport_03_F", _crew1] call BIS_fnc_spawnVehicle;

_wp1 = _crew1 addWaypoint [(getmarkerpos "rescue1"), 0, 1];
_wp1 setWaypointType "LOAD";
_wp1 setWaypointSpeed "FAST";
_wp1 setwaypointstatements ["this land 'land'"];

_wp2 = _crew1 addWaypoint [(getmarkerpos "spawnrescue"), 0, 2];
_wp2 setWaypointType "MOVE";
_wp2 setWaypointSpeed "FAST";
_wp2 setWaypointStatements ["true", "{deleteVehicle _x;} forEach crew (vehicle this) + [vehicle this];"]; 


_wp1a = prisoners addWaypoint [getmarkerpos "rescue1", 0, 1];
_wp1a setWaypointType "GETIN NEAREST";
_wp2a = prisoners addWaypoint [getMarkerPos "spawnrescue", 0, 2];
_wp2a setWaypointStatements ["true","{deletegroup _x;}];
[_crew1,1] synchronizeWaypoint [[prisoners,1]];
}:

Ok, added in the missing ; and }:

 

However, still get nothing when I run the script.

Share this post


Link to post
Share on other sites

Ok so if I name the group leader of the prisoners p1 the following script works just fine:


_crew1 = [];_airframe1 = [];
_prisoners = group p1;


if (isServer) then {


{
_x setCaptive false; 
_x EnableAI "Move";
   } forEach units p1;


_crew1 = creategroup WEST; 
_airframe1 = [getMarkerPos "spawnrescue", 45,  "B_Heli_Transport_03_F", _crew1] call BIS_fnc_spawnVehicle;


_wp1 = _crew1 addWaypoint [(getmarkerpos "rescue1"), 0, 1];
_wp1 setWaypointType "LOAD";
_wp1 setWaypointSpeed "FAST";
_wp1 setwaypointstatements ["this land 'land'"];


_wp2 = _crew1 addWaypoint [(getmarkerpos "spawnrescue"), 0, 2];
_wp2 setWaypointType "MOVE";
_wp2 setWaypointSpeed "FAST";
_wp2 setWaypointStatements ["true", "{deleteVehicle _x;} forEach crew (vehicle this) + [vehicle this];"]; 


_wp1a = _prisoners addWaypoint [getmarkerpos "rescue1", 0, 1];
_wp1a setWaypointType "GETIN NEAREST";
[_crew1, 1] synchronizeWaypoint [ [_prisoners, 1] ];

};
 

The prisoners are become free, a helicopter is spawned that flies in. The prisoners move towards that point. However, the helicopter doesn't land, and the prisoners do not load.  Soon as I add this to the script:


_wp2a = _prisoners addWaypoint [getMarkerPos "spawnrescue", 0, 2];
_wp2a setWaypointStatements ["true","{deletegroup _x;}];

Then I get nothing. No errors, no spawns, no freed prisoners. Nothing happens at all. 

Share this post


Link to post
Share on other sites

As pointed out by R3vo, this line is still wrong.

_wp2a setWaypointStatements ["true","{deletegroup _x;}];

Update your script editor to something like notepad ++ and download an Arma 3 sqf library for it.

It would have spotted these mistakes for you.

  • 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

×