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 → Elev Cog Request
Elev Cog Request
2002-02-03, 10:54 AM #1
Can somebody please modify the Elev_switch_3.cog so that instead of moving to frame 2, and moving back, it moves to frame 2 from frame 1, then JUMPS back to frame 1.

(Frame 1) MOVES TO (frame 2) JUMP BACK TO (frame 1)
2002-02-03, 2:54 PM #2
I am not in the habbit of modifing LEC scripts. However, here is my untested 'Elev3ish' cog, that should do the trick. I think the variables are fairly self-explainitory, so I will forgo the explination. Oh, and yes, this one DOES react to :blocked messages, if you tell it to... [http://forums.massassi.net/html/biggrin.gif]

Code:
# I'm starting to dislike elevator scripts...  
#
# 02/2002 GBK
Symbols
Message Crossed
Message Activated
Message Arrived
Message Timer
Message Blocked
Thing Elev
Int Firstframe=1
Int Lastframe=2
Flex Movespeed=2.0
Flex Sleeptime=3.0
Surface Call0
Surface Adjoin0
Surface Adjoin1
Surface Adjoin2
Int Allow_block=0	#Allow elevator to react to :blocked messaging?  0 = no.
Sound Beep
Int L=0			Local
End
Code
Crossed: Sleep(0.5); Call Move; Stop;
Activated:
If(Getsenderref() != Call0 || Isthingmoving(Elev) != 0 || Getcurframe(Elev) != Firstframe) Stop;
Playsoundpos(Beep, Getsurfacecenter(Call0), 1.0, -1, 100, 0);
Setwallcel(Call0, 1); Call Move; Stop;
Move: Movetoframe(Elev, Lastframe, Movespeed); Stop;
Arrived: If(Getcurframe(Elev) != Lastframe) Stop;
Settimer(Sleeptime); Setwallcel(Call0); Stop;
Timer: Movetoframe(Elev, Firstframe, Movespeed); Stop;
Blocked: If(Allow_block == 0) Stop;
If(Getgoalframe(Elev) == Lastframe) {
Stopthing(Elev); Movetoframe(Elev, Firstframe, Movespeed); }
Else { Stopthing(Elev); Movetoframe(Elev, Lastframe, Movespeed); }
Stop;
End


Credit me... [http://forums.massassi.net/html/wink.gif]

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.

↑ Up to the top!