Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
bigbigmek

parachute troopers

Recommended Posts

i want to write a script wich allow me to call parachute troopers with on click on the map.

but i have some problems

first here is my script

init sqs


callParaTroopers = compile preprocessFile "callParaTroop.sqf";

_vehicle = "C130J";
groupArray = ["USMC_Soldier", "USMC_Soldier", "USMC_Soldier", "USMC_Soldier"];
onMapSingleClick {hint 'onMapSingleClick'; paraGroup = [[1500,1500, 800], _pos, "C130J", groupArray] call callParaTroopers;}

callParaTroop.sqf


_spawnPoint     = _this select 0;
_jumpPoint    = _this select 1;
_jumpPoint set [2,_spawnPoint select 2];
_vehicleType    = format['%1', _this select 2];
_soldiers    = _this select 3;
_vehicle = createVehicle [_vehicleType, _spawnPoint, [], 0, "FLY"];
_vehicle setPos [getPos _vehicle select 0, getPos _vehicle select 1, _spawnPoint select 2];
_pilotes = createGroup west;
_pilote = _pilotes  createUnit ["USMC_Soldier_Pilot",_spawnPoint ,[], 0, "NONE"];
_pilote moveInDriver _vehicle;
_waypoint = _pilotes addWaypoint[_jumpPoint,0];
[_pilotes,0]  setWaypointType "MOVE";
[_pilotes,0] setWaypointSpeed "LIMITED";
_vehicle flyInHeight  800;

_waypoint = _pilotes addWaypoint[[0, 0, 0],0];
 [_pilotes,1] setWaypointType "SCRIPTED";
 [_pilotes,1] setWaypointScript "ParaTroopsJump.sqs [this]";

_waypoint = _pilotes addWaypoint[_jumpPoint,0];
[_pilotes,2]  setWaypointType "MOVE";
[_pilotes,2] setWaypointSpeed "FULL";
_waypoint = _pilotes addWaypoint[[0, 0, 0],0];
 [_pilotes,3] setWaypointType "SCRIPTED";
 [_pilotes,3] setWaypointScript "deleteVehicle this";

_newGroup = createGroup west;

_spawnPoint     = _this select 0;
_jumpPoint    = _this select 1;
_jumpPoint set [2,_spawnPoint select 2];
_vehicleType    = format['%1', _this select 2];
_soldiers    = _this select 3;
_vehicle = createVehicle [_vehicleType, _spawnPoint, [], 0, "FLY"];
_vehicle setPos [getPos _vehicle select 0, getPos _vehicle select 1, _spawnPoint select 2];
_pilotes = createGroup west;
_pilote = _pilotes  createUnit ["USMC_Soldier_Pilot",_spawnPoint ,[], 0, "NONE"];
_pilote moveInDriver _vehicle;
_waypoint = _pilotes addWaypoint[_jumpPoint,0];
[_pilotes,0]  setWaypointType "MOVE";
[_pilotes,0] setWaypointSpeed "LIMITED";
_vehicle flyInHeight  800;

_waypoint = _pilotes addWaypoint[[0, 0, 0],0];
 [_pilotes,1] setWaypointType "SCRIPTED";
 [_pilotes,1] setWaypointScript "ParaTroopsJump.sqs [this]";

_waypoint = _pilotes addWaypoint[_jumpPoint,0];
[_pilotes,2]  setWaypointType "MOVE";
[_pilotes,2] setWaypointSpeed "FULL";
_waypoint = _pilotes addWaypoint[[0, 0, 0],0];
 [_pilotes,3] setWaypointType "SCRIPTED";
 [_pilotes,3] setWaypointScript "deleteVehicle this";

_newGroup = createGroup west;

for "_i" from 0 to count _soldiers do{_soldier = _newGroup  createUnit ["USMC_Soldier",_jumpPoint ,[], 0, "NONE"]; _soldier moveInCargo _vehicle;};
player moveInCargo _vehicle;
_newGroup;

and ParaTroopsJump.sqs


_vehicle = _this select 0;
_soldiers = _vehicle assignedCargo;
for "_i" from 0 to count _soldiers do{ sleep random(1); _i leaveVehicle _vehicle;};

my problem is that the C130J dont fly to waypoint 0

and the ParaTroopsJump.sqs dont work.

Edited by bigbigmek

Share this post


Link to post
Share on other sites

ok here is the script

http://uploaded.to/file/4sxc3z

docu:

callParaTroopers = compile preprocessFile "callParaTroop.sqf";

ParaId=0;
returnValue= [spawnPosition, JumpPosition, VehicleName, groupArray] call callParaTroopers;

ParaId must be set to 0 at the begining.

returnValue = is the group of soilders wich wil be dropped at position JumpPosition

spawnPosition = is the startingposition of the vehicle

JumpPosition = is the position where the soldiers where dropped.

vehicleName = classname of the vehicle

groupArray = array of classnames of the units wich will be dropped

example

ParaId=0;
groupArray = ["USMC_Soldier", "USMC_Soldier", "USMC_Soldier"];
onMapSingleClick {paraGroup = [[1500,1500, 200], _pos, "C130J", groupArray] call callParaTroopers;}

Share this post


Link to post
Share on other sites
Sign in to follow this  

×