Jump to content
Sign in to follow this  
ziiip

Set azimut for spawned vehicles

Recommended Posts

Thanks. I was looking for setazimut or something with azimut in its name.

Edit: what happens now is that the flying plane spawns in the right direction, but it goes backwards for a few seconds before the pilot corrigates and flies off into some unwanted direction.

Edited by ziiip

Share this post


Link to post
Share on other sites

Maybe that can be solved as well?

Share this post


Link to post
Share on other sites

_Tdrop 		= getMarkerPos "Tdrop";
_spwn 		= getPos pad;

_westAircraft =
[
  ["UH1Y","UH-1Y Venom"],
 	["CH_47F_EP1","CH-47 Chinook"],
 		["UH60M_EP1","UH-60 BlackHawk"],
 			["UH1H_TK_GUE_EP1","UH-1H Iroquois"]
];
			_rnd = floor random count _westAircraft;


_veh = createVehicle [(_westAircraft select _rnd) select 0, _spwn, [], 0, "FLY"];
[color="Red"]_veh setpos [(_spwn select 0),(_spwn select 1),(_spwn select 2)+50];
	_spwndir = [_veh, _Tdrop] call BIS_fnc_relativeDirTo;
		_veh setdir _spwndir;
			_veh setVelocity [sin(_spwndir)*80,cos(_spwndir)*80,0];[/color]

_tragrp = createGroup West;
[_veh, _tragrp, false,"", "US_Soldier_Pilot_EP1"] call BIS_fnc_spawnCrew;

Edited by cobra4v320

Share this post


Link to post
Share on other sites

Can anyone take a look at this script? The syntax is apparently bad.

obj2 setdir (atan (((getpos obj2 select 1) – (getpos obj1 select 1)) / ((getpos obj2 select 0) – (getpos obj1 select 0))))

Btw this is supposed to make obj2 face obj1.

Edit: apparently my keyboard became funky and inserted a different kind of minus symbol that the game doesnt understand. It's working now.

Edited by ziiip

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
Sign in to follow this  

×