PDA

View Full Version : Problems with a shoot door cog...



Xak
05-09-2003, 03:20 PM
I downloaded a shoot door cog that I'd like to implement into my level... But see, once I shoot the surface that I have assigned, and the door opens, it doesn't close again. The cog actually gives two surface fields, I assume there is one for each side of the door that the player could be on. Anyhow, I'd *like* it if the cog used the second field surface for shutting the door as opposed to nothing, at the moment... *sighs* Ok thats kinda badly worded... To put it simply:

I want the first surface assigned to open the door when shot.

I want the second surface assigned to close the door when shot.

Can someone help me out, please?


symbols
surface switch mask=0x448
surface switch2 mask=0x448
thing door
flex speed
message damaged
message timer
sector doorsector
int garbage local
int activeono=0 local
int which local
message startup
end

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

code
startup:
SetSectorAdjoins(doorsector, 0);
damaged:
if (activeono == 1) return;
if (GetSenderRef() == door) return;
garbage = SetWallCel(GetSenderRef(), 1);
which = GetSenderRef();
SetSectorAdjoins(doorsector, 1);
MoveToFrame(door, 1, speed);
WaitForStop(door);
SetTimer(delay);
return;

timer:
MoveToFrame(door, 0, speed);
WaitForStop(door);
SetSectorAdjoins(doorsector, 0);
garbage = SetWallCel(which, 0);
activeono = 0;
return;
# .................................................. ......................................
end

If you just tell me what to add, and where, I shall do so. Thanks again!

------------------
The single remaining "Master of Stealth" wielding his Daggers of Total Annihilation +375.

[SF]pjb
05-09-2003, 03:41 PM
symbols
surface switch mask=0x448 linkid=0
surface switch2 mask=0x448 linkid=1
thing door
flex speed
message damaged
message timer
sector doorsector
int garbage local
message startup
end

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

code
startup:
SetSectorAdjoins(doorsector, 0);
damaged:
if (GetSenderRef() == door) return;
if (GetSenderID() == 0)
{
garbage = SetWallCel(GetSenderRef(), 1);
SetSectorAdjoins(doorsector, 1);
MoveToFrame(door, 1, speed);
WaitForStop(door);
}
if (GetSenderID() == 1)
{
garbage = SetWallCel(GetSenderRef(), 1);
which = GetSenderRef();
SetSectorAdjoins(doorsector, 1);
MoveToFrame(door, 0, speed);
return;


that should work. i cant be bothered testing it its my bedtime. if it dosent work send a e-mail to pokejoyboy@aol.com and ill see what i can do tomro *yawns*

------------------
I am pjb.
Another post......
another moment of my life wasted.....