//-- // Panel movement on Assembly Line, Phase 1 aweldon Feb 05 // Smashing! //-- void startPanel( entity panel ) { // Start platform on its way setNewTimes( panel, 3.5 , 0 , 0 ); panel.move( NORTH , 192 ); panel.startSoundShader( "tram_platform_4_2nd_piece", SND_CHANNEL_ANY ); // *TEMPORARY'D* sys.wait( 1 ); } void clasperMoves( entity panel ) { // Set first move times and move clasper to position. setNewTimes( $panelClasper , .5 , .25 , .1 ); $panelClasper.move( SOUTH , 8 ); sys.waitFor( $panelClasper ); // Re-set times and spin the clasper like mad setNewTimes( $panelClasper , 1 , .5 , .5 ); $panelClasper.rotateOnce( '270 0 0' ); $panelClasper.startSoundShader( "tram_platform_6_plat_move1", SND_CHANNEL_ANY ); // *TEMPORARY'D* sys.wait( .5 ); // Move the clasper down to convenient plate-grabbing level setNewTimes( $panelClasperHeight , .5 , .25 , .25 ); $panelClasperHeight.move( DOWN , 10 ); sys.waitFor( $panelClasperHeight ); // Extend the clasper toward the plate setNewTimes( $panelClasper , .5 , .25 , .25 ); $panelClasper.move( SOUTH , 28 ); //$panelClasper.startSoundShader( "tram_platform_7_arms", SND_CHANNEL_ANY ); // *TEMPORARY'D* // Open the clamps and wait for the panel to arrive setNewTimes( $panelClasperBar_1 , .25 , .1 , 0 ); setNewTimes( $panelClasperBar_2 , .25 , .1 , 0 ); $panelClasperBar_1.rotateOnce( '0 45 0' ); $panelClasperBar_2.rotateOnce( '0 -45 0' ); //$panelClasperBar_2.startSoundShader( "tram_platform_2_railings", SND_CHANNEL_ANY ); // *TEMPORARY'D* sys.waitFor( $panelClasper ); // Clampinate! setNewTimes( $panelClasperBar_1 , .25 , .1 , 0 ); setNewTimes( $panelClasperBar_2 , .25 , .1 , 0 ); $panelClasperBar_1.rotateOnce( '0 -45 0' ); $panelClasperBar_2.rotateOnce( '0 45 0' ); sys.waitFor( $panelClasperBar_2 ); sys.waitFor( panel); // Bind panel to Clasper and let the games begin panel.bind( $panelClasper ); $panelClasper.move( NORTH , 32 ); sys.waitFor( $panelClasper ); // Re-Set Clasper times and set Mover times to move to press machine setNewTimes( $panelMover , 2 , .75 , .75 ); $panelMover.move( WEST , 256 ); //$panelMover.startSoundShader( "tram_platform_6_plat_move1", SND_CHANNEL_ANY ); // *TEMPORARY'D* // Lift the height controller $panelClasperHeight.move( UP , 42 ); // Spin the clasper setNewTimes( $panelClasper , 1 , .5 , .5 ); $panelClasper.rotateOnce( '-270 0 0' ); //$panelClasper.startSoundShader( "tram_platform_6_plat_move1", SND_CHANNEL_ANY ); // *TEMPORARY'D* sys.wait( 1 ); // Move pressing pieces into position setNewTimes( $pressMachine_1 , 1 , .5 , .25 ); setNewTimes( $pressMachine_2 , 1 , .5 , .25 ); // unbind the back pieces so it functions like a piston - jersey $pressMachine_1_back_piston.unbind(); $pressMachine_2_back_piston.unbind(); $pressMachine_1_back_piston_b.unbind(); $pressMachine_2_back_piston_b.unbind(); // Move pressing pieces into position sys.trigger( $speaker_press_long ); $pressMachine_1.move( NORTH , 64 ); $pressMachine_2.move( NORTH , 64 ); //$pressMachine_2.startSoundShader( "tram_platform_2_railings", SND_CHANNEL_ANY ); // *TEMPORARY'D* // Lower the panel $panelClasperHeight.move( DOWN , 32 ); sys.waitFor( $panelMover ); } void pressPanel( entity panel ) { // Set all applicable times setNewTimes( $panelClasper , .5 , 0 , .25 ); setNewTimes( $panelClasperExtend_1 , .5 , 0 , 0 ); setNewTimes( $panelClasperExtend_2 , .5 , .25 , 0 ); // Extend into the press machine $panelClasperExtend_2.move( SOUTH , 24 ); //$panelClasperExtend_2.startSoundShader( "tram_platform_7_arms", SND_CHANNEL_ANY ); // *TEMPORARY'D* sys.waitFor( $panelClasperExtend_2 ); $panelClasperExtend_1.move( SOUTH , 32 ); //$panelClasperExtend_1.startSoundShader( "tram_platform_7_arms", SND_CHANNEL_ANY ); // *TEMPORARY'D* sys.waitFor( $panelClasperExtend_1 ); $panelClasper.move( SOUTH , 28 ); //$panelClasper.startSoundShader( "tram_platform_7_arms", SND_CHANNEL_ANY ); // *TEMPORARY'D* sys.waitFor( $panelClasper ); // binds everything again so the arms move as one piece - jersey $pressMachine_1_back_piston.bind($pressMachine_1); $pressMachine_2_back_piston.bind($pressMachine_2); $pressMachine_1_back_piston_b.bind($pressMachine_1); $pressMachine_2_back_piston_b.bind($pressMachine_2); // Set times for the pressing machine, then commence primary compression. setNewTimes( $pressMachine_1 , .25 , .1 , -1 ); setNewTimes( $pressMachine_2 , .25 , .1 , -1 ); sys.trigger( $speaker_press_close ); $pressMachine_1.move( WEST , 30 ); $pressMachine_2.move( EAST , 30 ); sys.waitFor( $pressMachine_2 ); // Smashinated effects sys.trigger( $smashEffect_1 ); sys.trigger( $smashEffect_2 ); sys.wait( .5 ); // Fire off the steam on open sys.trigger( $pressMachineSteamA_1 ); sys.trigger( $pressMachineSteamA_2 ); sys.trigger( $pressMachineSteamB_1 ); sys.trigger( $pressMachineSteamB_2 ); // Open again sys.trigger( $speaker_press_open ); $pressMachine_1.move( EAST , 8 ); $pressMachine_2.move( WEST , 8 ); sys.waitFor( $pressMachine_2 ); // Retract from pressing machine setNewTimes( $panelClasper , .5 , .25 , 0 ); setNewTimes( $panelClasperExtend_1 , .5 , 0 , 0 ); setNewTimes( $panelClasperExtend_2 , .5 , 0 , .25 ); $panelClasper.move( NORTH , 28 ); //$panelClasper.startSoundShader( "tram_platform_7_arms", SND_CHANNEL_ANY ); // *TEMPORARY'D* sys.waitFor( $panelClasper ); // Start moving pressing pieces setNewTimes( $pressMachine_1 , 2 , 1 , .25 ); setNewTimes( $pressMachine_2 , 2 , 1 , .25 ); sys.trigger( $speaker_press_long ); $pressMachine_1.move( EAST , 22 ); $pressMachine_2.move( WEST , 22 ); // Continue with retracting panel $panelClasperExtend_1.move( NORTH , 32 ); //$panelClasperExtend_1.startSoundShader( "tram_platform_7_arms", SND_CHANNEL_ANY ); // *TEMPORARY'D* sys.waitFor( $panelClasperExtend_1 ); $panelClasperExtend_2.move( NORTH , 24 ); //$panelClasperExtend_2.startSoundShader( "tram_platform_7_arms", SND_CHANNEL_ANY ); // *TEMPORARY'D* sys.waitFor( $panelClasperExtend_2 ); sys.waitFor( $pressMachine_2 ); // Move pressing pieces out of the way $pressMachine_1.time( 1 ); $pressMachine_1.accelTime( .5 ); $pressMachine_1.decelTime( .25 ); $pressMachine_2.time( 1 ); $pressMachine_2.accelTime( .5 ); $pressMachine_2.decelTime( .25 ); // unbind the back pieces so it functions like a piston - jersey $pressMachine_1_back_piston.unbind(); $pressMachine_2_back_piston.unbind(); $pressMachine_1_back_piston_b.unbind(); $pressMachine_2_back_piston_b.unbind(); // Return the pieces to the original location sys.trigger( $speaker_press_long ); $pressMachine_1.move( SOUTH , 64 ); //$pressMachine_1.startSoundShader( "tram_platform_2_railings", SND_CHANNEL_ANY ); // *TEMPORARY'D* $pressMachine_2.move( SOUTH , 64 ); //$pressMachine_2.startSoundShader( "tram_platform_2_railings", SND_CHANNEL_ANY ); // *TEMPORARY'D* } void flipPanel( entity panel ) { //sys.println( "Flipping panel in crazy over-the-top fashion." ); // Move up and set times for flipping over top of mr. device setNewTimes( $panelClasperHeight , .5 , .25 , 0 ); $panelClasperHeight.move( UP , 20 ); sys.waitFor( $panelClasperHeight ); setNewTimes( $panelClasperExtend_2 , .5 , .25 , .25 ); // *FLIP'D* //$panelClasperHeight.move( UP , 20 ); //sys.waitFor( $panelClasperHeight ); setNewTimes( $panelClasper , .5 , .25 , .25 ); $panelClasper.move( SOUTH, 16 ); sys.waitFor( $panelClasper ); setNewTimes( $panelClasper , 1 , .25 , .25 ); setNewTimes( $panelClasperExtend_2 , 1 , .25 , .25 ); $panelClasperExtend_2.rotateOnce( '0 0 -180' ); //$panelClasperExtend_2.startSoundShader( "tram_platform_6_plat_move1", SND_CHANNEL_ANY ); // *TEMPORARY'D* $panelClasper.rotateOnce( '270 0 0' ); sys.waitFor( $panelClasper ); setNewTimes( $panelClasper , .5 , 0 , .25 ); $panelClasper.move( SOUTH , 16 ); sys.waitFor( $panelClasper ); setNewTimes( $panelClasperHeight , 1 , 0 , .25 ); $panelClasperHeight.move( DOWN , 30 ); sys.waitFor( $panelClasperHeight ); // Unlock Clamps $panelClasperBar_1.rotateOnce( '0 45 0' ); $panelClasperBar_2.rotateOnce( '0 -45 0' ); sys.waitFor( $panelClasperBar_2 ); panel.unbind(); } void returnMover() { //Make the return flip. setNewTimes( $panelClasperHeight , .25 , -1 , 0 ); $panelClasperHeight.move( UP , 30 ); sys.waitFor( $panelClasperHeight ); setNewTimes( $panelClasper , .5 , .25, 0 ); $panelClasper.move( NORTH , 16 ); sys.waitFor( $panelClasper ); setNewTimes( $panelClasper , 1 , .5 , .5 ); $panelClasperExtend_2.rotateOnce( '0 0 180' ); //$panelClasperExtend_2.startSoundShader( "tram_platform_6_plat_move1", SND_CHANNEL_ANY ); // *TEMPORARY'D* $panelClasper.rotateOnce( '-450 0 0' ); sys.waitFor( $panelClasper ); setNewTimes( $panelClasper , .25, 0 , .1 ); $panelClasper.move( NORTH , 16 ); setNewTimes( $panelClasperHeight , .25 , 0 , .1 ); $panelClasperHeight.move( DOWN , 20 ); sys.waitFor( $panelClasperHeight ); // Move entire platform back and spin everything back into place! setNewTimes( $panelClasper , .25 , .1 , .1 ); $panelClasper.move( SOUTH , 8 ); sys.waitFor( $panelClasper ); $panelMover.move( EAST , 256 ); //$panelMover.startSoundShader( "tram_platform_6_plat_move1", SND_CHANNEL_ANY ); // *TEMPORARY'D* setNewTimes( $panelClasper , 1 , .5 , .5 ); $panelClasper.rotateOnce( '180 0 0' ); //$panelClasperExtend_2.startSoundShader( "tram_platform_6_plat_move1", SND_CHANNEL_ANY ); // *TEMPORARY'D* sys.wait( 1 ); setNewTimes( $panelClasperBar_1, .25 , .1 , .1 ); setNewTimes( $panelClasperBar_2, .25 , .1 , .1 ); $panelClasperBar_1.rotateOnce( '0 -45 0' ); $panelClasperBar_2.rotateOnce( '0 45 0' ); //$panelClasperBar_2.startSoundShader( "tram_platform_7_arms", SND_CHANNEL_ANY ); // *TEMPORARY'D* sys.waitFor( $panelClasperBar_2 ); sys.waitFor( $panelMover ); setNewTimes( $panelClasper , .25 , .1 , .1 ); $panelClasper.move( NORTH , 12 ); sys.waitFor( $panelClasper ); } //-- // End Phase 1 //-- //-- // Panel movement on Assembly Line, Phase 2 aweldon Feb 05 // Riveting! //-- void movePlateToRivet( entity panel ) { // Set new times setNewTimes( panel , 5 , 0 , 1 ); // Move panel.move( NORTH , 344 ); sys.wait( 3 ); // Eventually slow the conveyor belt. //thread conveyorEvent(); // Set initial times setNewTimes( $rivetHold , 2 , 1 , .5 ); // Move down to grab plate $rivetHold.move( DOWN , 128 ); sys.waitFor( $rivetHold ); sys.waitFor( panel); } void plateImpact( entity panel ) { // secondary motion for impacts on panel piece. setNewTimes( panel , .05 , 0 , 0 ); panel.move( DOWN , .25 ); sys.waitFor( panel); panel.decelTime( .05 ); panel.move( UP , .25 ); sys.waitFor( panel); } void smashySmashy( entity spark1 , entity spark2 , entity spark1A , entity spark2A , entity panel) { // Threaded function for the hammering motion and sparks and mayhem. // Set time for punchinating $rivetPunch.time( .05 ); // Make the punches and fire spark shower for first position $rivetPunch.move( DOWN , 12 ); sys.waitFor( $rivetPunch ); thread plateImpact( panel ); sys.trigger( spark1A ); $rivetPunch.move( UP , 12 ); sys.waitFor( $rivetPunch ); sys.wait( .1 ); $rivetPunch.move( DOWN , 12 ); sys.waitFor( $rivetPunch ); thread plateImpact( panel ); sys.trigger( spark1 ); $rivetPunch.move( UP , 12 ); sys.waitFor( $rivetPunch ); // Set time to move to new position setNewTimes( $rivetPunch , .25 , .1 , .1 ); // Move to position for second set of punches $rivetPunch.move( EAST , 42 ); sys.waitFor( $rivetPunch ); // Set time for punchination $rivetPunch.time( .05 ); // Make the punches and fire spark shower for second position $rivetPunch.move( DOWN , 12 ); sys.waitFor( $rivetPunch ); thread plateImpact( panel ); sys.trigger( spark2A ); $rivetPunch.move( UP , 12 ); sys.waitFor( $rivetPunch ); sys.wait( .1 ); $rivetPunch.move( DOWN , 12 ); sys.waitFor( $rivetPunch ); thread plateImpact( panel ); sys.trigger( spark2 ); $rivetPunch.move( UP , 12 ); sys.waitFor( $rivetPunch ); // Re-Set time to move to new position to move with $rivetExtend in another function setNewTimes( $rivetPunch , .5 , .25 , .25 ); } void rivetSmash( entity panel ) { // Set times setNewTimes( $rivetArm , 1 , .25 , .25 ); setNewTimes( $rivetExtend , .5 , .25 , .25 ); // Bind plate to first piece panel.bind( $rivetHold ); // Set new times and raise up to be pokinated setNewTimes( $rivetHold , 2 , .5 , .5 ); $rivetHold.move( UP , 64 ); $rivetHold.rotateOnce( '0 90 0' ); sys.wait( 1 ); // Trigger the alarm light and move the rivet puncher into place sys.trigger( $rivetArm_light ); $rivetArm.move( NORTH , 98 ); sys.waitFor( $rivetArm ); // Extend, extend! $rivetExtend.move( WEST , 48 ); sys.waitFor( $rivetExtend ); // Hammer time smashySmashy( $convSpark_1 , $convSpark_2, $convSparkB_1 , $convSparkB_2 , panel ); // Retract arm and move to next punch position $rivetPunch.move( WEST , 42 ); $rivetExtend.move( EAST , 48 ); sys.waitFor( $rivetExtend ); setNewTimes( $rivetArm , .25 , .1 , .1 ); $rivetArm.move( SOUTH , 68 ); sys.waitFor( $rivetArm ); // Extend, extend! $rivetExtend.move( WEST, 48 ); sys.waitFor( $rivetExtend ); // Hammer time 2 smashySmashy( $convSpark_3 , $convSpark_4, $convSparkB_3 , $convSparkB_4, panel ); // Retract arm $rivetPunch.move( WEST , 42 ); $rivetExtend.move( EAST , 48 ); sys.waitFor( $rivetExtend ); // Return arm to start position and turn off annoying light setNewTimes( $rivetArm , 1.5 , .5 , .5 ); $rivetArm.move( SOUTH , 30 ); // Lower panel piece back to conveyor belt $rivetHold.move( DOWN , 64 ); $rivetHold.rotateOnce( '0 90 0' ); //turn light off at the appropriate time sys.waitFor( $rivetArm ); sys.trigger( $rivetArm_light ); sys.waitFor( $rivetHold ); panel.unbind(); // Raise holding piece to original position setNewTimes( $rivetHold , 2 , .5 , 1 ); $rivetHold.move( UP, 128 ); $rivetHold.rotateOnce( '0 -180 0' ); } //-- // End Phase 2 //-- //-- // Panel movement on Assembly Line, Phase 3 aweldon Feb 05 // Crushing! //-- void movePlateToLift( entity panel ) { // Move to lift setNewTimes( panel , 6 , 1 , 1 ); panel.move( NORTH , 384 ); sys.waitFor( panel); // Bind plate to lift panel.bind( $crushinatePlat ); // Wait and allow time for the player to move onto the lift sys.wait( 3 ); // Move lift up for Crushination setNewTimes( $crushinatePlat , 3 , 1 , 1 ); $crushinatePlat.move( UP , 192 ); sys.waitFor( $crushinatePlat ); panel.unbind(); /* // Wait to let Player clear, ominously lower crushinator. setNewTimes( $crushinator , 1 , .5 , .25 ); $crushinator.move( DOWN , 16 ); sys.waitFor( $crushinator ); // Wait a tick longer sys.wait( 1 ); // Crushinate! setNewTimes( $crushinator , .25 , .25 , 0 ); $crushinator.move( UP , 16 ); sys.waitFor( $crushinator ); setNewTimes( $crushinator , .5 , .5 , 0 ); $crushinator.move( DOWN , 124 ); sys.waitFor( $crushinator ); sys.trigger( $speaker_crusher ); sys.wait( 1 ); // Move crushinator back up setNewTimes( $crushinator , 2 , .5 , .5 ); $crushinator.move( UP , 124 ); */ sys.wait( 1 ); // Move Plate panel.move( WEST , 384 ); sys.wait( 1 ); // Return plat $crushinatePlat.move( DOWN , 192 ); sys.waitFor( $crushinatePlat ); sys.waitFor( panel ); } //-- // End Phase 3 //-- void hackPlateBack( entity panel ) { // Make sure the plate gets where it needs to go to re-start the process. panel.restorePosition(); } void eachPanel( entity panel ) { // Full cycle for each panel piece // start the belt lights going //sys.println( "belt lights 1 on" ); // sys.trigger($belt_lights_on_1); // sys.wait(1); // sys.println( "belt lights 2 on" ); // sys.trigger($belt_lights_on_2); // swap the guis out on the door so the player can get out $panel_bad_gui.hide(); $panel_good_gui.show(); startPanel( panel ); clasperMoves( panel ); pressPanel( panel ); flipPanel( panel ); thread returnMover(); movePlateToRivet( panel ); rivetSmash( panel ); movePlateToLift( panel ); thread hackPlateBack( panel ); } void assemblyLine( ) { //Run multiple panels simultaneously thread start_spinny_lights(); while(1) { thread eachPanel( $convPlate_1 ); sys.wait( 20 ); //was 32, then 25, then 23 thread eachPanel( $convPlate_2 ); sys.wait( 20 ); //was 32, then 25, then 23 thread eachPanel( $convPlate_3 ); sys.wait( 20 ); //was 32, then 25, then 23 } } //-- // END PANEL CYCLE //--