Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Problems with a shoot door cog...
Problems with a shoot door cog...
2003-05-09, 12:20 PM #1
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.
"He called me a murderer and I grabbed his hair and smashed his face into his dinner."
2003-05-09, 12:41 PM #2
Code:
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.....
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?

↑ Up to the top!