View Single Post
  #1  
Old 04-29-2011, 04:03 AM
blackdragonsdg
Dragon
 
Join Date: Dec 2008
Location: Tennessee
Posts: 656
Default switches & levers controlling doors

So I got the bright idea to try to make some various lifts function correctly. I thought this would be fairly simple but I was wrong.

I was testing the following in Vergalid Mines

door 41 = lever at zone in
door 40 = main lift
doors 38 & 39 = ropes for main lift

Initially the main lift and the ropes are in a closed state. Both the lift and the ropes are at the bottom of the shaft.

player.pl
Code:
my $doorstate = quest::isdooropen(40);

sub EVENT_CLICKDOOR
{
	if($doorid == 41 && !$doorstate)
	{
		quest::forcedooropen(38);
		quest::forcedooropen(39);
		quest::forcedooropen(40);
	}
	if($doorid == 41 && $doorstate)
	{
		quest::forcedoorclose(38);
		quest::forcedoorclose(39);
		quest::forcedoorclose(40);
	}
}
When the lever is triggered both the lift and the ropes go into an open state and rise to the top of the shaft. Triggering the lever a second time should cause the lift and ropes to enter a closed state and lower back to the bottom of the shaft.
The problem is quest::forcedoorclose() doesn't seem to be working. Don't know if I used it wrong or if it is actually broken. Any input would be appreciated.
Reply With Quote