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
- message startup
- message timer
- message blocked
-
- surface button linkid=3
- thing elevator linkid=4
-
- float start_wait=0.25
- float sleeptime=2.0
- float speed=4.0
- float inuse=0
- float toframe=0
-
- end
-
- ## Code Section
- code
-
- startup:
- setwallcel(button, 2);
- return;
-
- activate:
- if (inuse == 0)
- {
- if (getsenderid() == 3) //It's the button or the sector that's calling
- {
- inuse = 1;
- SetWallCel(button, 1);
- MoveToFrame(elevator, 1, speed);
- toframe = 1;
- settimer(8);
- }
-
- }
- return;
-
- blocked:
- if (toframe == 1)
- {
- Movetoframe(elevator, 0, speed);
- settimer(3);
- }
-
- else if (toframe == 0)
- {
- MoveToFrame(elevator, 1, speed);
- settimer(3);
- }
-
- return;
-
- timer:
- inuse = 0;
- setwallcel(call0, 2);
- movetoframe(elevator, 0, speed);
- toframe = 0;
- return;
-
- end
-