Door trigger blunder

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Killerdude
Sergeant Major
Posts: 110
Joined: Fri May 11, 2007 12:16 am

Door trigger blunder

Post 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
neillomax
Lieutenant General
Posts: 880
Joined: Thu Jun 23, 2005 6:57 am

Post 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.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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.
Image
Post Reply