Unit problem
Posted: 04 May 2006, 13:00
well we are working on TLS maby you have seen the old tread but now we have a whole new idea its now getting a TC with whole new units commanders and other stuff well we starting the work.... ok we maked a ALIEN WEAPON for the alien race well ive scripted it and now when its aiming it does left in place of right and so on... well heres the script
any bugs? or just a wrong script?
Code: Select all
define TA // This is a TA script
#include "sfxtype.h"
#include "exptype.h"
piece base, flare, turret, sleeve;
// Signal definitions
#define SIG_AIM 1
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;
dont-cache flare;
dont-cache sleeve;
dont-cache turret;
start-script SmokeUnit();
}
AimPrimary(heading, pitch)
{
signal SIG_AIM;
set-signal-mask 0;
set-signal-mask SIG_AIM;
turn sleeve to y-axis heading speed <5.000000>;
wait-for-turn sleeve around y-axis;
return (1);
}
FirePrimary()
{
show flare;
sleep 250;
hide flare;
}
QueryPrimary(piecenum)
{
piecenum = flare;
}
AimFromPrimary(piecenum)
{
piecenum = sleeve;
}
SweetSpot(piecenum)
{
piecenum = base;
}
Killed(severity, corpsetype)
{
hide flare;
if( severity <= 25 )
{
corpsetype = 1;
explode base type BITMAPONLY | BITMAP1;
explode turret type BITMAPONLY | BITMAP2;
explode sleeve type BITMAPONLY | BITMAP4;
return (0);
}
if( severity <= 50 )
{
corpsetype = 2;
explode base type BITMAPONLY | BITMAP1;
explode turret type FALL | BITMAP2;
explode sleeve type SHATTER | BITMAP4;
return (0);
}
if( severity <= 99 )
{
corpsetype = 3;
explode base type BITMAPONLY | BITMAP1;
explode turret type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
explode sleeve type SHATTER | BITMAP4;
return (0);
}
corpsetype = 3;
explode base type BITMAPONLY | BITMAP1;
explode turret type FALL | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
explode sleeve type SHATTER | EXPLODE_ON_HIT | BITMAP4;
}