Door no adjoin change -- prl_00_door_adjoinless.cog
Here is the basic LEC 00_door.cog modified by removing the parts that change the adjoin flags for the sector that the door is in. This allows you to use see-through doors, for example jail doors. You can use up to 4 doors that open at the same time. I am using this cog for a see-through barred door. Technically the door 3do won't require it's own little sector with this code, but do it anyway for consistency. Don't use this code for regular doors because in-game the AI will see through the door and the player's map will show sectors on the other side. 28 May 2001

# Jedi Knight Cog Script
#
# prl_00_door_adjoinless.cog
# This is 00_door.cog with sector adjoin references removed
# Sylvicolus [PRL] 28 May 2001
#
# Basic door cog to use with see-through doors.
#
#
# This cog is not supported by LucasArts Entertainment Co.

symbols

message	startup
message	activate	
message	arrived		
message	timer		
message	blocked		

thing	door0	linkid=0 mask=0x405
thing	door1	linkid=1 mask=0x405
thing	door2	linkid=2 mask=0x405
thing	door3	linkid=3 mask=0x405
float	moveSpeed=8.0
float	sleepTime=2.0
int	numDoors=0	local
int	doorStatus	local
int	moveStatus	local
int	i		local

end

# ========================================================

code

startup:
	for (i=0; i<=3; i=i+1)
		if (door0[i] >= 0) numDoors = numDoors + 1;
	return;

activate:
	call CheckStatus;
	if (moveStatus) return;
	if (doorStatus == 0)
	{
		sleep(0.1);
		call OpenDoors;
	}
	return;

arrived:
	call CheckStatus;
	if (moveStatus) return;
	if (doorStatus == numDoors)
	{
		SetTimer(sleepTime);
	}
	return;

blocked:
	call OpenDoors;	
	return;

timer:
	call CloseDoors;
	return;

OpenDoors:
	for (i=0; i<=3; i=i+1)
		if (door0[i] >= 0) MoveToFrame(door0[i], 1, moveSpeed);
	return;

CloseDoors:
	for (i=0; i<=3; i=i+1)
		if (door0[i] >= 0) MoveToFrame(door0[i], 0, moveSpeed);
	return;

CheckStatus:
	moveStatus = 0;
	doorStatus = 0;
	for (i=0; i<=3; i=i+1)
	{
		if (door0[i] >= 0) 
		{
			moveStatus = moveStatus + IsThingMoving(door0[i]);
			doorStatus = doorStatus + GetCurFrame(door0[i]);
		}
	}
	return;

end