Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
doom-fusion

Elevators

Recommended Posts

script 34 (void)
{
if (floor==1)
{
Polyobj_Move (3, 4, 192, 28)
Delay (70);
Elevator_LowerToNearest (98, 16);
Delay (30);
Polyobj_Move (1, 4, 64, 28);
floor=0;
}
else
{
Polyobj_Move (1, 4, 192, 28);
Delay (70);
Elevator_RaiseToNearest (98, 16);
Delay (30);
Polyobj_Move (3, 4, 64, 28);
floor=1;
}
}


This is the code I am using for an internal elevator switch.

The elevator starts on the first floor with the doors closed. When you hit the switch on the first floor, the doors open after a 30 tic delay. After you enter and hit the switch, the doors close and the elevator ascends after 70 tics. The problem is once it gets to the top,the else statement appears to ignore the second polyobj_move and won't open the doors at the top of the shaft. If you hit the switch again, the doors will move into each other, following the first polyobj_move statement, and then after 70 tics it will descend and the doors at the bottom will open. Everything works properly except the doors at the top.

What am I missing here?

Oh and I forgot to mention that floor 1 is the second floor and floor 0 is the first floor.

Share this post


Link to post

Is this script really compiled? A semicolon is missing after the very first Polyobj_Move. If the script fails to compile, your map might still be using some previous successfully compiled version of that script, instead of this one.

Share this post


Link to post

Then the problem is probably in the upper door itself. Is the polyobject constructed the same way as the lower door one, with all of its identifying numbers (start line polyobject IDs + anchor angles) updated to be unique? Could there be anything physically blocking the door from opening, like a wall or a decorative thing or a monster overlapping the closed door or its opening path? Does it work if you make and trigger an action specifically just to open the door?

Share this post


Link to post

I did try this and it worked. This snippet includes the floor switches. Both versions structured similarly to the elevator code.

int floor;

script 34 (void)
{
if (floor==1)
{
Elevator_LowerToNearest (98, 16);
Delay (105);
Polyobj_DoorSlide (1, 4, 64, 28, 105);
floor=0;
}
else
{
Elevator_RaiseToNearest (98, 16);
Delay (105);
Polyobj_DoorSlide (3, 4, 64, 28, 105);
floor=1;
}
}

script 35 (void)
{
Elevator_MoveToFloor (98, 16);
Delay (105);
Polyobj_DoorSlide (1, 4, 64, 28, 105);
floor=0;
}


script 36 (void)
{
Elevator_MoveToFloor (98, 16);
Delay (105);
Polyobj_DoorSlide (3, 4, 64, 28, 105);
floor=1;
}

This was the original setup that I used, but the problem I ran into was the lift can function whether the doors are open or not. I used the previous code to allow the doors to only go one way, adding a delay which prohibits the elevator movement until it is closed. It does the same with door opening, not opening the door until the elevator stops moving. My issue with door slide is the delay which allows it to close. I wanted to make the door close wait until the player hits a switch and to open when the elevator stops at each floor.

Share this post


Link to post

Nothing seems to be blocking the door, it exists almost by itself, opening into a visual portal and a linedef set as a silent teleporter. I did set the linedef facing the inside of the elevator with the Polyobj_DoorSlide special and that seems to work just fine.

Would having both the upper adn lower doors within the same container sector be an issue? They don't intersect each other and there is at least 16 pixels between the sets.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×