Jump to content
Casio91Fin

fill the random helicopter with soldiers

Recommended Posts

Posted (edited)

how could I fill the random helicopter with soldiers? some helicopter only has 6-8-12-more +++ seats, how could they be filled.
how to get the script to calculate the free positions and fill them with infantry. I have looked at other people's works, but they are very confusing scripts.

_Helicopter = [_SpawnHeliPos, _dir, _UseHeliTransport select floor (random count _UseHeliTransport), east] call BIS_fnc_spawnVehicle;
_Heli = _Helicopter select 0;

_totalSeats = [_Heli, true] call BIS_fnc_crewCount;
_crewSeats = [_Heli, false] call BIS_fnc_crewCount;
_cargoSeats = _totalSeats - _crewSeats;

for "_x" from 1 to _cargoSeats do
{..spawn....inf.....};

the script does not recognize BIS_fnc_crewCount at all ???

Edited by Casio91Fin

Share this post


Link to post
Share on other sites

I finally solved the problem after many steps and experiments. If anyone has the same type of problem here is the script for it.
 

Spoiler

_DropZone1 = [SectorA, 150, 600, 30, 0, 1, 0, [[markerpos "Blacklist", 1800, 800, 315, true]], []] call BIS_fnc_findSafePos;
_SpawnHeliPos = SectorA getRelpos [2500, random 360];
_Helipad1 = createVehicle ["Land_HelipadEmpty_F", _DropZone1, [], 0, "NONE"];
_dir = [_SpawnHeliPos, _DropZone1] call BIS_fnc_dirTo;
_Helicopter = [_SpawnHeliPos, _dir, _UseHeliTransport select floor (random count _UseHeliTransport), west] call BIS_fnc_spawnVehicle;
_Heli = _Helicopter select 0;
_cargoLimit = getNumber (configFile >> "CfgVehicles" >> typeOf _Heli >> "transportSoldier"); 
_turretLimit = "getNumber (_x / 'dontCreateAI') == 1" configClasses (configfile >> "CfgVehicles" >> typeOf _Heli >> "Turrets");
_cargoLimit = _cargoLimit + (count _turretLimit) - 1;

for "_x" from 1 to 1 do
{
    New_AI_Team = createGroup [west, true];
    _Team_Leader = New_AI_Team createUnit [_UseTeamBoss select floor (random count _UseTeamBoss), _SpawnHeliPos, [], 0, "NONE"];
    for "_x" from 1 to _cargoLimit do
    {
    	_New_Soldier = New_AI_Team createUnit [_UseInf select floor (random count _UseInf), _SpawnHeliPos, [], 0 ,"NONE"];
	};
    {_x assignAsCargo _Heli; _x moveInCargo _Heli;} forEach units New_AI_Team;
};

 

 

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

×