NB, atm its a little bit broken, the unit will start moving before its pack up animation is completed. **edit** fixed, danke KDR
Code: Select all
StartMoving()
{
signal SIG_MOVE;
set-signal-mask SIG_MOVE;
sleep 10;
if( deployed )
{
call-script PackUp();
}
}
StopMoving()
{
signal SIG_MOVE;
set-signal-mask SIG_MOVE;
sleep 250;
if( !overwater )
{
call-script Deploy();
}
}
Code: Select all
Create()
{
fbispeed = 3;
restore_delay = 2000;
hide flare1;
deployed = 0;
start-script SmokeUnit();
start-script SlopeAdjust();
}
Code: Select all
PackUp()
{
move turret to y-axis [0.000000] speed [0.800000];
wait-for-move turret along y-axis;
move frontthrust to y-axis [0.000000] speed [0.400000];
move rearthrust to y-axis [0.000000] speed [0.400000];
wait-for-move frontthrust along y-axis;
wait-for-move rearthrust along y-axis;
deployed = 0;
set MAX_SPEED to fbispeed * 65536;
}
Deploy()
{
move frontthrust to y-axis [-0.400000] speed [0.400000];
move rearthrust to y-axis [-0.400000] speed [0.400000];
wait-for-move frontthrust along y-axis;
wait-for-move frontthrust along y-axis;
move turret to y-axis [0.800000] speed [0.800000];
wait-for-move turret along y-axis;
deployed = 1;
set MAX_SPEED to 1;
}
and here is a sample of the code that stops it from shooting if it isnt deployed...
Code: Select all
AimPrimary(heading, pitch)
{
signal SIG_AIM1;
set-signal-mask SIG_AIM1;
if( deployed )
{
turn turret to y-axis heading speed <90.000000>;
turn sleeve to x-axis <0.000000> - pitch speed <45.000000>;
wait-for-turn turret around y-axis;
wait-for-turn sleeve around x-axis;
start-script RestoreAfterDelay();
return(TRUE);
}
}