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 → Elevator cog with multiple stops.
Elevator cog with multiple stops.
2002-08-12, 8:28 AM #1
I've created a building with 13 floors. Now i'm using the 00_basic elevator, which only has two frames (the top and bottom) and it runs continously. Is there a COG in JK or one I can download that runs continuously but I can program 13 stops?
2002-08-12, 9:04 AM #2
Its been awhile since Ive done one. . . .

Code:
# Simple elevator script.  User-definable number of floors.
#
#08/2002 GBK
Symbols
Message Startup
Message Arrived
Message Timer
Thing Elevator
Int Num_floors=13		#Number of stops.
Flex Sleeptime=2		#How long to wait.
Flex Speed=4		#Speed of elev.
Int I=0				Local
End
Code

Startup: Settimer(Sleeptime); Stop;
Timer: If(Getcurframe(Elevator) == Num_floors) I=1;
Else If(Getcurframe(Elevator) == 0) I=0;
If(!I) Movetoframe(Elevator, Getcurframe(Elevator) + 1, Speed);
Else Movetoframe(Elevator, Getcurframe(Elevator) - 1, Speed);
Stop;
Arrived: Settimer(Sleeptime); Stop;
End


I think the variables are self-explainitory..

Basically, this cog can handle ANY number of floors. You simply define the last frame (Num_floors), and itll do the rest.


If this isnt what you wanted, reply with a better request.


I didnt test it . . but it should work. [http://forums.massassi.net/html/smile.gif]

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-08-12, 10:18 AM #3
There's always the LEC 00_elevcall.cog. [http://forums.massassi.net/html/tongue.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-12, 4:37 PM #4
Bah. To hell with LEC cogs. Mine is better.


Does it work? [http://forums.massassi.net/html/tongue.gif]

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-08-12, 5:26 PM #5
Agreed GBK, but they are for doors and other extremly simple *beep*!

[I decided I would bypass the word filter and tempt the moderators, but this won't happen again...]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

[This message has been edited by SaberMaster (edited August 13, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-12, 6:24 PM #6
There is no more simple door cog, then my "Universal door cog". It simply does not get any easier.


Unless, of course, you think you can make a level-wide-door controller any easier, be my guest.


On second thought, I could update that flag handling function... Bah, Ill do it later.

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-08-13, 4:30 AM #7
The "Universal door cog" isn't so universal, you can't open four doors that need to open together, but not have the door to your imedate right not open. Or different movespeeds and sleeptimes. [http://forums.massassi.net/html/tongue.gif] [http://forums.massassi.net/html/biggrin.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

[This message has been edited by Descent_pilot (edited August 13, 2002).]

[This message has been edited by Descent_pilot (edited August 13, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-08-13, 5:23 AM #8
You can have multiple copies of the cog running in a level...

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.

↑ Up to the top!