home *** CD-ROM | disk | FTP | other *** search
- #
- # Droids Cog Script
- #
- # 00_elev_follow.cog
- #
- # A different type of Basic elevator Cog for Kids(tm)
- #
- # Desc:
- # This is a two stop elevator script that will move to a sector triggered
- # by the player. I called it "Follow" becuase if the player enters the sector
- # the elevator is NOT in, it will move there. therefore the player never has
- # to call the elevator
- #
- # 11/10/97 [DGS] Created
- #
- # --------------------------------------------------------------------------------
-
-
- symbols
- message entered
- message activate
- message arrived
-
- sector sector0 linkid=3
- sector sector1 linkid=3
-
- surface xcall linkid=3
- thing elevator linkid=4
-
- float start_wait=0.25
- float sleeptime=2.0
- float speed=4.0
- float inuse=0
-
- end
-
- ## Code Section
- code
-
- activate:
- entered:
- print("entered");
- if (inuse == 0)
- {
- if (getsenderid() == 3) //It's the button or the sector that's calling
- {
- inuse = 1;
- SetWallCel(xcall, 1);
- MoveToFrame(elevator, 1, speed);
- }
-
- if (GetSenderId() == 4) //player got on the elevator.
- {
- SetWallCel(xcall, 1);
- Sleep(start_wait); // pause before moving up
- if (getcurframe(elevator) != 0)
- {
- inuse = 1;
- moveToFrame(elevator, 0, speed);
- }
- }
- }
- return;
-
- arrived:
- inuse = 0;
- setwallcel(xcall, 0);
- return;
-
-
-