PDA

View Full Version : Custom Elevator Cog



SM_Trige
07-30-2004, 09:56 AM
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 (http://www.massassi.net/levels/files/1852.shtml) The Forgotten Tomb (http://www.massassi.net/levels/files/1719.shtml)
Office Building Arena (http://www.massassi.net/levels/files/1718.shtml)
SpacePort Oasis (http://www.massassi.net/levels/files/1777.shtml)
Wookie Camp (http://www.massassi.net/levels/files/1716.shtml)
Fade to Black (http://www.massassi.net/levels/files/2548.shtml)
Thriving Desert (http://www.massassi.net/levels/files/1845.shtml)

Edward
07-30-2004, 03:25 PM
*cracks fingurs and picks up a whip... And whips cream* mmmmmmm....



# 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[i],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[i],1,speed);
for(i=0; i<20; i=i+1)
WaitForStop(elev0[i]);
sleep(wait);
for(i=0; i<20; i=i+1)
MoveToFrame(elev0[i],0,speed);
for(i=0; i<20; i=i+1)
WaitForStop(elev0[i]);
up=0;
return;
end

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

/Edward