home *** CD-ROM | disk | FTP | other *** search
- # DroidWorks Cog Script
- #
- # 00_t_boxmove.cog
- #
- # Thrust it!
- #
- # Desc:
- # Cog written to move a box down the chute and bring it back down at the end
- # at the incline place in the training level of droidworks
- #
- #
- # 05/05/98 [JP] created
- #
- symbols
- message startup
- message timer
- message entered
- message touched
-
- vector vec0 desc=thrust_direction
- vector vec1 desc=thrust_direction
- vector vec2 desc=thrust_direction
- vector vec3 desc=thrust_direction
-
- float speed=10.0 desc=thrust_speed
-
- sector sector0
- sector sector1
- sector sector2
- sector sector3
- sector sector4
- sector sector5
- sector sector6
- sector sector7
-
- surface c1 nolink
- surface c2 nolink
- surface c3 nolink
- surface c4 nolink
-
- int garbage local
- int cnt local
-
- thing crate
- thing door1 linkid=1 mask=0xffff
- thing door2 linkid=1 mask=0xffff
- thing door3 linkid=1 mask=0xffff
-
- sound convsound=MCH00tCnvyr01.wav local
- int volume=0.7 local
-
- end
-
-
- code
-
- //-----------------------------------------------------------------------------
-
- startup:
- slidewall(c1, vec2, speed);
- slidewall(c2, vec2, speed);
- slidewall(c3, vec3, speed);
- //playsoundpos(convsound, getsurfacecenter(convey0[cnt]), volume, -1, -1, 0x1);
-
- SectorThrust(sector0, vec0, speed);
- SectorThrust(sector1, vec0, speed);
- SectorThrust(sector2, vec1, speed);
- sectorthrust(sector6, vec3, 15);
- sectorthrust(sector7, vec3, 15);
- player=getlocalplayerthing();
- setactorflags(crate, 8);
- return;
-
- entered:
- print("entered");
- if (getsourceref()==crate)
- {
- if (getsenderid()==1)
- {
- movetoframe(door1, 1, 3);
- movetoframe(door2, 1, 3);
- movetoframe(door3, 1, 3);
- settimer(3);
- //open door1
- }
- }
- else if (getsourceref()==player) {
- print("player");
- }
- return;
-
- timer:
- movetoframe(door1, 0, 3);
- movetoframe(door2, 0, 3);
- movetoframe(door3, 0, 3);
- return;
-
- end
-