home *** CD-ROM | disk | FTP | other *** search
- # Droids Cog Script
- #
- # D0_skyway.cog
- #
- # Skyways cog
- #
- #
- #
- #
- #
- # [MT]
- #
- #
- # (C) 1997 LucasLearningLimited. All Rights Reserved
-
-
-
- symbols
- thing magnettram
- thing magnettram2
- thing beam1start
- thing beam1end
- thing beam2start
- thing beam2end
-
- //sector thrustonsector0 linkid=6
- //sector thrustonsector1 linkid=6
- //sector thrustonsector2 linkid=6
- //sector thrustonsector3 linkid=6
- //sector thrustonsector20 linkid=8
- //sector thrustonsector21 linkid=8
- //sector thrustonsector22 linkid=8
- //sector thrustonsector23 linkid=8
- sector thrustsector linkid=5
- sector thrustsector2 linkid=7
-
- vector thrustvector
-
- message startup
- message arrived
- //message entered
- message pulse
- message user0
- message user1
- message user2
- message user3
-
- cog cog0
- cog cog1
- cog cog2
- cog cog3
- cog cog4
-
- int cognumber=-1
-
- sound magnetstart=nrgt2magnet.wav
- sound magnetloop=amb00mgntlp2.wav
- end
- ## Code Section
- code
-
- //generate beams and set sectorthrust at startup
- startup:
- player=getlocalplayerthing();
- pulsetime=20.0;
- // print("startup");
- setpulse(5);
- addbeam(beam1start, beam1end, 147, .02);
- addbeam(beam2start, beam2end, 147, .02);
- setsectorthrust(thrustsector, thrustvector, 8);
- setsectorthrust(thrustsector2, thrustvector, 8);
- s1magloop=0;
- s2magloop=0;
- return;
-
-
- user0:
- if (s1magloop==1) {
- s1magloop=0;
- print("turning off s1 thrust");
- setsectorthrust(thrustsector, thrustvector, 0);
- stopsound(magloop1);
- }
- return;
-
- user1:
- if (s1magloop==0) {
- s1magloop=1;
- print("turning on s1 thrust");
- setsectorthrust(thrustsector, thrustvector, 8);
- playsoundthing(magnetstart, magnettram, 1.0, 10, 20, 0);
- magloop1=playsoundthing(magnetloop, magnettram, .35, 10, 20, 0x1);
- // playsoundlocal(magnetstart, 1.0, 0.0, 0);
- // magloop1=playsoundlocal(magnetloop, 1.0, 0.0, 0x1);
- }
- return;
-
- user2:
- if (s2magloop==1) {
- s2magloop=0;
- print("turning off s2 thrust");
- setsectorthrust(thrustsector2, thrustvector, 0);
- stopsound(magloop2);
- }
- return;
-
- user3:
- if (s2magloop==0) {
- s2magloop=1;
- print("turning on s2 thrust");
- setsectorthrust(thrustsector2, thrustvector, 8);
- playsoundthing(magnetstart, magnettram, 1.0, 10, 20, 0);
- magloop2=playsoundthing(magnetloop, magnettram, .45, 10, 20, 0x1);
- }
- return;
-
- //generate the next box in sequence
- pulse:
- // print("about to pulse");
- sleep(0.5);
- print("pulse");
- cognumber=cognumber+1;
- cogmod=cognumber%5;
- activecog=cog0[cogmod];
- //tell the current treadI.cog to generate a box
- sendmessage(activecog, user0);
- // sendmessage(cog0, user0);
- return;
-
-
- end
-
-
-