home *** CD-ROM | disk | FTP | other *** search
- symbols
- message user1
- message arrived
- message startup
- message crossed
- message entered
- message timer
-
- template w50cratetemplate
-
- surface triggeradjoin mask=0xffff
-
- sector thrustsector
- vector thrustvector
-
- thing wcreatecrateghost
- thing newtram
-
- thing beamstart
- thing beamend
- thing beamend2
- thing beamstart2
-
- cog catapultcog
-
- thing launchcamera
- thing callcratecamera
-
- sound t1dropcrate
- sound t1trammove
- sound t1tramstart
-
-
- end
-
- code
- startup:
- player=getlocalplayerthing();
- setsectorthrust(thrustsector, thrustvector, 8);
- crateishere=0;
- return;
-
-
- user1:
- playsoundthing(t1tramstart, newtram, 1, -1, 80, 0);
- movechannel=playsoundthing(t1trammove, newtram, 1, -1, 80, 0x1);
- crateishere=1;
- smallcrate=creatething (w50cratetemplate, wcreatecrateghost);
- dwfreezeplayer();
- setcamerafocii(2, newtram, callcratecamera);
- setcurrentcamera(2);
- setTimerEX(6.5, 3, 0, 0);
- return;
-
- arrived:
-
- if (getcurframe(newtram)==0) {
- stopsound(movechannel, 0.3);
- setsectorthrust(thrustsector, thrustvector, 8);
- }
- else if (getcurframe(newtram)==4) {
- sleep(2);
- destroything(achthing);
- sendmessage(catapultcog, user1);
- crateishere=0;
- playsoundthing(t1dropcrate, newtram, 1, -1, -1, 0);
- movetoframe(newtram, 0, 25);
- }
- return;
-
- crossed:
- print("crossed");
- hangoffset=('0,0,0');
- achthing=getsourceref();
- call movetram;
- return;
-
- movetram:
- print("attaching the thing");
- //turn off sectorthrust
- setsectorthrust(thrustsector, thrustvector, 0);
- totalradius = GetThingRadius(achthing) + GetThingRadius(newtram);
- VectorSet(hangoffset, 0, 0, -totalradius);
- hangoffset = VectorAdd(hangoffset, GetThingInsertOffset(newtram));
- hangoffset = VectorSub(hangoffset, GetThingInsertOffset(achthing));
- SetThingPos(achthing, VectorAdd(GetThingPos(newtram), hangoffset));
- AttachThingToThingEx(achthing, newtram, 8);
- movetoframe(newtram, 4, 7);
- return;
-
- timer:
- if (getsenderid()==3) {
- setcurrentcamera(7);
- dwunfreezeplayer();
- }
- return;
-
-
-
-
- end
-
-