I've got a problem with my airlock door COG for my level. I modified the normal door COG to make it so when one door is open, another won't open. I want it so when the 2nd door is open, the 1st wont open till the 2nd is shut, and vise versa. I'm using the same COG on both doors, and it checks the opposite to see if it is open, and if it is, exits. But it doesn't work. Instead when you activate one, they both open and never shut. Someone please tell me what's wrong with it, or where to get a working airlock COG (not the C3 CTF ones!)
Here it is:
--------------
# Jedi Knight Cog Script
#
# 00_Door.cog
#
# Generic Door Script
#
# [IS] - Modified by EJM_Emon to be used as an airlock door COG in the EJM_Temple.
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
# ========================================================================================
symbols
message activate
message arrived
message timer
message blocked
thing door0 linkid=0 mask=0x405
thing doorLock
float moveSpeed=8.0
float sleepTime=2.0
sector doorSector local
int numDoors=0 local
int doorStatus local
int moveStatus local
int i local
int door2Status local
end
# ========================================================================================
code
activate:
call CheckStatus;
if (moveStatus) return;
if (doorStatus == 0)
{ // all pieces are at frame 0
SetSectorAdjoins(doorSector, 1);
call OpenDoors;
}
return;
# ........................................................................................
arrived:
call CheckStatus;
if (moveStatus) return;
if (doorStatus == numDoors) { // all pieces are at frame 1
SetTimer(sleepTime);
} else if (doorStatus == 0) { // all pieces are at frame 0
SetSectorAdjoins(doorSector, 0);
}
return;
# ........................................................................................
blocked:
call OpenDoors;
return;
# ........................................................................................
timer:
call CloseDoors;
return;
# ........................................................................................
OpenDoors:
call CheckDoor2;
if (door2Status != 0) return;
MoveToFrame(door0, 1, moveSpeed);
return;
# ........................................................................................
CloseDoors:
MoveToFrame(door0, 0, moveSpeed);
return;
# ........................................................................................
CheckStatus:
moveStatus = 0;
doorStatus = 0;
moveStatus = moveStatus + IsThingMoving(door0);
doorStatus = doorStatus + GetCurFrame(door0);
return;
# ........................................................................................
CheckDoor2:
door2Status = 0;
door2Status = door2Status + GetCurFrame(doorLock);
Return;
end
Here it is:
--------------
# Jedi Knight Cog Script
#
# 00_Door.cog
#
# Generic Door Script
#
# [IS] - Modified by EJM_Emon to be used as an airlock door COG in the EJM_Temple.
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
# ========================================================================================
symbols
message activate
message arrived
message timer
message blocked
thing door0 linkid=0 mask=0x405
thing doorLock
float moveSpeed=8.0
float sleepTime=2.0
sector doorSector local
int numDoors=0 local
int doorStatus local
int moveStatus local
int i local
int door2Status local
end
# ========================================================================================
code
activate:
call CheckStatus;
if (moveStatus) return;
if (doorStatus == 0)
{ // all pieces are at frame 0
SetSectorAdjoins(doorSector, 1);
call OpenDoors;
}
return;
# ........................................................................................
arrived:
call CheckStatus;
if (moveStatus) return;
if (doorStatus == numDoors) { // all pieces are at frame 1
SetTimer(sleepTime);
} else if (doorStatus == 0) { // all pieces are at frame 0
SetSectorAdjoins(doorSector, 0);
}
return;
# ........................................................................................
blocked:
call OpenDoors;
return;
# ........................................................................................
timer:
call CloseDoors;
return;
# ........................................................................................
OpenDoors:
call CheckDoor2;
if (door2Status != 0) return;
MoveToFrame(door0, 1, moveSpeed);
return;
# ........................................................................................
CloseDoors:
MoveToFrame(door0, 0, moveSpeed);
return;
# ........................................................................................
CheckStatus:
moveStatus = 0;
doorStatus = 0;
moveStatus = moveStatus + IsThingMoving(door0);
doorStatus = doorStatus + GetCurFrame(door0);
return;
# ........................................................................................
CheckDoor2:
door2Status = 0;
door2Status = door2Status + GetCurFrame(doorLock);
Return;
end
Bassoon, n. A brazen instrument into which a fool blows out his brains.