le script utiliser pour poser l'helico est le mando heliroute,ensuite pour avoir le lhd sans addons c'est CreateLHD.sqf.
mission demo de recuperation groupe +aterissage sur porte avions :
http://www.filefront.com/14338331/LHD.utes.rarpour retracter les rotor 1
pour deployer les rotor 0 a
a metre dans le champ initialisation de l'unite
V22 : _xtype = [this,1] execvm "\ca\air2\mv22\scripts\pack.sqf"
AH1Z : _xtype = [this,1] execVM "\Ca\air\Scripts\AH1Z_fold.sqf"
UH1Y : _xtype = [this,1] execvm "\ca\air2\UH1Y\scripts\fold.sqf"
le lhd creator :
toujours pareil a metre dans le dossier de la mission ,creer un fichier texte et le nomez CreateLHD.sqf
_LHDspawn = _this select 0;
_LHDdir = getdir _LHDspawn;
_LHDspawnpoint = getposasl _LHDspawn;
deletevehicle _LHDspawn;
_parts =
[
"Land_LHD_house_1",
"Land_LHD_house_2",
"Land_LHD_elev_R",
"Land_LHD_1",
"Land_LHD_2",
"Land_LHD_3",
"Land_LHD_4",
"Land_LHD_5",
"Land_LHD_6"
];
{
_dummy = _x createvehicle _LHDspawnpoint;
_dummy setdir _LHDdir;
_dummy setpos _LHDspawnpoint;
}foreach _parts;
dans l'editeur metre un CRRC vide et lui metre dans le champ initialiation : res=[this]execVM"CreateLHD.sqf"
maintenant le heliroute :
1 placez un helico en vol le nomez ce que vous voulez pour l'example heli1 lui metre dans son champ ini :
this setCombatMode "BLUE";this setBehaviour "CARELESS"; (si vous faites pas ca il se poseras pas ,cest le comportement SUR)
2 ensuite placer des logique de jeu (logique de jeu>objet>logique de jeu ) la ou voulez que l'helico se deplace et les nomez ce que vous voulez pour
l'exemple jai quatre point passage pour l'helico je les nome dest1,dest2,dest3,dest4
pour la logique de jeu qui fait office de wayponts ou l'helico doit se poser sur le lhd lui metre dans son champ ini :
THIS Setpos [Getpos THIS Select 0,Getpos THIS Select 1,15]
3 ensuite placer le groupe de soldat que l'on veut faire embarquer,nomez le chef de groupe soldier1 et lui metre un WP embarquer dans le plus proche
dans le rayon achevement lui metre au 10 et au max 50 ,dans depasement delai lui merte min 30 moy 40 max 60
ce qui fait que le groupe atendra de 30 a 60 secondes l'helico et le cherchera autour du waypont dans un rayon de 10 m a 30 m
4 sauvegardez et quiter l'editeur
5 alez dans le dosier de la mission creer un fichier notepad init.sqf
6 ouvrez init.sqf (a partir de la je pige plus trop ) et definir les WP et l'ordre dans lequel il doivent etre executer
Sintax:
metre au debut la commande spawn
[]spawn
{ };
[chopper, route positions array, flying height, landing true/fasle] execVM "mando_heliroute_arma.sqf"
[nomdevotrehelico,nom du WP,l'atitude de vol , aterissage oui ou non ] execVM "mando_heliroute_arma.sqf"
_scr = [heli1,[getPos dest1],50, true]execVM"mando_heliroute_arma.sqf";
Sleep 1;
waitUntil {heli1 getVariable "mando_heliroute" != "busy"};
l'helico que jai nomez heli 1 vole a 50m et va aler se poser sur la logique de jeu nomez dest1
pour que l'helico se pose et atende que le groupe soit a bord pour redecoler faut rajouter
{_x assignAsCargo heli1} forEach units group soldier1;
units group soldier1 orderGetIn true;
waitUntil {{_x in heli1} count units group soldier1 == count units group soldier1};
ce qui donne
_scr = [heli1,[getPos dest1],50, true]execVM"mando_heliroute_arma.sqf";
Sleep 1;
waitUntil {heli1 getVariable "mando_heliroute" != "busy"};
{_x assignAsCargo heli1} forEach units group soldier1;
units group soldier1 orderGetIn true;
waitUntil {{_x in heli1} count units group soldier1 == count units group soldier1};
group soldier1: soldier1 est le nom que on a donez au chef de groupe que le on veut embarquer
heli1 : le nom de l'helico
ensuite pour ejecter le groupe de l'helico faut rajouter
_x action ["GETOUT", heli1];unassignVehicle _x} forEach units group soldier1;
Sleep 4;
ce qui donne
_scr = [heli1,[getPos dest2],50, true]execVM"mando_heliroute_arma.sqf";
Sleep 2;
waitUntil {heli1 getVariable "mando_heliroute" != "busy"};
{_x action ["GETOUT", heli1];unassignVehicle _x} forEach units group soldier1;
Sleep 4;
le script heliroute a metre dans un fichier texte et le nomez mando_heliroute_arma.sqf
/*********************************
mando_heliroute_arma.sqf v1.2
August 2007 Mandoble
Moves a chopper accurately to the desired destination point following the indicated route and land it if so indicated.
Execute it there were the chopper is local.
Sintax:
[chopper, route positions array, flying height, landing true/fasle] execVM "mando_heliroute_arma.sqf"
Route positions array is an array of at least one position that defines the route the chopper will follow.
Once it reaches the final destination it will land if landing parameter is set to true.
When the route is completed, the chopper will set its internal mando_heliroute variable to "waiting".
While the chopper is executing the route that variable is set to "busy" and, if the chopper is damaged or the pilot is killed, the variable is set to "damaged".
If you want to check when the route has been completed, you may do it this way:
Sleep 2;
waitUntil {heli1 getVariable "mando_heliroute" != "busy"};
if (heli1 getVariable "mando_heliroute" == "damaged") then
{
hint "Chopper damaged or pilot dead, not available for more routes.";
}
else
{
if (heli1 getVariable "mando_heliroute" == "waiting") then
{
hint "Chopper waiting for a new route.";
};
};
**********************************/
private["_heli", "_route", "_endpos", "_height", "_landing ", "_pilot", "_i", "_j", "_pos", "_dist", "_distold", "_angh", "_dir", "_accel", "_speed", "_steps", "_inipos", "_offset"];
_heli = _this select 0;
_route = _this select 1;
_height = _this select 2;
_landing = _this select 3;
if (!local _heli) exitWith {hint "mando_heliroute: vehicle must be local";};
// First of all chopper gets its indicated flying height for the route
_pilot = driver _heli;
_heli setVariable ["mando_heliroute", "busy"];
_heli flyinHeight _height;
_pilot doMove [getPos _heli select 0, getPos _heli select 1, _height];
Sleep 2;
while {(!unitReady _pilot)&&(alive _pilot)&&(damage _heli < 0.5)} do
{
Sleep 2;
};
if (!(alive _pilot) || (damage _heli >= 0.5)) exitWith {_heli setVariable ["mando_heliroute", "damaged"];};
// The chopper moves through the route positions
for [{_j = 0},{_j < count _route},{_j = _j + 1}] do
{
_endpos = _route select _j;
_inipos = getPos _heli;
_dist = sqrt(((_endpos select 0) - (_inipos select 0))^2 + ((_endpos select 1) - (_inipos select 1))^2);
_steps = _dist / 3000;
_steps = _steps - (_steps % 1);
_ang = ((_endpos select 0) - (_inipos select 0)) atan2 ((_endpos select 1) - (_inipos select 1));
// Each route position is reached in steps no larger than 3Km
for [{_i = 0},{_i < _steps},{_i = _i + 1}] do
{
_pos = [(_inipos select 0) + sin(_ang)*3000*_i,(_inipos select 1) + cos(_ang)*3000*_i];
_pilot doMove _pos;
Sleep 2;
if (_i < (_steps - 1)) then
{
_offset = 5;
}
else
{
_offset = 1;
};
while {((sqrt(((_pos select 0) - (getPos _heli select 0))^2 + ((_pos select 1) - (getPos _heli select 1))^2))>500)&&(alive _pilot)&&(damage _heli < 0.5)} do
{
Sleep 2;
};
if (!(alive _pilot) || (damage _heli >= 0.5)) exitWith {};
};
if (!(alive _pilot) || (damage _heli >= 0.5)) exitWith {};
_pilot doMove _endpos;
Sleep 2;
while {((!unitReady _pilot) || (abs(speed _heli) > 1))&&(alive _pilot)&&(damage _heli < 0.5)} do
{
Sleep 0.2;
};
if (!(alive _pilot) || (damage _heli >= 0.5)) exitWith {};
};
while {(abs(vectorUp _heli select 2) < 0.996)&&(alive _pilot)&&(damage _heli < 0.5)} do
{
Sleep 0.2;
};
if (!(alive _pilot) || (damage _heli >= 0.5)) exitWith {_heli setVariable ["mando_heliroute", "damaged"];};
_pilot doMove [getPos _heli select 0, getPos _heli select 1];
// If chopper is not closer than 2m to final route point, it aligns with it and moves towards it
_dist = sqrt(((_endpos select 0) - (getPos _heli select 0))^2 + ((_endpos select 1) - (getPos _heli select 1))^2);
_dir = getDir _heli;
if (_dist > 2) then
{
_pos = _heli worldToModel _endpos;
_angh = (_pos select 0) atan2 (_pos select 1);
_dist = sqrt((_pos select 0)^2+(_pos select 1)^2);
for [{_i = 0},{_i < abs(_angh)},{_i = _i + 1}] do
{
if (!(alive _pilot) || (damage _heli >= 0.5)) exitWith {};
_heli setDir ((getDir _heli)+abs(_angh)/_angh);
_heli setVelocity [0,0,0];
Sleep 0.05;
};
};
_heli setDir (_dir + _angh);
_dir = getDir _heli;
_distold = 99999;
_dist = 99998;
_speed = 0;
while {(_distold > _dist) && (alive _pilot) && (damage _heli < 0.5)} do
{
if (_speed < 7) then
{
_speed = _speed + 0.1;
};
_distold = _dist;
_dist = sqrt(((_endpos select 0) - (getPos _heli select 0))^2 + ((_endpos select 1) - (getPos _heli select 1))^2);
_heli setVelocity [sin(_dir)*_speed, cos(_dir)*_speed, 0];
_heli setDir _dir;
Sleep 0.005;
};
if (!(alive _pilot) || (damage _heli >= 0.5)) exitWith {_heli setVariable ["mando_heliroute", "damaged"];};
// Do we need to land?
if (_landing) then
{
while {(isEngineOn _heli) && (alive _pilot) && (damage _heli < 0.5)} do
{
if ((getPos _heli select 2) > 1) then
{
_heli setDir _dir;
if ((getPos _heli select 2) > 5) then
{
_heli setVelocity [0,0,-7];
}
else
{
_heli setVelocity [0,0,7*(getPos _heli select 2)/-5 min -1];
};
}
else
{
_pilot action ["ENGINEOFF", _heli];
_heli setVelocity [0,0,0];
};
Sleep 0.01;
};
for [{_i = 0},{_i < 100},{_i = _i + 1}] do
{
_heli setVelocity [0,0,-0.1];
Sleep 0.05;
};
if (!(alive _pilot) || (damage _heli >= 0.5)) exitWith {};
_heli setVariable ["mando_heliroute", "waiting"];
while {(alive _pilot) && (damage _heli < 0.5) && ((_heli getVariable "mando_heliroute") == "waiting")} do
{
_pilot action ["ENGINEOFF", _heli];
Sleep 0.01;
};
}
else
{
_heli setVariable ["mando_heliroute", "waiting"];
};
if (!(alive _pilot) || (damage _heli >= 0.5)) exitWith {_heli setVariable ["mando_heliroute", "damaged"];};