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 → Ping..... Swish..... Clump.
Ping..... Swish..... Clump.
2001-01-26, 10:11 AM #1
Hi, me again [http://216.105.160.32/html/biggrin.gif] what would i have to add to this LEC cog to make it open a door when the elevator gets to frame 1?

Code:
# Jedi Knight Cog Script
#
# 00_elev_switch.cog
#
# This elevator will go up to frame one, sleep, then come back down to frame 0 when
# entered from the bottom.  When entered from the top, it should stay at the bottom.
# The button surface is a call switch you can put at the top to call the thing up there.
# Elevator will react to "blocked" message.
#
# [DS/RD/IS/JS]
# Modified 11/13/96 DS  (added third adjoin)
# Modified 12/14/96 by RKD (changed to new COG format)
# Modified 4/6/97 by IS (Fixed bug with repeatedly hitting switch)
# Modified 4/29/97 by RKD (changed to work with 00_sendmessage.cog -- see commented out line below)
# Modified 4/30/97 by IS (Changed from sleep to timer)
# Modified 8/19/97 by JS (added blocked message)
# Modified 9/1/97 by SXC (took blocked message out)
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
# ========================================================================================

symbols

message  crossed
message  activate
message  arrived
message  timer

surface  lower_adjoin0  linkid=1
surface  lower_adjoin1  linkid=1
surface  lower_adjoin2  linkid=1
surface  button         linkid=1

thing    elevator       linkid=2

flex     start_wait=0.25   desc=pause_before_moving_up
flex     sleeptime=2.0
flex     speed=4.0
sound    wav0=Activate02.wav

end

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

code
crossed:                // If player crosses adjoin(s)
   Sleep(start_wait);            // pause before moving up
   // fall through

# ........................................................................................

activate:                 // If player presses button
   if (GetSenderId() != 1) return;  // message came from elevator
   if (GetWallCel(button) == 1) return;

   SetWallCel(button, 1);
   PlaySoundPos(wav0, SurfaceCenter(button), 0.6, -1, -1, 0);

   MoveToFrame(elevator, 1, speed);
   return;

# ........................................................................................

arrived:
   if (GetCurFrame(elevator) == 0) {
      SetWallCel(button, 0);
      PlaySoundPos(wav0, SurfaceCenter(button), 0.6, -1, -1, 0);
   } else {
      // Set sleep time at top
      SetTimer(sleeptime);
   }
   return;

# ........................................................................................

timer:
   // Send elevator down
   MoveToFrame(elevator, 0, speed);
   return;

end


Thanks for all this help u guys are givin me, my level would be pants wit out it.

------------------
Generating Electro Vibes™ for the masses on Massassi
Go To: HERE
Generating Electro Vibes™ for the masses on Massassi
Go To: BiTsToRm Forums or L3CY's Topsites
Boba Jules: You ever read the bible TK-421?
TK-421: No?
Boba Jules: Oh, ok...
*BLAM BLAM BLAM BLAM*
<EL3CTRO> EXCAUSE ME MISTAR CAERV BUT I LIEK MY PHORUMPHS!
2001-02-13, 1:43 AM #2
dosent Anyone Know?

------------------
Generating Electro Vibes™ for the masses on Massassi
Go To: HERE
Jedi Knight Depostitory
Generating Electro Vibes™ for the masses on Massassi
Go To: BiTsToRm Forums or L3CY's Topsites
Boba Jules: You ever read the bible TK-421?
TK-421: No?
Boba Jules: Oh, ok...
*BLAM BLAM BLAM BLAM*
<EL3CTRO> EXCAUSE ME MISTAR CAERV BUT I LIEK MY PHORUMPHS!
2001-02-13, 12:46 PM #3
You should take a look at a basic door cog, for example 00_door.cog, and use the parts from that you need.
See http://www.lactarius.com/sylvicolus/jk/cogs.htm

If you only need to open a door and that's all then..........
Add the following in the Symbols section:
Code:
thing		door0
flex		doorSpeed=4.0

Modify the Arrived: section to this:
Code:
arrived:
   if (GetCurFrame(elevator) == 0) {
      SetWallCel(button, 0);
      PlaySoundPos(wav0, SurfaceCenter(button), 0.6, -1, -1, 0);
   } else { 
      MoveToFrame(door0, 1, doorSpeed);
      // Set sleep time at top
      SetTimer(sleeptime);
   }
   return;


If you want the door to close again when the elevator goes down then modify the timer: section to this:
Code:
timer:
   // Close door
   MoveToFrame(door0, 0, doorSpeed);
   // Send elevator down
   MoveToFrame(elevator, 0, speed);
   return;

end


The cog as is won't respond to a blocked: message, so a player that stands in the doorway will be crushed when the door closes.



------------------
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
2001-02-16, 9:30 AM #4
how would i get it to respond to the blocked message? my dorr kinda gets blocked by the wall, because the space i cleaved waent big enough :P

------------------
Generating Electro Vibes™ for the masses on Massassi
Go To: HERE
Jedi Knight Depostitory
Generating Electro Vibes™ for the masses on Massassi
Go To: BiTsToRm Forums or L3CY's Topsites
Boba Jules: You ever read the bible TK-421?
TK-421: No?
Boba Jules: Oh, ok...
*BLAM BLAM BLAM BLAM*
<EL3CTRO> EXCAUSE ME MISTAR CAERV BUT I LIEK MY PHORUMPHS!

↑ Up to the top!