home *** CD-ROM | disk | FTP | other *** search
/ Classic Fond 52 / ClassicFond52.iso / GAMES / DROIDW.RAR / DWCD.GOB / mission_cog_00_t_elev2.cog < prev    next >
Encoding:
Text File  |  1998-11-04  |  1.6 KB  |  83 lines

  1. #
  2. # Droids Cog Script
  3. #
  4. # 00_elev_follow.cog
  5. #
  6. # A different type of Basic elevator Cog for Kids(tm)
  7. #
  8. # Desc: 
  9. #     This is a two stop elevator script that will move to a sector triggered 
  10. #    by the player. I called it "Follow" becuase if the player enters the sector 
  11. #    the elevator is NOT in, it will move there. therefore the player never has
  12. #    to call the elevator 
  13. #
  14. # 11/10/97    [DGS]    Created 
  15. #
  16. # --------------------------------------------------------------------------------
  17.  
  18.  
  19. symbols
  20. message        entered
  21. message        activate
  22. message        arrived
  23. message        startup
  24. message        timer
  25. message        blocked
  26.  
  27. surface        button    linkid=3
  28. thing        elevator     linkid=4
  29.  
  30. float        start_wait=0.25
  31. float        sleeptime=2.0
  32. float        speed=4.0
  33. float         inuse=0
  34. float          toframe=0
  35.  
  36. end
  37.  
  38. ## Code Section
  39. code
  40.  
  41. startup:
  42.      setwallcel(button, 2);
  43.      return;
  44.      
  45. activate:
  46.     if (inuse == 0)
  47.         {
  48.         if (getsenderid() == 3)    //It's the button or the sector that's calling
  49.             {
  50.              inuse = 1;
  51.              SetWallCel(button, 1);
  52.              MoveToFrame(elevator, 1, speed);
  53.                 toframe = 1;
  54.                 settimer(8);
  55.             }
  56.     
  57.         }
  58.         return;
  59.  
  60. blocked:
  61.      if (toframe == 1)
  62.           {
  63.           Movetoframe(elevator, 0, speed);
  64.           settimer(3);
  65.           }
  66.           
  67.      else if (toframe == 0)
  68.           {
  69.           MoveToFrame(elevator, 1, speed);
  70.           settimer(3);
  71.           }
  72.           
  73.      return;
  74.  
  75. timer:
  76.      inuse = 0;
  77.      setwallcel(call0, 2);
  78.      movetoframe(elevator, 0, speed);
  79.      toframe = 0;
  80.      return;
  81.  
  82. end
  83.