Hi!
Why is it that one of the impts explode when damaged? The impt's template is a plain old Imperial Officer, no additives...
/Edward
Why is it that one of the impts explode when damaged? The impt's template is a plain old Imperial Officer, no additives...
Code:
# And so it begins
# Intro to TNT3
#
# By Edward
symbols
message startup
message damaged
message activated
message killed
message touched
message pulse
thing camprev
thing camabove
thing shuttlecam
thing shipscorner
thing escortship1 mask=0xC8
thing escortship2 mask=0xC8
thing shuttle
thing shipfire
thing upcam
thing landshuttle
thing landcrow
thing playergoto
thing elev
thing imp1
thing imp2
thing imp3
thing impt1 local
thing impt2 local
thing impt3 local
keyframe shuttlego
template bullet
template escortboom
template imperial1
template imperial2
template imperial3
surface floor
surface skipper0 linkid=3
surface skipper1 linkid=3
surface skipper2 linkid=3
surface skipper3 linkid=3
surface skipper4 linkid=3
surface skipper5 linkid=3
sound intro
sound woosh
sound shuttlesnd
sound bulletsnd
sound boom1
sound beep
sound tada
sound liftoff
flex i local
int animid local
int ch1=1 local
vector lv local
vector lvr local
flex z local
int skipping=0 local
int impkill=0 local
end
#
code
startup:
SetActorFlags(GetLocalPlayerThing(),0x840000);
SetCameraFocus(0,camprev);
SetCameraFocus(1,camprev);
SetCurrentCamera(0);
if(skipping==0) sleep(1);
ThingLight(camprev,3,1);
if(skipping==0) sleep(4);
ThingLight(camprev,0,1);
if(skipping==0) sleep(1);
SetCameraFocus(0,camabove);
SetCameraFocus(1,camabove);
ThingLight(camabove,25,5);
if(skipping==0) sleep(1);
if(skipping==0) PlaySoundLocal(intro,1,0,0x0);
MoveToFrame(camabove,1,2);
animid=SlideWall(floor,'0 -1 0',.2);
if(skipping==0) WaitForStop(camabove);
if(skipping==0) PlaySoundLocal(woosh,1,0,0x0);
for(i=2;i<32;i=i+1)
{
StopAnim(animid);
MoveToFrame(camabove,2,i);
animid=SlideWall(floor,'0 -1 0',i/10);
if(skipping==0) sleep(.1);
}
if(skipping==0) WaitForStop(camabove);
StopAnim(animid);
SetCameraFocus(0,shuttlecam);
SetCameraFocus(1,shuttlecam);
if(skipping==0) ch1=PlaySoundLocal(shuttlesnd,1,0,0x1);
if(skipping==0) sleep(1);
Print("Kyle: Fire at will!");
if(skipping==0) sleep(1);
lv=VectorSub(GetThingPos(shipfire),GetThingPos(escortship1));
lvr=VectorSet(-VectorX(lv),-VectorY(lv),-VectorZ(lv));
SetThingLook(shipfire,lvr);
SetCameraFocus(1,escortship1);
FireProjectile(shipfire,bullet,bulletsnd,-1,'0 0 0','0 0 0',0,0,0,0);
if(skipping==0) sleep(.5);
lv=VectorSub(GetThingPos(shipfire),GetThingPos(escortship2));
lvr=VectorSet(-VectorX(lv),-VectorY(lv),-VectorZ(lv));
SetThingLook(shipfire,lvr);
SetCameraFocus(1,escortship2);
FireProjectile(shipfire,bullet,bulletsnd,-1,'0 0 0','0 0 0',0,0,0,0);
if(skipping==0) sleep(2);
print("Jan: Got them!");
if(skipping==0) sleep(1);
if(skipping==0) PlaySoundLocal(beep,1,0,0x0);
print("Kyle: Attention Imperial shuttle!");
if(skipping==0) sleep(2);
if(skipping==0) PlaySoundLocal(beep,1,0,0x0);
print("Kyle: Attention Imperial shuttle!");
if(skipping==0) sleep(3);
print("Kyle: Give up your ship!");
if(skipping==0) sleep(3);
print("Kyle: Continue towards the planet Abridon.");
if(skipping==0) sleep(3);
print("Kyle: We will land and you give us your ship.");
if(skipping==0) sleep(3);
print("Kyle: If you do this you will keep your lives.");
if(skipping==0) sleep(2);
print("IS: Awe, must we?");
if(skipping==0) sleep(2);
ChangeSoundVol(ch1,0,.1);
ChangeSoundPitch(ch1,2,.1);
SetCameraFocus(0,shipscorner);
SetCamerafocus(1,shipfire);
MoveToFrame(playergoto,1,100);
SetPulse(0.01);
if(skipping==0) sleep(1);
ChangeSoundVol(ch1,1,5);
MoveToFrame(shipfire,1,75);
MoveToFrame(shuttle,1,75);
if(skipping==0) sleep(3);
ChangeSoundPitch(ch1,.75,1);
ChangeSoundVol(ch1,0,5);
if(skipping==0) WaitForStop(shuttle);
ChangeSoundPitch(ch1,1,0.1);
SetCameraFocus(0,upcam);
SetCameraFocus(1,playergoto);
MoveToFrame(landcrow,1,10);
ChangeSoundVol(ch1,1,0.1);
z=1;
MoveToFrame(playergoto,0,1);
if(skipping==0)
{
for(i=10; i>0; i=i-.1)
{
MoveToFrame(landshuttle,1,i);
ChangeSoundPitch(ch1,i/10,0.1);
sleep(0.1);
}
}
else
{
MoveToFrame(landshuttle,1,100);
}
if(skipping==0) WaitForStop(landshuttle);
StopSound(ch1,1);
SetPulse(0);
if(skipping==0) sleep(1);
TeleportThing(GetLocalPlayerThing(),playergoto);
impt1=CreateThing(imperial1,imp1);
impt2=CreateThing(imperial2,imp2);
impt3=CreateThing(imperial3,imp3);
CaptureThing(impt1);
CaptureThing(impt2);
CaptureThing(impt3);
AutoSaveGame();
SetCameraFocus(0,GetLocalPlayerThing());
SetCameraFocus(1,GetLocalPlayerThing());
ClearActorFlags(GetLocalPlayerThing(),0x840000);
MoveToFrame(elev,1,4);
MoveToFrame(playergoto,1,100);
SelectWeapon(player, AutoSelectWeapon(player, 1));
return;
damaged:
if(GetSenderRef()==escortship1)
{
SetCameraFocus(1,shipfire);
CreateThing(escortboom,escortship1);
if(skipping==0) PlaySoundLocal(boom1,1,0,0x0);
DestroyThing(escortship1);
}
else if(GetSenderRef()==escortship2)
{
SetCameraFocus(1,shipfire);
CreateThing(escortboom,escortship2);
if(skipping==0) PlaySoundLocal(boom1,1,0,0x0);
DestroyThing(escortship2);
}
return;
activated:
if(GetSenderID()!=3) return;
if(skipping!=0) return;
skipping=1;
print(">>>>SKIPPING>>>>");
return;
killed:
if((GetSenderRef()==impt1) || (GetSenderRef()==impt2) || (GetSenderRef()==impt3))
{
impkill=impkill+1;
}
if(impkill==3)
{
print("Mission Objective Completed");
PlaySoundLocal(tada,1,0,0x0);
}
return;
touched:
if(GetSenderRef()!=landshuttle) return;
if(impkill!=3) return;
TeleportThing(GetLocalPlayerThing(),camprev);
SetActorFlags(GetLocalPlayerThing(),0x840000);
SetCameraFocus(0,upcam);
SetPulse(0.01);
sleep(1);
PlayKey(landshuttle,shuttlego,1,0x4);
PlaySoundLocal(liftoff,1,0,0x0);
sleep(GetKeyLen(shuttlego));
JKEndLevel(1);
return;
pulse:
lv=VectorSub(GetThingPos(playergoto),GetThingPos(landshuttle));
lvr=VectorSet(-VectorX(lv),-VectorY(lv),-VectorZ(lv));
SetThingLook(playergoto,lvr);
return;
end/Edward