home *** CD-ROM | disk | FTP | other *** search
/ Classic Fond 52 / ClassicFond52.iso / GAMES / DROIDW.RAR / DWCD.GOB / mission_cog_b0_elev_follow.cog < prev    next >
Encoding:
Text File  |  1998-11-04  |  1.3 KB  |  71 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.  
  24. sector        sector0     linkid=3
  25. sector        sector1     linkid=3
  26.  
  27. surface        xcall        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.  
  35. end
  36.  
  37. ## Code Section
  38. code
  39.  
  40. activate:
  41. entered:
  42.     print("entered");
  43.     if (inuse == 0)
  44.         {
  45.         if (getsenderid() == 3)    //It's the button or the sector that's calling
  46.             {
  47.              inuse = 1;
  48.              SetWallCel(xcall, 1);
  49.              MoveToFrame(elevator, 1, speed);
  50.             }
  51.     
  52.         if (GetSenderId() == 4)  //player got on the elevator.
  53.             {
  54.             SetWallCel(xcall, 1);
  55.             Sleep(start_wait);            // pause before moving up
  56.             if (getcurframe(elevator) != 0) 
  57.                 {
  58.                 inuse = 1;
  59.                 moveToFrame(elevator, 0, speed);
  60.                 }
  61.             }
  62.         }
  63.         return;
  64.  
  65. arrived:
  66.     inuse = 0;    
  67.     setwallcel(xcall, 0);
  68.     return;
  69.  
  70.  
  71.