PDA

View Full Version : Ping..... Swish..... Clump.


Electro
01-26-2001, 01:11 PM
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?


# 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 (http://electroprose.clanpages.com)

Electro
02-13-2001, 04:43 AM
dosent Anyone Know?

------------------
Generating Electro Vibes™ for the masses on Massassi
Go To: HERE (http://electroprose.clanpages.com)
Jedi Knight Depostitory (http://www.jkdeposit.f2s.com)

Sylvicolus
02-13-2001, 03:46 PM
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:

thing door0
flex doorSpeed=4.0

Modify the Arrived: section to this:

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:

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

Electro
02-16-2001, 12:30 PM
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 (http://electroprose.clanpages.com)
Jedi Knight Depostitory (http://www.jkdeposit.f2s.com)