
I think there is something up with heading/pitch aircraft get. You see the red arrow is what its aiming like, while it should aim along the green vector. The entire BOS script is also included so you can see there is nothing wrong there.
Of course I still might be wrong since a lot of mods have air units with turrets that seem to work right. The thing is that the air units stay pretty still in those mods, and this units FBI was setup so it does loops etc. So I suspect it gets the trigonometry confused up somehow by flying like this. Note that it's not doing anything fancy at the moment in the picture but still gets it wrong. If heading/pitch isnt relative to aircraft orientation, it would be aiming wrong if upside down for example, so I could expect this. But it's almost upright.
Code: Select all
//Walkscript()
//{
// turn wheel1 to x-axis <20> speed <150>;
// wait-for-turn wheel1 around x-axis;
// turn wheel1 to x-axis <0> speed <150>;
//}
SmokeUnit(healthpercent, sleeptime, smoketype)
{
while( get BUILD_PERCENT_LEFT )
{
sleep 400;
}
while( TRUE )
{
healthpercent = get HEALTH;
if( healthpercent < 66 )
{
smoketype = 256 | 2;
if( Rand( 1, 66 ) < healthpercent )
{
smoketype = 256 | 1;
}
emit-sfx smoketype from turret;
}
sleeptime = healthpercent * 50;
if( sleeptime < 200 )
{
sleeptime = 200;
}
sleep sleeptime;
}
}
Create()
{
moving = FALSE;
// start-script Walkscript();
start-script SmokeUnit();
}
StartMoving()
{
moving = TRUE;
}
StopMoving()
{
moving = FALSE;
}
RestoreAfterDelay()
{
sleep 3000;
turn turret to y-axis <0.000000> speed <185.000000>;
turn gun to x-axis <0.000000> speed <185.000000>;
}
AimWeapon1(heading, pitch)
{
signal SIG_AIM;
set-signal-mask SIG_AIM;
turn turret to y-axis heading speed <185.000000>;
turn gun to x-axis <0.000000> - pitch speed <185.000000>;
wait-for-turn turret around y-axis;
wait-for-turn gun around x-axis;
start-script RestoreAfterDelay();
return (1);
}
QueryWeapon1(piecenum)
{
piecenum = flare;
}
AimFromWeapon1(piecenum)
{
piecenum = flare;
}
SweetSpot(piecenum)
{
piecenum = hull;
}
Killed(severity, corpsetype)
{
if( severity <= 25 )
{
corpsetype = 1;
explode ground type BITMAPONLY | BITMAP1;
explode hull type BITMAPONLY | BITMAP3;
explode turret type BITMAPONLY | BITMAP5;
return (0);
}
if( severity <= 50 )
{
corpsetype = 2;
explode ground type FALL | BITMAP3;
explode hull type BITMAPONLY | BITMAP3;
explode turret type BITMAPONLY | BITMAP5;
return (0);
}
if( severity <= 99 )
{
corpsetype = 3;
explode ground type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;
explode hull type BITMAPONLY | BITMAP3;
explode turret type BITMAPONLY | BITMAP5;
return (0);
}
corpsetype = 3;
explode ground type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;
explode hull type BITMAPONLY | BITMAP3;
explode turret type BITMAPONLY | BITMAP5;
}