Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → MP turret cog that aims?
MP turret cog that aims?
2001-01-07, 1:42 PM #1
Is there a way to make a multiplayer turret cog that aims, i am trying to make a capture the flag type level where each person has a base and if the other team goes near their base there turret fires at the person, the only mp turret cogs i can find shoot straight out of a ghost position and they do not aim, the boxturret cog, seems to work fine but it shoots at both teams, is there any way to correct that? i posted this at the zhoh forum and it didnt get much help but now that that forum seems to have disapered mabey you people can help me thanks

Aaron
2001-01-08, 3:01 PM #2
I have used one in a level i made. Its not server/client based however. Ive seen it in another ctf level actually but i dont remember which...

Ok here it is...actually taken from LucasArts cogs. I cant remember if i altered it or not. If you want to see how it was implimented you can check out my level SlaughterFalls(JK) or SlaughterFalls(MotS). You definitely have to have this cog in a cog folder in your root directory because it wont just work if you select it from the JK included cogs.

# 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.

One problem is it wont "look" like the turrets move...itll just fire from ghost positions.
Maybe someone else can give you something that works better.
-JLAW
heywhereyou@hotmail.com
2001-01-08, 3:01 PM #3
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

↑ Up to the top!