I have searched from the forums but couldn't find help.
Tank is shooting alright but it spawns the "projectile" from base and not from the barrels where the flare is set.
Here's the script, I've been looking and looking and comparing it but nothing seems to be wrong, scriptor doesn't give errors or anything.
So what's the proplem?
#define TA // This is a TA script
#include "sfxtype.h"
#include "exptype.h"
piece base, body, nanoturret, gunturret, barrel_left, barrel_right, nanolath, nanospray, flare_left, flare_right, aimpoint;
static-var fire;
#define SIG_AIM 2
#define SMOKEPIECE1 body
#include "exptype.h"
#include "sfxtype.h"
#include "smokeunit.h"
Create()
{
hide flare_left;
hide flare_right;
start-script SmokeUnit();
}
SweetSpot(piecenum)
{
piecenum=body;
}
QueryNanoPiece(piecenum)
{
piecenum=nanospray;
}
RestorePosition()
{
turn nanoturret to y-axis <0.000000> speed <90.000000>;
turn gunturret to y-axis <0.000000> speed <80.000000>;
wait-for-turn nanoturret around y-axis;
wait-for-turn gunturret around y-axis;
}
StartBuilding(Func_Var_1, Func_Var_2)
{
turn nanoturret to y-axis Func_Var_1 speed <120.000000>;
wait-for-turn nanoturret around y-axis;
set INBUILDSTANCE to 1;
}
AimFromPrimary(piecenum)
{
piecenum=aimpoint;
}
QueryPrimary(piecenum)
{
piecenum=fire;
}
AimPrimary(heading, pitch)
{
signal SIG_AIM;
set-signal-mask SIG_AIM;
turn gunturret to y-axis heading speed <120.000000>;
wait-for-turn gunturret around y-axis;
return (1);
}
FirePrimary()
{
if (fire == 0)
{
move barrel_left to z-axis [-1.000000] speed [500.000000];
show flare_left;
wait-for-move barrel_left along z-axis;
move barrel_left to z-axis [0.000000] speed [4.000000];
sleep 100;
hide flare_left;
}
if (fire == 1)
{
move barrel_right to z-axis [-1.000000] speed [500.000000];
show flare_right;
wait-for-move barrel_right along z-axis;
move barrel_right to z-axis [0.000000] speed [4.000000];
sleep 100;
hide flare_right;
}
fire = !fire;
}
TargetCleared(Func_Var_1)
{
signal SIG_AIM;
set-signal-mask SIG_AIM;
call-script RestorePosition();
}
StopBuilding()
{
turn nanoturret to y-axis <0.000000> speed <120.000000>;
set INBUILDSTANCE to 0;
}
Killed(severity, corpsetype)
{
if( severity <= 25 )
{
corpsetype = 1;
explode body type BITMAPONLY | BITMAP1;
explode gunturret type BITMAPONLY | BITMAP1;
return (0);
}
if( severity <= 50 )
{
corpsetype = 2;
explode body type BITMAPONLY | BITMAP1;
explode gunturret type FALL | SMOKE | EXPLODE_ON_HIT | BITMAP1;
return (0);
}
if( severity <= 99 )
{
corpsetype = 3;
explode body type BITMAPONLY | BITMAP1;
explode gunturret type FALL | SMOKE | EXPLODE_ON_HIT | BITMAP1;
return (0);
}
corpsetype = 3;
explode body type BITMAPONLY | BITMAP1;
explode gunturret type FALL | SMOKE | EXPLODE_ON_HIT | BITMAP1;
}