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.
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.
"He called me a murderer and I grabbed his hair and smashed his face into his dinner."