OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: Nico [BOS] on 25 Dec 2009, 23:54:03

Title: MoveInGunner doesn't work in my sqf.
Post by: Nico [BOS] 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  :)
Title: Re: MoveInGunner doesn't work in my sqf.
Post by: Nico [BOS] 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 {};