home *** CD-ROM | disk | FTP | other *** search
- #standard type crate generation cog.
- symbols
- message startup
- message activate
- message arrived
- message timer
- thing incline1 nolink
- thing incline2 nolink
- thing incline3 nolink
- thing incline4 nolink
- thing alternatecam
- surface switch1 linkid=5
- surface switch2 linkid=6
- surface switch3 linkid=7
- surface switch4 linkid=8
-
- sound fulcrumstart=mcht4InclStrt.wav
- sound fulcrumloop=mcht4incllp.wav
- sound fulcrumstop=mcht4inclstp.wav
-
- sound switchsound=swt00ltswch1.wav
-
- template template12
- template template123
- template template1234
- thing ghost12
- thing ghost123
- thing ghost1234
- thing fakeincline1 linkid=1
- thing fakeincline2 linkid=2
- thing fakeincline3 linkid=3
- thing fakeincline4 linkid=4
- thing truealternatecam
- thing ThatCrate nolink
- thing CTDest24
- thing CTDest3
- thing ThatOtherCrate nolink
- thing TOCDest24
- thing TOCDest3
- int XCheck1=0 local
- int XCheck2=0 local
- end
-
- ## Code Section
- code
- startup:
- ca5=0;
- hasmoved=0;
- player=getlocalplayerthing();
- setwallcel(switch1, 1);
- setwallcel(switch2, 1);
- setwallcel(switch3, 1);
- setwallcel(switch4, 1);
- return;
-
- activate:
- print("activate");
- printint(getsenderid());
- cratepos=getthingpos(ThatCrate);
- crateY=VectorY(cratepos);
- crateX=VectorX(cratepos);
- cratepos2=getthingpos(ThatOtherCrate);
- crateY2=VectorY(cratepos2);
- crateX2=VectorX(cratepos2);
-
- if ( (getsenderid()==5)&&(getwallcel(switch1)==1) ) {
- playsoundpos(switchsound, getsurfacecenter(switch1), 1.0, -1, -1, 0);
- setwallcel(switch1, 2);
- settimerEX(0.5, 1, 0, 0);
- dwfreezeplayer();
- movetoframe(incline1, 1, 5);
- movetoframe(fakeincline1, 1, 5);
- playsoundlocal(fulcrumstart, 1.0, 0.0, 0);
- sleep(0.17);
- floop=playsoundlocal(fulcrumloop, 1.0, 0.0, 0x1);
- if (getdifficulty()==0) dwPlayCammySpeech(16005, "t4ca005.wav", 20, 2);
- }
- else if ( (getsenderid()==6)&&(getwallcel(switch2)==1) ) {
- playsoundpos(switchsound, getsurfacecenter(switch2), 1.0, -1, -1, 0);
- setwallcel(switch2, 2);
- settimerEX(0.5, 2, 0, 0);
- dwfreezeplayer();
- destroything(incline2);
- movetoframe(fakeincline2, 1, 5);
- playsoundlocal(fulcrumstart, 1.0, 0.0, 0);
- sleep(0.17);
- floop=playsoundlocal(fulcrumloop, 1.0, 0.0, 0x1);
- if (getdifficulty()==0) dwPlayCammySpeech(16006, "t4ca006.wav", 20, 2);
- if ( (crateY>15.95)&&(crateY<16.63)&&(crateX>7.88)&&(crateX<8.65) ) teleportthing(thatcrate, CTDest24);
- if ( (crateY2>15.95)&&(crateY2<16.63)&&(crateX2>7.88)&&(crateX2<8.65) ) teleportthing(thatothercrate, TOCDest24);
- }
- else if ( (getsenderid()==7)&&(getwallcel(switch3)==1) ) {
- playsoundpos(switchsound, getsurfacecenter(switch3), 1.0, -1, -1, 0);
- setwallcel(switch3, 2);
- settimerEX(0.5, 3, 0, 0);
- dwfreezeplayer();
- destroything(incline3);
- movetoframe(fakeincline3, 1, 5);
- playsoundlocal(fulcrumstart, 1.0, 0.0, 0);
- sleep(0.17);
- floop=playsoundlocal(fulcrumloop, 1.0, 0.0, 0x1);
- if (getdifficulty()==0) dwPlayCammySpeech(16007, "t4ca007.wav", 10, 2);
- if ( (crateY>15.95)&&(crateY<16.63)&&(crateX>7.31)&&(crateX<8.28) ) teleportthing(thatcrate, CTDest3);
- if ( (crateY2>15.95)&&(crateY2<16.63)&&(crateX2>7.31)&&(crateX2<8.28) ) teleportthing(thatOthercrate, TOCDest3);
-
- }
- else if ( (getsenderid()==8)&&(getwallcel(switch4)==1) ) {
- playsoundpos(switchsound, getsurfacecenter(switch4), 1.0, -1, -1, 0);
- setwallcel(switch4, 2);
- settimerEX(0.5, 4, 0, 0);
- dwfreezeplayer();
- destroything(incline4);
- movetoframe(fakeincline4, 1, 5);
- playsoundlocal(fulcrumstart, 1.0, 0.0, 0);
- sleep(0.17);
- floop=playsoundlocal(fulcrumloop, 1.0, 0.0, 0x1);
- if (getdifficulty()==0) dwPlayCammySpeech(16008, "t4ca008.wav", 10, 2);
- if ( (crateY>15.95)&&(crateY<16.63)&&(crateX>6.54)&&(crateX<7.89) ) teleportthing(thatcrate, CTDest24);
- if ( (crateY2>15.95)&&(crateY2<16.63)&&(crateX2>6.54)&&(crateX2<7.89) ) teleportthing(thatOthercrate, TOCDest24);
- }
- return;
-
- timer:
- if (getsenderid()==1) SetCameraFocii(2, incline1, truealternatecam);
- else if (getsenderid()==2) SetCameraFocii(2, fakeincline2, alternatecam);
- else if (getsenderid()==3) SetCameraFocii(2, fakeincline3, alternatecam);
- else if (getsenderid()==4) SetCameraFocii(2, fakeincline4, alternatecam);
- SetCurrentCamera(2);
- return;
-
- arrived:
- if (getsenderid()==1) {
- setwallcel(switch1, 0);
- stopsound(floop, 0.75);
- playsoundlocal(fulcrumstop, 1.0, 0.0, 0);
- sleep(0.5);
- SetCurrentCamera(7);
- dwunfreezeplayer();
- }
- else if (getsenderid()==2) {
- setwallcel(switch2, 0);
- stopsound(floop, 0.75);
- playsoundlocal(fulcrumstop, 1.0, 0.0, 0);
- sleep(0.5);
- SetCurrentCamera(7);
- dwunfreezeplayer();
- destroything(incline1);
- incline12=creatething(template12, ghost12);
- }
- else if (getsenderid()==3) {
- setwallcel(switch3, 0);
- stopsound(floop, 0.75);
- playsoundlocal(fulcrumstop, 1.0, 0.0, 0);
- sleep(0.5);
- SetCurrentCamera(7);
- dwunfreezeplayer();
- destroything(incline12);
- incline123=creatething(template123, ghost123);
- }
- else if (getsenderid()==4) {
- setwallcel(switch4, 0);
- stopsound(floop, 0.75);
- playsoundlocal(fulcrumstop, 1.0, 0.0, 0);
- SetCurrentCamera(7);
- dwunfreezeplayer();
- destroything(incline123);
- incline1234=creatething(template1234, ghost1234);
- }
- return;
-
- end
-
-
-
-
-
-
-
-
-
-
-