Page 1 of 1

Door trigger blunder

Posted: Fri Feb 08, 2008 12:05 am
by Killerdude
Just when I thought I had it, my script crashed MOHAA hard !!!

I have a gate that lifts up and down by a lever. It worked great when I tried it. When showing a friend he tried blocking the door (actually he tried to die from the spikes on the bottom as it closed). Blocking the door screwed up the script some how. Does anyone have an idea?

Code: Select all

activate_gate_switch:

	local.gatestatus = 0

	while (1){
	$gate_trigger waittill trigger
	$gate_switch playsound lighthouse_lever

	if (local.gatestatus == 0)
		{
		$gate playsound door_metal_close_move1
		$gate_switch anim move		
		$gate moveup 100
		$gate move
		$gate waitmove

		local.gatestatus = 1}
	else
		{
		$gate playsound door_metal_open_move2
		$gate_switch anim idle
		$gate movedown 100
		$gate move
		$gate waitmove

		local.gatestatus = 0}
	
	} // while(1)
end

Posted: Fri Feb 08, 2008 4:44 pm
by neillomax
Did you try attaching a trigger hurt to the bottom of the door ? Give it health/1000. This will kill instantly when it comes in contact with a bot. Might be all it needs.

Posted: Fri Feb 08, 2008 8:57 pm
by jv_map
Add 'waitframe' above
} // while(1) .

Additionally, doesn't 'waitmove' make the thing move by itself? Thus you don't need the 'move' command. In fact the two are alternatives, both make it move but 'waitmove' blocks (i.e. postpones further script execution) until it has stopped moving, whereas 'move' resumes script execution immediately.