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

  1. # Droids COG Script
  2. #
  3. # b0_Pulley_rop.cog
  4. #
  5. # Cog designed to put the struts in for the "same" part of the pulley setup.
  6. #
  7. #    user0        rope sag
  8. #    user1        rope tite
  9. # Desc:
  10. #     01/27/98 [DGS]    Created
  11. # ========================================================================================
  12.  
  13. symbols
  14.     message        startup
  15.     message        activate
  16.     message        arrived
  17.     message        pulse
  18.     message        user0
  19.     message        user1
  20.     message        user2
  21.     message        user3
  22.     message        user4
  23.     message        user5
  24.     message        touched
  25.     
  26.     
  27.     thing        rope1a
  28.     thing        rope1b
  29.     thing        rope1c
  30.     thing        rope1d
  31.     thing        rope1e
  32.     thing        rope1f
  33.     thing        rope1g
  34.     
  35.     thing        activator    linkid=5
  36.     thing        rope2a
  37.     thing        rope2b    linkid=1
  38.     thing        block
  39.     
  40.     cog        setup_1_cog
  41.     cog        setup_2_cog
  42.     cog        setup_3_cog
  43.     
  44.     surface        button0
  45.     
  46.     int        rock=0
  47.     int        l_color=0
  48.     int        move=10
  49.     int        say1=0
  50.     int        rot=0            local
  51.     flex        l_size=0
  52.     flex        l_speed=0.1     local      
  53. end
  54.  
  55. code
  56. startup:
  57.     print("STARTED");
  58.     
  59.     addbeam(rope1a, rope1b, 147, l_size);
  60.     addbeam(rope1b, rope1c, 147, l_size);
  61.     addbeam(rope1c, rope1d, 147, l_size);
  62.     addbeam(rope1d, rope1e, 147, l_size);
  63.     addbeam(rope1e, rope1f, 147, l_size);
  64.     addbeam(rope1f, rope1g, 147, l_size);
  65.     
  66.     
  67.     addbeam(rope2a, rope2b, 147, l_size);
  68.     //movetoframe(rope2b,1,l_speed);
  69.     rock = 1;
  70.    // movetoframe(rope2b,2,10);
  71.  
  72.     //setpulse(1);
  73.     return;
  74.  
  75. touched:
  76.     if (getsenderref() == block)
  77.         {
  78.         if ( (say1 == 0) && (getinv(getlocalplayerthing(),1) == 0) )
  79.             {
  80.             say1 = 1;
  81.             dwPlayCammySpeech(10011, "T3ca017.wav", 10, 0);
  82.             print("say1");
  83.             }
  84.         }
  85.     return;
  86.  
  87. activate:
  88.     print("const: activate");
  89.     if (getsenderid() == 5) // if the player pulled on the activator 3do
  90.         {
  91.         print("ACTIVATED!");
  92.         // send messages to all of the setups
  93.         sendmessage(setup_1_cog,user3);
  94.         sendmessage(setup_2_cog,user3);
  95.         sendmessage(setup_3_cog,user3);
  96.         }
  97.     return;
  98.  
  99.  
  100. arrived:
  101.      if ((getsenderref() == activator) && (rot ==1))
  102.         {
  103.         rotatepivot(activator,1,0.250);
  104.         }
  105.     return;
  106.  
  107. oldarrived:
  108.     if ((getsenderid() == 1) && (rock == 0))
  109.         {
  110.         movetoframe(rope2b,1 - getcurframe(rope2b),L_speed);
  111.         }
  112.         if ((getsenderid() == 1) && (rock == 1))
  113.         {
  114.         if (getcurframe(rope2b) == 2) movetoframe(rope2b,3,L_speed);
  115.                 else if (getcurframe(rope2b) == 3) movetoframe(rope2b,2,L_speed);
  116.         }
  117.     return;
  118.  
  119. rope_sag:
  120.     // This routine makes the rope sag
  121.     movetoframe(rope1b,0,0.5);
  122.         movetoframe(rope1c,0,0.9);
  123.     movetoframe(rope1d,0,1.0);
  124.     movetoframe(rope1e,0,0.9);
  125.     movetoframe(rope1f,0,0.5);
  126.         return;
  127.  
  128. rope_tite:
  129.     // This routine makes the rope tite
  130.     movetoframe(rope1b,1,0.5);
  131.         movetoframe(rope1c,1,0.9);
  132.     movetoframe(rope1d,1,1.0);
  133.     movetoframe(rope1e,1,0.9);
  134.     movetoframe(rope1f,1,0.5);
  135.         return;
  136.  
  137. user0:
  138.         call rope_sag;
  139.     return;
  140. user1:
  141.     call rope_tite;
  142.     return;
  143.     
  144. user2:
  145.     // lower rope
  146.         //movetoframe(rope2b,2,1);
  147.     rock = 1;
  148.         return;
  149.  
  150. user3:
  151.     // raise rope
  152.         //movetoframe(rope2b,1,1);
  153.     rock = 0;
  154.         return;
  155.  
  156. user4:
  157.     SetCollideType(activator,     0);     // Turn off collides for the bottom pulley 
  158.     print("ACTIVATOR");
  159.     rotatepivot(activator,1,0.250);
  160.     rot = 1;
  161.     return;
  162.  
  163. user5:
  164.     rot = 0;
  165.     SetCollideType(activator,     3);     // Turn oon collides for the bottom pulley 
  166.     return;
  167.  
  168.     
  169. pulse:
  170.            move = move - 1;
  171.     if (move == 0) 
  172.         {
  173.         move = 10;
  174.         call activate;
  175.         }
  176.     return;
  177. end
  178.  
  179.  
  180.  
  181.  
  182.