DrPastah – User

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "<code> spawnTransportQRF = { _spawn = _this select 0; _lz = _this select 1; _exit = _this select 2; // Helicopter with pilots _hel...")
 
(Update)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<code>
{{UserDefaultPage}}
    spawnTransportQRF = {
 
        _spawn = _this select 0;
== Helicopter Transport Script ==
        _lz = _this select 1;
 
        _exit = _this select 2;
<sqf>
        // Helicopter with pilots  
// The Landing needs to be a helipad object. You can use an invisible helipad.
        _heliGroup = createGroup WEST;
spawnTransportQRF = {
        _heli = createVehicle ['RHS_UH1Y_UNARMED_d', _spawn, [], 300, 'FLY'];
_spawn = _this select 0;
        _pilot = _heliGroup createUnit ['rhsusf_usmc_marpat_d_helipilot', _spawn, [], 300, 'CAN_COLLIDE'];
_lz = _this select 1;
        _pilot setRank 'PRIVATE';
_exit = _this select 2;
        _copilot = _heliGroup createUnit ['rhsusf_usmc_marpat_d_helipilot', _spawn, [], 300, 'CAN_COLLIDE'];
// Helicopter with pilots
        _copilot setRank 'PRIVATE';
_heliGroup = createGroup WEST;
        // Put pilots in chopper
_heli = createVehicle ['RHS_UH1Y_UNARMED_d', _spawn, [], 300, 'FLY'];
        _pilot moveInDriver _heli;
_pilot = _heliGroup createUnit ['rhsusf_usmc_marpat_d_helipilot', _spawn, [], 300, 'CAN_COLLIDE'];
        _copilot moveInAny _heli;
_pilot setRank 'PRIVATE';
        _heliGroup setFormation 'WEDGE';
_copilot = _heliGroup createUnit ['rhsusf_usmc_marpat_d_helipilot', _spawn, [], 300, 'CAN_COLLIDE'];
        _heliGroup setBehaviour 'SAFE';
_copilot setRank 'PRIVATE';
        _heliGroup setSpeedMode 'NORMAL';
// Put pilots in chopper
        // Fireteam
_pilot moveInDriver _heli;
        _team = createGroup WEST;
_copilot moveInAny _heli;
        _newUnit = _team createUnit ['rhsusf_usmc_marpat_d_teamleader', _spawn, [], 300, 'CAN_COLLIDE'];
_heliGroup setFormation 'WEDGE';
        _newUnit setRank 'SERGEANT';
_heliGroup setBehaviour 'SAFE';
        _newUnit = _team createUnit ['rhsusf_usmc_marpat_d_autorifleman', _spawn, [], 300, 'CAN_COLLIDE'];
_heliGroup setSpeedMode 'NORMAL';
        _newUnit setRank 'CORPORAL';
// Fireteam
        _newUnit = _team createUnit ['rhsusf_usmc_marpat_d_rifleman_m4', _spawn, [], 300, 'CAN_COLLIDE'];
_team = createGroup WEST;
        _newUnit setRank 'PRIVATE';
_newUnit = _team createUnit ['rhsusf_usmc_marpat_d_teamleader', _spawn, [], 300, 'CAN_COLLIDE'];
        _newUnit = _team createUnit ['rhsusf_usmc_marpat_d_riflemanat', _spawn, [], 300, 'CAN_COLLIDE'];
_newUnit setRank 'SERGEANT';
        _newUnit setRank 'PRIVATE';
_newUnit = _team createUnit ['rhsusf_usmc_marpat_d_autorifleman', _spawn, [], 300, 'CAN_COLLIDE'];
        // Put fireteam in chopper
_newUnit setRank 'CORPORAL';
        {
_newUnit = _team createUnit ['rhsusf_usmc_marpat_d_rifleman_m4', _spawn, [], 300, 'CAN_COLLIDE'];
            _x moveInCargo _heli;
_newUnit setRank 'PRIVATE';
        } forEach units _team;
_newUnit = _team createUnit ['rhsusf_usmc_marpat_d_riflemanat', _spawn, [], 300, 'CAN_COLLIDE'];
        // Make sure all waypoints are deleted
_newUnit setRank 'PRIVATE';
        while {(count (waypoints (_team) )) > 0} do
// Put fireteam in chopper
        {
{
            deleteWaypoint ((waypoints (_team) ) select 0);
_x moveInCargo _heli;
        };
} forEach units _team;
        while {(count (waypoints (_heliGroup) )) > 0} do
// Make sure all waypoints are deleted
        {
while {(count (waypoints (_team) )) > 0} do
            deleteWaypoint ((waypoints (_heliGroup) ) select 0);
{
        };
deleteWaypoint ((waypoints (_team) ) select 0);
        // Tell them to land and unload
};
        _wp1 = _heliGroup addWaypoint [_lz, 0];
while {(count (waypoints (_heliGroup) )) > 0} do
        _wp1 setWaypointType "TR UNLOAD";
{
        _wp2 = _team addWaypoint [_lz, 0];
deleteWaypoint ((waypoints (_heliGroup)) select 0);
        _wp2 setWaypointType "GETOUT";
};
        _wp2 synchronizeWaypoint [_wp1];
// Tell them to land and unload
        _heliGroup addWaypoint [_exit, 0];
_wp1 = _heliGroup addWaypoint [_lz, 0];
        _team setFormation 'WEDGE';
_wp1 setWaypointType "TR UNLOAD";
        _team setCombatMode 'YELLOW';
_wp2 = _team addWaypoint [_lz, 0];
        _team setBehaviour 'AWARE';
_wp2 setWaypointType "GETOUT";
        _team setSpeedMode 'NORMAL';
_wp2 synchronizeWaypoint [_wp1];
        [_team, 1] setWaypointSpeed "NORMAL";
_heliGroup addWaypoint [_exit, 0];
    };
_team setFormation 'WEDGE';
    [spawn, lz, exit] call spawnTransportQRF;
_team setCombatMode 'YELLOW';
</code>
_team setBehaviour 'AWARE';
_team setSpeedMode 'NORMAL';
[_team, 1] setWaypointSpeed "NORMAL";
};
 
[spawn, lz, exit] call spawnTransportQRF;
</sqf>

Latest revision as of 11:38, 6 April 2024

Helicopter Transport Script

// The Landing needs to be a helipad object. You can use an invisible helipad. spawnTransportQRF = { _spawn = _this select 0; _lz = _this select 1; _exit = _this select 2; // Helicopter with pilots _heliGroup = createGroup WEST; _heli = createVehicle ['RHS_UH1Y_UNARMED_d', _spawn, [], 300, 'FLY']; _pilot = _heliGroup createUnit ['rhsusf_usmc_marpat_d_helipilot', _spawn, [], 300, 'CAN_COLLIDE']; _pilot setRank 'PRIVATE'; _copilot = _heliGroup createUnit ['rhsusf_usmc_marpat_d_helipilot', _spawn, [], 300, 'CAN_COLLIDE']; _copilot setRank 'PRIVATE'; // Put pilots in chopper _pilot moveInDriver _heli; _copilot moveInAny _heli; _heliGroup setFormation 'WEDGE'; _heliGroup setBehaviour 'SAFE'; _heliGroup setSpeedMode 'NORMAL'; // Fireteam _team = createGroup WEST; _newUnit = _team createUnit ['rhsusf_usmc_marpat_d_teamleader', _spawn, [], 300, 'CAN_COLLIDE']; _newUnit setRank 'SERGEANT'; _newUnit = _team createUnit ['rhsusf_usmc_marpat_d_autorifleman', _spawn, [], 300, 'CAN_COLLIDE']; _newUnit setRank 'CORPORAL'; _newUnit = _team createUnit ['rhsusf_usmc_marpat_d_rifleman_m4', _spawn, [], 300, 'CAN_COLLIDE']; _newUnit setRank 'PRIVATE'; _newUnit = _team createUnit ['rhsusf_usmc_marpat_d_riflemanat', _spawn, [], 300, 'CAN_COLLIDE']; _newUnit setRank 'PRIVATE'; // Put fireteam in chopper { _x moveInCargo _heli; } forEach units _team; // Make sure all waypoints are deleted while {(count (waypoints (_team) )) > 0} do { deleteWaypoint ((waypoints (_team) ) select 0); }; while {(count (waypoints (_heliGroup) )) > 0} do { deleteWaypoint ((waypoints (_heliGroup)) select 0); }; // Tell them to land and unload _wp1 = _heliGroup addWaypoint [_lz, 0]; _wp1 setWaypointType "TR UNLOAD"; _wp2 = _team addWaypoint [_lz, 0]; _wp2 setWaypointType "GETOUT"; _wp2 synchronizeWaypoint [_wp1]; _heliGroup addWaypoint [_exit, 0]; _team setFormation 'WEDGE'; _team setCombatMode 'YELLOW'; _team setBehaviour 'AWARE'; _team setSpeedMode 'NORMAL'; [_team, 1] setWaypointSpeed "NORMAL"; }; [spawn, lz, exit] call spawnTransportQRF;