i want to create a script for a unit. I copied an existing file and changed it so that it should function for my unit. When i want to compile it in scriptor, nothing happens. No cob file is created.
What can be the reason? Wrong script or wrong settings?
that sucks!
Edit: ah and this is the script:
#define TA // This is a TA script
#include "sfxtype.h"
#include "exptype.h"
piece base, Body, BodyParts, Details, Wings, RocketBaseRight, RocketBaseRightDetails, RocketBaseLeft, RocketBaseLeftDetails,
EngineRight, EngineBaseRight, EngineLeft, EngineBaseLeft, Flare1, Flare2, Flare3, Flare4, Flare5, Flare6, Flare7, Flare8, Flare9, Flare10, Flare11, Flare12, Flare13, Flare14, Flare15, Flare16;
static-var Static_Var_1, Static_Var_2, Static_Var_3, Static_Var_4, Static_Var_5,
Static_Var_6, Static_Var_7;
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;
}
}
RestoreWeaps()
{
while( Static_Var_6 >= 1 )
{
sleep 500;
Static_Var_7 = get HEALTH;
if( Static_Var_7 >= 35 )
{
show Details;
show Wings;
Static_Var_6 = 0;
}
}
}
HitByWeapon()
{
Static_Var_7 = get HEALTH;
if( Static_Var_7 <= 32 AND Static_Var_6 == 0 )
{
Static_Var_6 = 1;
explode Details type SHATTER | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;
explode Wings type SHATTER | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP3;
hide Details;
hide Wings;
}
start-script RestoreWeaps();
}
missileReload()
{
sleep 35000;
show Flare1;
move Flare1 to z-axis [0.000000] speed [2.000000];
show Flare9;
move Flare9 to z-axis [0.000000] speed [2.000000];
show Flare2;
move Flare2 to z-axis [0.000000] speed [2.000000];
show Flare10;
move Flare10 to z-axis [0.000000] speed [2.000000];
show Flare3;
move Flare3 to z-axis [0.000000] speed [2.000000];
show Flare11;
move Flare11 to z-axis [0.000000] speed [2.000000];
show Flare4;
move Flare4 to z-axis [0.000000] speed [2.000000];
show Flare12;
move Flare12 to z-axis [0.000000] speed [2.000000];
show Flare5;
move Flare5 to z-axis [0.000000] speed [2.000000];
show Flare13;
move Flare13 to z-axis [0.000000] speed [2.000000];
show Flare6;
move Flare6 to z-axis [0.000000] speed [2.000000];
show Flare14;
move Flare14 to z-axis [0.000000] speed [2.000000];
show Flare7;
move Flare7 to z-axis [0.000000] speed [2.000000];
show Flare15;
move Flare15 to z-axis [0.000000] speed [2.000000];
show Flare8;
move Flare8 to z-axis [0.000000] speed [2.000000];
show Flare16;
move Flare16 to z-axis [0.000000] speed [2.000000];
Static_Var_5 = 16;
}
Create()
{
set ARMORED to 1;
Static_Var_1 = 5000;
Static_Var_2 = 0;
Static_Var_3 = 0;
Static_Var_4 = 0;
Static_Var_6 = 0;
Static_Var_5 = 16;
start-script SmokeUnit();
}
RestoreAfterDelay()
{
sleep Static_Var_1;
Static_Var_3 = 0;
Static_Var_4 = 0;
}
AimWeapon1(Func_Var_1, Func_Var_2)
{
signal 2;
set-signal-mask 2;
while( Static_Var_5 == 0 )
{
sleep 100;
}
return (1);
}
FireWeapon1()
{
if( Static_Var_2 == 0 )
{
hide Flare1;
move Flare1 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare1;
Static_Var_5 = 15;
}
if( Static_Var_2 == 1 )
{
hide Flare9;
move Flare9 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare9;
Static_Var_5 = 14;
}
if( Static_Var_2 == 2 )
{
hide Flare2;
move Flare2 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare2;
Static_Var_5 = 13;
}
if( Static_Var_2 == 3 )
{
hide Flare10;
move Flare10 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare10;
Static_Var_5 = 12;
}
if( Static_Var_2 == 4 )
{
hide Flare3;
move Flare3 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare13;
Static_Var_5 = 11;
}
if( Static_Var_2 == 5 )
{
hide Flare11;
move Flare11 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare11;
Static_Var_5 = 10;
}
if( Static_Var_2 == 6 )
{
hide Flare4;
move Flare4 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare4;
Static_Var_5 = 9;
}
if( Static_Var_2 == 7 )
{
hide Flare12;
move Flare12 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare12;
Static_Var_5 = 8;
}
if( Static_Var_2 == 8 )
{
hide Flare5;
move Flare5 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare5;
Static_Var_5 = 7;
}
if( Static_Var_2 == 9 )
{
hide Flare13;
move Flare13 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare13;
Static_Var_5 = 6;
}
if( Static_Var_2 == 10 )
{
hide Flare6;
move Flare6 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare6;
Static_Var_5 = 5;
}
if( Static_Var_2 == 11 )
{
hide Flare14;
move Flare14 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare14;
Static_Var_5 = 4;
}
if( Static_Var_2 == 12 )
{
hide Flare7;
move Flare7 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare7;
Static_Var_5 = 3;
}
if( Static_Var_2 == 13 )
{
hide Flare15;
move Flare15 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare15;
Static_Var_5 = 2;
}
if( Static_Var_2 == 14 )
{
hide Flare8;
move Flare8 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare8;
Static_Var_5 = 1;
}
if( Static_Var_2 == 15 )
{
hide Flare16;
move Flare16 to z-axis [-3.000000] now;
emit-sfx 256 | 1 from Flare6;
Static_Var_5 = 0;
start-script missileReload();
}
++Static_Var_2;
if( Static_Var_2 == 16 )
{
Static_Var_2 = 0;
}
}
AimFromWeapon1(Func_Var_1)
{
if( Static_Var_2 == 0 )
{
Func_Var_1 = 15;
}
if( Static_Var_2 == 1 )
{
Func_Var_1 = 23;
}
if( Static_Var_2 == 2 )
{
Func_Var_1 = 16;
}
if( Static_Var_2 == 3 )
{
Func_Var_1 = 24;
}
if( Static_Var_2 == 4 )
{
Func_Var_1 = 17;
}
if( Static_Var_2 == 5 )
{
Func_Var_1 = 25;
}
if( Static_Var_2 == 6 )
{
Func_Var_1 = 18;
}
if( Static_Var_2 == 7 )
{
Func_Var_1 = 26;
}
if( Static_Var_2 == 8 )
{
Func_Var_1 = 19;
}
if( Static_Var_2 == 9 )
{
Func_Var_1 = 27;
}
if( Static_Var_2 == 10 )
{
Func_Var_1 = 20;
}
if( Static_Var_2 == 11 )
{
Func_Var_1 = 28;
}
if( Static_Var_2 == 12 )
{
Func_Var_1 = 21;
}
if( Static_Var_2 == 13 )
{
Func_Var_1 = 29;
}
if( Static_Var_2 == 14 )
{
Func_Var_1 = 22;
}
if( Static_Var_2 == 15 )
{
Func_Var_1 = 30;
}
}
QueryWeapon1(Func_Var_1)
{
if( Static_Var_2 == 0 )
{
Func_Var_1 = 15;
}
if( Static_Var_2 == 1 )
{
Func_Var_1 = 23;
}
if( Static_Var_2 == 2 )
{
Func_Var_1 = 16;
}
if( Static_Var_2 == 3 )
{
Func_Var_1 = 24;
}
if( Static_Var_2 == 4 )
{
Func_Var_1 = 17;
}
if( Static_Var_2 == 5 )
{
Func_Var_1 = 25;
}
if( Static_Var_2 == 6 )
{
Func_Var_1 = 18;
}
if( Static_Var_2 == 7 )
{
Func_Var_1 = 26;
}
if( Static_Var_2 == 8 )
{
Func_Var_1 = 19;
}
if( Static_Var_2 == 9 )
{
Func_Var_1 = 27;
}
if( Static_Var_2 == 10 )
{
Func_Var_1 = 20;
}
if( Static_Var_2 == 11 )
{
Func_Var_1 = 28;
}
if( Static_Var_2 == 12 )
{
Func_Var_1 = 21;
}
if( Static_Var_2 == 13 )
{
Func_Var_1 = 29;
}
if( Static_Var_2 == 14 )
{
Func_Var_1 = 22;
}
if( Static_Var_2 == 15 )
{
Func_Var_1 = 30;
}
}
SweetSpot(piecenum)
{
piecenum = Body;
}
Killed(severity, corpsetype)
{
if( severity <= 50 )
{
corpsetype = 1;
explode base type BITMAPONLY | BITMAP1;
return (0);
}
corpsetype = 3;
explode BodyParts type SHATTER | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
explode base type SHATTER | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP5;
explode EngineBaseRight type SHATTER | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
explode EngineRight type SHATTER | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
explode EngineLeftRight type SHATTER | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
explode EngineLeft type SHATTER | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
explode RocketBaseRight type SHATTER | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
explode RocketBaseRightDetails type SHATTER | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
explode RocketBaseLeft type SHATTER | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
explode RocketBaseLeftDetails type SHATTER | SMOKE | FIRE | EXPLODE_ON_HIT | BITMAP2;
}