main local.name local.origin local.angles local.fusetime local.firetime local.waitmultiplier local.offtime: // + waitmultiplier = longer time between fuse traveling and fire starting (keep below 0.5) local.detonator = spawn script_model targetname ("detonator_field" + local.name) local.detonator model "miscobj/detonator.tik" local.detonator.origin = local.origin local.detonator.angles = local.angles local.detonator notsolid if(level.fieldsonfire != 1) { local.detonator anim idle } if(level.fieldsonfire == 1) { local.detonator anim fire } local.detonatortrig = spawn trigger_use targetname ("detonator_fieldtrig" + local.name) local.detonatortrig.origin = local.detonator.origin local.detonatortrig setsize ( -20 -20 -20 ) ( 20 20 20 ) local.detonatortrig waittill trigger // all 3 field dets are initially waiting here to be triggered local.detonatortrig nottriggerable if(level.fieldsonfire != 1 && level.fieldsonfire != 2) // or == 0 { local.detonator anim fire local.detonator playsound plunger local.player = parm.other local.detonatortrig message ("*** Igniting the fields. ***") local.player iprint ("Once fire is done, the detonators will be disabled for " + local.offtime + " seconds.") level.fieldsonfire = 1 // disable other 2 dets for now if(local.name == "mid") // all dets spawn 3 fuses, but left and right dets' 3rd fuse must wait for 2nd fuse to pass by middle det's coords. 1st fuse goes straight down the range { thread otherdets_animonly left fire // "waitthread" instead of "exec" or "thread", to wait for fire to finish. thread otherdets_animonly right fire waitthread maps/training_mapscripts/firefields.scr::detmid_ignitefields local.origin local.fusetime local.firetime local.waitmultiplier local.offtime } if(local.name == "left") { thread otherdets_animonly mid fire thread otherdets_animonly right fire waitthread maps/training_mapscripts/firefields.scr::detleft_ignitefields local.origin local.fusetime local.firetime local.waitmultiplier local.offtime } if(local.name == "right") { thread otherdets_animonly mid fire thread otherdets_animonly left fire waitthread maps/training_mapscripts/firefields.scr::detright_ignitefields local.origin local.fusetime local.firetime local.waitmultiplier local.offtime } level.fieldsonfire = 2 if(local.name == "mid") { $detonator_fieldtrigleft triggerable // make sure the other dets are triggerable again after fire is done $detonator_fieldtrigright triggerable } if(local.name == "left") { $detonator_fieldtrigmid triggerable $detonator_fieldtrigright triggerable } if(local.name == "right") { $detonator_fieldtrigmid triggerable $detonator_fieldtrigleft triggerable } local.detonatortrig triggerable local.detonatortrig waittill trigger local.detonatortrig nottriggerable } if(level.fieldsonfire == 2) // if one det is already triggered, do anim idle for all 3 dets, then reset the one triggered det. { if(local.name == "mid") { thread otherdets_animonly left idle thread otherdets_animonly right idle } if(local.name == "left") { thread otherdets_animonly mid idle thread otherdets_animonly right idle } if(local.name == "right") { thread otherdets_animonly mid idle thread otherdets_animonly left idle } local.detonator anim idle local.detonator playsound light_switch local.player = parm.other local.detonatortrig message ("*** Resetting the Fire Fields detonators. ***") level.fieldsonfire = 0 } waitframe local.detonator remove local.detonatortrig remove thread main local.name local.origin local.angles local.fusetime local.firetime local.waitmultiplier local.offtime end //////////////////////////////////////////////////////////////////////// otherdets_animonly local.name local.anim: if(local.anim == "fire") { $("detonator_fieldtrig" + local.name) nottriggerable $("detonator_field" + local.name) anim fire $("detonator_field" + local.name) playsound plunger } if(local.anim == "idle") { $("detonator_fieldtrig" + local.name) triggerable $("detonator_field" + local.name) anim idle $("detonator_field" + local.name) playsound light_switch } end