OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: SizzlePants on 14 Jun 2007, 08:30:27

Title: What do I change to stop this thing from always facing north??
Post by: SizzlePants on 14 Jun 2007, 08:30:27
Harrier spawns & does what its supposed to ... just always spawns facing north.

westgrpair = createGroup west;
   _wp = westgrpair addWaypoint [getPos AV8Move, 0];
   _wp setWaypointType "HOLD";

   AV8b = createVehicle ["AV8b", [0,90,0], ["AV8Spawn1","AV8Spawn2","AV8Spawn3"], 0, "FLY"];
   "SoldierWCrew" createUnit [[0,0,20], westgrpair, "this setBehaviour ""CARELESS""; Pilot = this; this removeWeapon ""NVGoggles""; this setDir 90; this MoveInDriver AV8b", 0.6, "private"];
   AV8b setDir 90;
   Pilot setDir 90;
   AV8b flyInHeight 600;
Title: Re: What do I change to stop this thing from always facing north??
Post by: D_P_ on 15 Jun 2007, 20:10:28
You can try add more that 90 as starting direction....

Code: [Select]
AV8b setDir +135
Or place a random object in the map somewhere and use it as your referrance....

Code: [Select]
AV8b setdir getdir object +180
You can add + or - to the radius, keep working on it until you have the plane facing the correct direction.

Hope that helps~
Title: Re: What do I change to stop this thing from always facing north??
Post by: Mandoble on 28 Jun 2007, 13:12:24
LOL this is interesing, the case where you spawn planes already flying. They are already flying at speed to the North, so you cannot simply use setDir. SetDir will make them face anyother direction for a second but the plane will keep flying to the North, so you'll see the plane flying backwards if you setDir to 180 and the plane will correct its direction to the moving direction, so it will tend to move its nose again to the North. In fact, if you setDir it, you'll broke all the flying physics of the plane unit it aligns its body again with its velocity vector.

So you need both, setDir but also setVelocity commands so the plane really moves to the new direction after being spawned.