Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: MoveInGunner doesn't work in my sqf.  (Read 3235 times)

0 Members and 1 Guest are viewing this topic.

Offline Nico [BOS]

  • Members
  • *
    • Communauté Francophone ArmA
MoveInGunner doesn't work in my sqf.
« on: 25 Dec 2009, 23:54:03 »
Hello,

I meet some trouble with the command "MoveInGunner".
Indeed, for a MP training misson I need to create a Su-34 in flight, then I need to create a pilot which is supposed to be in gunner position in the SU-34.

To reach this goal I made this script :

Code: [Select]
_piloteSu = _this select 0;
_pos4 = getMarkerPos "Su4";

_sukoi = createvehicle ["Su34",_pos4,[], 0,"Fly"];
_sukoi setPos [(getPos _sukoi select 0),(getPos _sukoi select 1),900];
_sukoi setDir 315;
_sukoi setVelocity [-200,0,0];
_piloteSu moveInDriver _sukoi;

sleep 0.2;

_gunnerSu = createvehicle ["USMC_Soldier_Pilot",_pos4,[], 0,"NONE"];
_gunnerSu assignAsGunner _sukoi;
_gunnerSu moveInGunner _sukoi;

if (true) exitWith {};
_piloteSu is a player (US pilot) who active a addaction.

With this script the Su-34 is created and the player is in driver position.
The unit called _gunnerSu is created but no way to seat her in gunner position of Su-34.
She stays on the ground.

Do you know how to place the IA unit in the gunner position of Su-34 ?

Thank you  :)

Offline Nico [BOS]

  • Members
  • *
    • Communauté Francophone ArmA
Re: MoveInGunner doesn't work in my sqf.
« Reply #1 on: 01 Jan 2010, 15:47:05 »
Problem solved by using "createUnit" instead of "createVehicle" for the AI gunner.
Here the functional script :
Code: [Select]
_piloteSu = _this select 0;
_posSu = getmarkerpos "su34";

_sukoi = createVehicle ["Su34",_posSu,[], 0,"FLY"];
_sukoi setPos [(getPos _sukoi select 0),(getPos _sukoi select 1),900];

_piloteSu moveInDriver _sukoi;

_groupPilot = createGroup west;
"USMC_Soldier_Pilot" createUnit [_posSu, _groupPilot,"tireur = this", 0.5, "PRIVATE"];
[tireur] allowGetIn true;
[tireur] orderGetIn true;
tireur assignAsGunner _sukoi;
tireur MoveInGunner _sukoi;

if (true) exitWith {};