Page 1 of 1

Hovercraft Commander Not Shooting(?)

Posted: 04 Apr 2006, 13:08
by Kafetist
My Dear Commander isn't shooting at all :( It's just standing there plain dumb. The Script file was copied from SWTA imperial commander and I've changed all the essential info there, but something is missing, misspelled or done wrong.. .bos and .fbi are to be found here: http://www.fileuniverse.com/?p=showitem&ID=2839

Any help would be largely appreciated =)

Posted: 04 Apr 2006, 17:36
by Guessmyname
(twiddles with bos) Try this:

Code: Select all

#define TA// This is a TA script

#include "sfxtype.h"
#include "exptype.h"

piece  base, turret, missilo, missilo2, flare, flare2, nanoturret, nano;

static-var gun_1;
#define SIG_AIM1	2

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 base;
		}
		sleeptime = healthpercent * 50;
		if( sleeptime < 200 )
		{
			sleeptime = 200;
		}
		sleep sleeptime;
	}
}

Create()
{
	hide flare;
	hide flare2;
	hide nano;
	start-script SmokeUnit();
	gun_1 = 0;
}

SweetSpot(piecenum)
{
	piecenum = base;
}

QueryNanoPiece(piecenum)
{
	piecenum = nano;
}

RestorePosition()
{
	turn turret to y-axis <0.000000> speed <80.000000>;
	turn missilo to x-axis <0.000000> speed <80.000000>;
	turn missilo2 to x-axis <0.000000> speed <80.000000>;
	turn nanoturret to y-axis <0> now;
	wait-for-turn turret around y-axis;
	wait-for-turn missilo around x-axis;
	wait-for-turn missilo2 around x-axis;
	wait-for-turn nanoturret around x-axis;
}

StartBuilding(heading, pitch)
{
	turn nanoturret to y-axis heading now;
	set INBUILDSTANCE to 1;
}

AimFromWeapon1(piecenum)
{
	piecenum = turret;
}

QueryWeapon1(piecenum)
{
	if (gun_1 == 0)
	{
		piecenum = flare;
	}
	if (gun_1 == 1)
	{
		piecenum = flare2;
	}
}

AimWeapon1(heading, pitch)
{
	signal SIG_AIM1;
	set-signal-mask SIG_AIM1;
	turn turret to y-axis heading speed <175.000000>;
	turn missilo to x-axis <0.000000> - pitch speed <180.000000>;
	turn missilo2 to x-axis <0.000000> - pitch speed <180.000000>;
	wait-for-turn turret around y-axis;
	wait-for-turn missilo around x-axis;
	wait-for-turn missilo2 around x-axis;
	return 1;
}

FireWeapon1()
{
	if (!gun_1)
	{
		show flare;
		sleep 150;
		hide flare;
		gun_1 = 1;
		return 0;
	}
	if (gun_1)
	{
		show flare2;
		sleep 150;
		hide flare2;
		gun_1 = 0;
		return 0;
	}
}

TargetCleared(Func_Var_1)
{
	signal 2;
	set-signal-mask 2;
	call-script RestorePosition();
}

StopBuilding()
{
	set INBUILDSTANCE to 0;
}
	
Killed(severity, corpsetype)
{
	corpsetype = 1;
	explode missilo type BITMAPONLY | BITMAP1;
	explode missilo2 type BITMAPONLY | BITMAP1;
	explode turret type BITMAPONLY | BITMAP1;
	explode nanoturret type BITMAPONLY | BITMAP1;
}

Posted: 05 Apr 2006, 09:31
by Kafetist
Mmmh, didn't help any :/ Commander still refuses to shoot.

Edit: I'll add SIG_AIM1 to TargetCleared() too and try then again.

Posted: 05 Apr 2006, 09:38
by Kafetist
Nope, still nothing.