oops...here is the entire thing...
# Jedi Knight Cog Script
#
# 00_turrettrap.cog
#
# Multiplayer turrets activated by switch.
#
# This will generate a series of 3 laser bursts per 'round' when
# the switch is activated.
# The trap resets in 'delay' seconds afterwards.
#
# [YB]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
# ========================================================================================
symbols
message activate
surface switch desc=switch
thing ghost1 nolink,desc=ghost1
thing ghost2 nolink,desc=ghost2
thing ghost3 nolink,desc=ghost3
thing ghost4 nolink,desc=ghost4
int rounds=5 desc=rounds
float rate=0.33 desc=rate
float delay=2.0 desc=delay
float autoAimXFOV=90
float autoAimZFOV=180
int firing=0 local
int cur_round=0 local
template projectile=+stlaser local
sound fireSound=turret-1.wav local
sound on_snd=set_hi2.wav local
sound off_snd=lgclick1.wav local
end
# ========================================================================================
code
activate:
if(firing == 1) Return;
firing = 1;
SetWallCel(switch, 1);
PlaySoundPos(on_snd, SurfaceCenter(switch), 1.0, 5.0, 10.0, 0);
cur_round = 0;
while(cur_round < rounds)
{
FireProjectile(ghost1, projectile, fireSound, -1, '0 0 0', '0 0 0', 1.0, 0x60, autoAimXFOV, autoAimZFOV);
Sleep(rate);
FireProjectile(ghost2, projectile, fireSound, -1, '0 0 0', '0 0 0', 1.0, 0x60, autoAimXFOV, autoAimZFOV);
Sleep(rate);
FireProjectile(ghost3, projectile, fireSound, -1, '0 0 0', '0 0 0', 1.0, 0x60, autoAimXFOV, autoAimZFOV);
Sleep(rate);
FireProjectile(ghost4, projectile, fireSound, -1, '0 0 0', '0 0 0', 1.0, 0x60, autoAimXFOV, autoAimZFOV);
Sleep(rate);
cur_round = cur_round + 1;
}
Sleep(delay);
dummy = SetWallCel(switch, 0);
dummy = PlaySoundPos(off_snd, SurfaceCenter(switch), 1.0, 5.0, 10.0, 0);
firing = 0;
Stop;
end
-JLAW
heywhereyou@hotmail.com