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

  1. # Droids Cog Script
  2. #
  3. # D0_skyway.cog
  4. #
  5. # Skyways cog
  6. #
  7. #
  8. #
  9. # [MT]
  10. #
  11. #
  12. # (C) 1997 LucasLearningLimited. All Rights Reserved
  13.  
  14.  
  15.  
  16. symbols
  17. thing               magnettram
  18. thing               magnettram2
  19. thing               beam1start
  20. thing               beam1end
  21. thing               beam2start
  22. thing               beam2end
  23.   
  24. //sector              thrustonsector0     linkid=6
  25. //sector              thrustonsector1     linkid=6
  26. //sector              thrustonsector2     linkid=6
  27. //sector              thrustonsector3     linkid=6 
  28. //sector              thrustonsector20     linkid=8
  29. //sector              thrustonsector21     linkid=8
  30. //sector              thrustonsector22     linkid=8
  31. //sector              thrustonsector23     linkid=8
  32. sector              thrustsector        linkid=5
  33. sector              thrustsector2       linkid=7
  34.           
  35. vector              thrustvector
  36.  
  37. message             startup
  38. message             arrived
  39.      //message             entered
  40. message             pulse
  41. message             user0
  42. message             user1
  43. message             user2
  44. message             user3
  45.  
  46. cog                 cog0           
  47. cog                 cog1           
  48. cog                 cog2           
  49. cog                 cog3           
  50. cog                 cog4           
  51.           
  52. int                 cognumber=-1
  53.  
  54. sound               magnetstart=nrgt2magnet.wav
  55. sound               magnetloop=amb00mgntlp2.wav
  56. end
  57. ## Code Section
  58. code    
  59.  
  60.      //generate beams and set sectorthrust at startup                    
  61. startup:
  62.      player=getlocalplayerthing();
  63.      pulsetime=20.0;
  64. //     print("startup");
  65.      setpulse(5);
  66.      addbeam(beam1start, beam1end, 147, .02);
  67.      addbeam(beam2start, beam2end, 147, .02);
  68.      setsectorthrust(thrustsector, thrustvector, 8);
  69.      setsectorthrust(thrustsector2, thrustvector, 8);
  70.      s1magloop=0;
  71.      s2magloop=0;
  72.      return;
  73.  
  74.  
  75. user0:
  76.      if (s1magloop==1) {
  77.           s1magloop=0;
  78.           print("turning off s1 thrust");
  79.           setsectorthrust(thrustsector, thrustvector, 0);
  80.           stopsound(magloop1);
  81.      }
  82.      return;
  83.      
  84. user1:
  85.      if (s1magloop==0) {
  86.           s1magloop=1;   
  87.           print("turning on s1 thrust");
  88.           setsectorthrust(thrustsector, thrustvector, 8);
  89.           playsoundthing(magnetstart, magnettram, 1.0, 10, 20, 0);
  90.           magloop1=playsoundthing(magnetloop, magnettram, .35, 10, 20, 0x1);
  91. //          playsoundlocal(magnetstart, 1.0, 0.0, 0);
  92. //          magloop1=playsoundlocal(magnetloop, 1.0, 0.0, 0x1);     
  93.      }
  94.      return;
  95.      
  96. user2:
  97.      if (s2magloop==1) {
  98.           s2magloop=0;     
  99.           print("turning off s2 thrust");
  100.           setsectorthrust(thrustsector2, thrustvector, 0);
  101.           stopsound(magloop2);
  102.      }
  103.      return;
  104.      
  105. user3:
  106.      if (s2magloop==0) {
  107.           s2magloop=1;
  108.           print("turning on s2 thrust");
  109.           setsectorthrust(thrustsector2, thrustvector, 8);          
  110.           playsoundthing(magnetstart, magnettram, 1.0, 10, 20, 0);
  111.           magloop2=playsoundthing(magnetloop, magnettram, .45, 10, 20, 0x1);
  112.      }
  113.      return;     
  114.  
  115.      //generate the next box in sequence
  116. pulse:    
  117.  //    print("about to pulse");     
  118.      sleep(0.5);
  119.      print("pulse");
  120.      cognumber=cognumber+1;
  121.      cogmod=cognumber%5;     
  122.      activecog=cog0[cogmod];
  123.      //tell the current treadI.cog to generate a box     
  124.      sendmessage(activecog, user0);
  125. //     sendmessage(cog0, user0);   
  126.      return;     
  127.  
  128.           
  129. end
  130.  
  131.  
  132.