home *** CD-ROM | disk | FTP | other *** search
- # Droids COG Script
- #
- # b0_Pulley_rop.cog
- #
- # Cog designed to put the struts in for the "same" part of the pulley setup.
- #
- # user0 rope sag
- # user1 rope tite
- # Desc:
- # 01/27/98 [DGS] Created
- #
- # ========================================================================================
-
- symbols
- message startup
- message activate
- message arrived
- message pulse
- message user0
- message user1
- message user2
- message user3
- message user4
- message user5
- message touched
-
-
- thing rope1a
- thing rope1b
- thing rope1c
- thing rope1d
- thing rope1e
- thing rope1f
- thing rope1g
-
- thing activator linkid=5
- thing rope2a
- thing rope2b linkid=1
- thing block
-
- cog setup_1_cog
- cog setup_2_cog
- cog setup_3_cog
-
- surface button0
-
- int rock=0
- int l_color=0
- int move=10
- int say1=0
- int rot=0 local
- flex l_size=0
- flex l_speed=0.1 local
- end
-
- code
- startup:
- print("STARTED");
-
- addbeam(rope1a, rope1b, 147, l_size);
- addbeam(rope1b, rope1c, 147, l_size);
- addbeam(rope1c, rope1d, 147, l_size);
- addbeam(rope1d, rope1e, 147, l_size);
- addbeam(rope1e, rope1f, 147, l_size);
- addbeam(rope1f, rope1g, 147, l_size);
-
-
- addbeam(rope2a, rope2b, 147, l_size);
- //movetoframe(rope2b,1,l_speed);
- rock = 1;
- // movetoframe(rope2b,2,10);
-
- //setpulse(1);
- return;
-
- touched:
- if (getsenderref() == block)
- {
- if ( (say1 == 0) && (getinv(getlocalplayerthing(),1) == 0) )
- {
- say1 = 1;
- dwPlayCammySpeech(10011, "T3ca017.wav", 10, 0);
- print("say1");
- }
- }
- return;
-
- activate:
- print("const: activate");
- if (getsenderid() == 5) // if the player pulled on the activator 3do
- {
- print("ACTIVATED!");
- // send messages to all of the setups
- sendmessage(setup_1_cog,user3);
- sendmessage(setup_2_cog,user3);
- sendmessage(setup_3_cog,user3);
- }
- return;
-
-
- arrived:
- if ((getsenderref() == activator) && (rot ==1))
- {
- rotatepivot(activator,1,0.250);
- }
- return;
-
- oldarrived:
- if ((getsenderid() == 1) && (rock == 0))
- {
- movetoframe(rope2b,1 - getcurframe(rope2b),L_speed);
- }
- if ((getsenderid() == 1) && (rock == 1))
- {
- if (getcurframe(rope2b) == 2) movetoframe(rope2b,3,L_speed);
- else if (getcurframe(rope2b) == 3) movetoframe(rope2b,2,L_speed);
- }
- return;
-
- rope_sag:
- // This routine makes the rope sag
- movetoframe(rope1b,0,0.5);
- movetoframe(rope1c,0,0.9);
- movetoframe(rope1d,0,1.0);
- movetoframe(rope1e,0,0.9);
- movetoframe(rope1f,0,0.5);
- return;
-
- rope_tite:
- // This routine makes the rope tite
- movetoframe(rope1b,1,0.5);
- movetoframe(rope1c,1,0.9);
- movetoframe(rope1d,1,1.0);
- movetoframe(rope1e,1,0.9);
- movetoframe(rope1f,1,0.5);
- return;
-
- user0:
- call rope_sag;
- return;
- user1:
- call rope_tite;
- return;
-
- user2:
- // lower rope
- //movetoframe(rope2b,2,1);
- rock = 1;
- return;
-
- user3:
- // raise rope
- //movetoframe(rope2b,1,1);
- rock = 0;
- return;
-
- user4:
- SetCollideType(activator, 0); // Turn off collides for the bottom pulley
- print("ACTIVATOR");
- rotatepivot(activator,1,0.250);
- rot = 1;
- return;
-
- user5:
- rot = 0;
- SetCollideType(activator, 3); // Turn oon collides for the bottom pulley
- return;
-
-
- pulse:
- move = move - 1;
- if (move == 0)
- {
- move = 10;
- call activate;
- }
- return;
- end
-
-
-
-
-