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

  1. #
  2. # Droids Cog Script
  3. #
  4. # 00_t_elev
  5. #
  6. # elev in crawler
  7. #
  8. # Desc: 
  9. #     
  10. #     
  11. #    
  12. #    
  13. #
  14. # 3/04/98    [JP]    Created 
  15. #
  16. # --------------------------------------------------------------------------------
  17.  
  18.  
  19. symbols
  20. message        startup
  21. message        entered
  22. message        activated
  23. message        arrived
  24. message        timer
  25. message        blocked
  26. message        crossed
  27. message        touched
  28. message        exited
  29.  
  30. surface         call0        linkid=3
  31.  
  32. thing        elevator     linkid=4  mask=0xffff
  33.  
  34. float        start_wait=0.25
  35. float        sleeptime=2.0
  36. float        speed=4.0
  37. float         inuse=0
  38.  
  39. sound          move=elv00tsmllelvlp.wav local
  40. sound          sw=swt00drswtch.wav  local          
  41.  
  42. sector         a1 linkid=2 //adjoin1
  43. thing          crate          nolink
  44.  
  45. sound          max=SWT00tWghtMax.wav local
  46. end
  47.  
  48. ## Code Section
  49. code
  50.  
  51. startup:
  52.      crateison=0;
  53.      player=getlocalplayerthing();
  54.      SetWallCel(call0, 2);
  55.      MoveToFrame(elevator, 0, speed);
  56.      return;
  57.           
  58. //activated:
  59. //    print("activated");
  60. //     printint(getsenderid());
  61. //    if (inuse == 0)
  62. //        {
  63. //        if (getsenderid() == 3)    //It's the button or the sector that's calling
  64. //            {
  65. //            inuse = 1;
  66. //            SetWallCel(call0, 1);
  67. //              Setwallcel(up, 1);   // 'up' arrow key light up
  68. //            MoveToFrame(elevator, 1, speed);
  69. //               dwplaycammyspeech(16010, "TGCA013.wav", 5, 1);
  70. //               Playsoundlocal(switch, 1, 0, 0);
  71. //               PlaysoundThing(move, elevator, 1.0, -1, -1, 0);
  72. //               settimer(6);
  73. //               print("going up");
  74. //            }
  75. //    
  76. //        }
  77. //        return;
  78. entered:
  79.      if (getsourceref()==crate) crateison=1;
  80.      return;
  81.      //else if ( (getsourceref()==player)&&(crateison==0) )
  82.     
  83.  
  84.  
  85.  
  86. activated:
  87.      print("entered1");          
  88.      if (crateison == 0)
  89.           {
  90.           if (inuse == 0)
  91.                {
  92.                if (getsenderid() == 3) //it's button
  93.                     {     
  94.                     inuse = 1;
  95.                     //if (getsourceref()==crate) crateison=1;
  96.                
  97.                     //if (IsThingMoving(elevator)) return;
  98.                     //if (GetCurFrame(elevator) != 0) return;     
  99.                
  100.      
  101.                     //else if ( (getsourceref()==player)&&(crateison==0) )
  102.                     //     {
  103.                          //sleep(start_wait);
  104.                          Movetoframe(elevator, 1, speed);
  105.                          settimer(6);
  106.                          print("moving1");
  107.                          dwplaycammyspeech(16010, "TGCA013.wav", 5, 1);
  108.                          setwallcel(call0, 1);
  109.                          playsoundlocal(sw, 1, 0, 0);
  110.                          //}
  111.                     }
  112.                }
  113.           }
  114.           
  115.      else if (crateison == 1)
  116.           {
  117.           playsoundlocal(max, 1, 0, 0);
  118.           }
  119.                                                                                                            
  120.      return;     
  121.      
  122. exited:
  123.      if (getsourceref()==crate) crateison=0;
  124.      return;
  125.         
  126. blocked:
  127.      MoveToFrame(elevator, 1, speed);
  128.      Playsoundthing(move, elevator, 1.0, -1, -1, 0);
  129.      settimer(6);
  130.      return;
  131.  
  132. timer:
  133.     inuse = 0;    
  134.     setwallcel(call0, 2);
  135.      //setwallcel(call1, 0);
  136.      setwallcel(up, 2);
  137.      //setwallcel(down, 0);
  138.      MoveToFrame(elevator, 0, speed);
  139.      Playsoundthing(move, elevator, 1.0, -1, -1, 0);
  140.     return;
  141.  
  142. end
  143.