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 → Custom Elevator Cog
Custom Elevator Cog
2004-07-30, 6:56 AM #1
What I'm looking for is a cog that can do the following (I didn't see any cog like this in the cog section of downloads). It will be an elevator cog that uses a switch and the switch will control up to 20 elevators. The elevators will sleep at the 2nd frame for 1 minute. Then they will return to the first frame. Can someone please whip this up for me?

------------------
The Editor of bad levels such as:

Battle Ground Oasis The Forgotten Tomb
Office Building Arena
SpacePort Oasis
Wookie Camp
Fade to Black
Thriving Desert
Who made you God to say "I'll take your life from you"?
2004-07-30, 12:25 PM #2
*cracks fingurs and picks up a whip... And whips cream* mmmmmmm....

Code:
# Control 20 elevators at once.
#
# By Edward
symbols

message    startup
message    activated

thing      elev0
thing      elev1
thing      elev2
thing      elev3
thing      elev4
thing      elev5
thing      elev6
thing      elev7
thing      elev8
thing      elev9
thing      elev10
thing      elev11
thing      elev12
thing      elev13
thing      elev14
thing      elev15
thing      elev16
thing      elev17
thing      elev18
thing      elev19

surface    switch

flex       speed
flex       wait

int        i        local
int        up=0     local

end
#
code
startup:
        for(i=0; i<20; i=i+1)
          MoveToFrame(elev0,0,100);
        //Make sure they are all on first frame.
return;
activated:
          if(GetSenderRef()!=switch) return;
          if(up==1) return;
          up=1;
          for(i=0; i<20; i=i+1)
            MoveToFrame(elev0,1,speed);
          for(i=0; i<20; i=i+1)
            WaitForStop(elev0);
          sleep(wait);
          for(i=0; i<20; i=i+1)
            MoveToFrame(elev0,0,speed);
          for(i=0; i<20; i=i+1)
            WaitForStop(elev0);
          up=0;
return;
end

Untested so I hope it works and I hope it is what you wanted.

/Edward
Edward's Cognative Hazards

↑ Up to the top!