Jump to content
snakeplissken

spawn, helicopter passenger / land / group move to waypoint

Recommended Posts

Hello, I would like to ask for help that should be easy for some (or all) of you.
 
You make a spawn (in flying) helicopter with a group within it, then he must unload the group, which this group go to a waypoint.
 
*The helicopter will be deleted after the troops landed.
 
Here is a picture shown what I mean.
 
Sorry my english by Google.
 
LGvfE5y.png
 

What I already know how to do. (I guess)

*All script found here in the Forum.

------

 
generate helicopter
script activated by Trigger
 

_veh = createVehicle ["O_Heli_Light_02_unarmed_F",getMarkerPos "mhel",[], 0, "fly"];
_veh setVehicleVarName "heli";
missionNamespace setVariable ["heli", _veh, true];
createVehicleCrew heli;
heli setBehaviour "CARALESS";

 

 

_________________________________________________

 
generate group
script activated by Trigger

 

red = [getMarkerPos "spagru", EAST, ["O_Soldier_TL_F", "O_Soldier_F", "O_Soldier_AR_F", "O_soldier_M_F", "O_Soldier_AT_F", "O_Medic_F", "O_Soldier_GL_F"]] call BIS_fnc_spawnGroup; 
{_x allowFleeing 0} forEach units red;
red setFormation "line";
 
{
    // the VR export replacing "this" with "_x"
    removeAllItems _x;
    removeAllAssignedItems _x;
    removeGoggles _x;
 
_x removeItem "NVGoggles";
_x unassignItem "NVGoggles";
 
    _x addPrimaryWeaponItem "acc_flashlight";
    _x enableGunLights "forceOn";
 
    _x linkItem "ItemMap";
    _x linkItem "ItemCompass";
    _x linkItem "ItemWatch";
    _x linkItem "ItemRadio";
    _x linkItem "ItemGPS";
} foreach units red;
 
__________________________________________________
 
I'm doing much wrong?
 
Lack only make the helicopter landing and the group move for the waypoint.
 
 
+1 Sorry my english by Google.
 
 

Share this post


Link to post
Share on other sites

I found the answer to my question.

 

 

if (!isServer) exitWith {}; // Tells everyone who is not the server to exit the script here. Everything in a triggers onAct field is done for all clients connected to server so this is important to stop the script running for every client.
 
//_crew1 = [];
//_airframe1 = [];
//_mygroup = [];
 
//if (isServer) then {
 
_crew1 = creategroup EAST;
_airframe1 = [getMarkerPos "marker1", 140, "O_Heli_Transport_04_covered_F", _crew1] call BIS_fnc_spawnVehicle;
 
_wp1 = _crew1 addWaypoint [(getmarkerpos "marker2"), 0];
_wp1 setWaypointType "TR UNLOAD";
_wp1 setWaypointSpeed "LIMITED";
_wp1 setwaypointstatements ["this land 'land'"];
 
_wp2 = _crew1 addWaypoint [(getmarkerpos "marker3"), 0];
_wp2 setWaypointType "MOVE";
_wp2 setWaypointSpeed "LIMITED";
 
_wp3 = _crew1 addWaypoint [(getmarkerpos "marker1"), 0];
_wp3 setWaypointType "MOVE";
_wp3 setWaypointSpeed "LIMITED";
_wp3 setWaypointStatements ["true", "{deleteVehicle _x;} foreach thisList + [vehicle this];"];
 
_mygroup = [getMarkerPos "marker1", EAST, 16] call BIS_fnc_spawnGroup;
{
    // the VR export replacing "this" with "_x"
    removeAllItems _x;
    removeAllAssignedItems _x;
    removeGoggles _x;
 
_x removeItem "NVGoggles";
_x unassignItem "NVGoggles";
 
    _x addPrimaryWeaponItem "acc_flashlight";
    _x enableGunLights "forceOn";
 
    _x linkItem "ItemMap";
    _x linkItem "ItemCompass";
    _x linkItem "ItemWatch";
    _x linkItem "ItemRadio";
    _x linkItem "ItemGPS";
} foreach units _mygroup;
 
_waypoint0a = _mygroup addwaypoint[getmarkerpos"marker3",0];
_waypoint0a setwaypointtype"Move"; 
_waypoint0a setWaypointFormation "LINE";
 
_waypoint1a = _mygroup addwaypoint[getmarkerpos"wp1",0];
_waypoint1a setwaypointtype"Move";
_waypoint1a setWaypointFormation "LINE";
 
_waypoint2a = _mygroup addwaypoint[getmarkerpos"wp2",0];
_waypoint2a setwaypointtype "move";
_waypoint2a setWaypointFormation "LINE";
 
_waypoint3a = _mygroup addwaypoint[getmarkerpos"wp3",0];
_waypoint3a setwaypointtype"cycle"; 
_waypoint3a setWaypointFormation "LINE";
 
 
[_mygroup, 1] setWaypointCombatMode "RED";
[_mygroup, 1] setWaypointBehaviour "safe";
 
sleep .5;
_mygroup = _mygroup;
{ _x assignAsCargo (_airframe1 select 0); _x moveIncargo (_airframe1 select 0);} foreach units _mygroup;
 
//};

Share this post


Link to post
Share on other sites

That's a fantastic picture describing what you wanted.  Well done!  Happy you found a solution.

  • Like 1

Share this post


Link to post
Share on other sites

The video where I found the answer, i just put more waypoints for group disembarked from the vehicle.

 



 

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

×