Posted by Pax on January 25, 1998 at 16:25:31:
I put together this cog from the COG made with the tutorial and elev_switch2. What it's suppose to be is a single 3do trapdoor with 4 switches. You hit one switch, it opens the trapdoor, waits a few seconds, then closes and resets the switches. Instead, it opens the trapdoor, closes it, doesn't reset the switches, and it keeps make open/close/moving sounds all at once.
This is the final piece of a MP level I'm about to release, so if someone could give me some help, it'd be greatly appreciated.
Here's the COG:
# Jedi Knight Cog Script
#
# 00_trapdoor.cog
#
# Works like a 2 stop elevator with up to 4 switches (only one trapdoor)
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
# ========================================================================================
symbols
message timer
message activate
message arrived
surface call0 linkid=1
surface call1 linkid=1
surface call2 linkid=1
surface call3 linkid=1
thing elevator desc=elevator_object
float sleeptime=2.0
float speed=4.0
sound wav0=lvrclik1.wav
end
# ========================================================================================
code
activate: // If player presses button
if (GetWallCel(call0) == 1) return;
setwallcel(call0,1);
setwallcel(call1,1);
setwallcel(call2,1);
setwallcel(call3,1);
PlaySoundPos(wav0, SurfaceCenter(GetSenderRef()), 1, -1, -1, 0);
movetoframe(elevator, 1, speed);
return;
# ........................................................................................
arrived:
if (GetCurFrame(elevator) == 1);
SetTimer(sleeptime);
return;
setwallcel(call0,0);
setwallcel(call1,0);
setwallcel(call2,0);
setwallcel(call3,0);
PlaySoundPos(wav0, SurfaceCenter(GetSenderRef()), 1, -1, -1, 0);
return;
# ........................................................................................
timer:
MoveToFrame(elevator, 0, speed);
return;
end