Page 1 of 1

script object doors

Posted: Wed May 05, 2004 10:52 pm
by fuhrer
ive got some doors that are opened and closed with script (they start closed), but heres what i need, if a player blocks the doors (trigger multiple) the doors must move back to their open position, how can i do this without adding 16 waypoints?

Posted: Thu May 06, 2004 9:08 pm
by Angex
It really depends on how the doors are implemented.

If there is a trigger multiple in the doorway, if it is tripped while the door is changing position just rotate the door back to its original position. Easily done if you're using the rotate commands, and you devise a way to store the doors state (I'm assuming you've already done this, so that you can determine when the door should open or close).

bumpers

Posted: Thu May 06, 2004 9:48 pm
by tltrude
If they are scripted doors, it would be hard because the script will have to know how far they have traveled, to know how far they must return. If they were func_doors you could just tell them to "open" while a player istouching the left or right bumper triggers.

Posted: Thu May 06, 2004 9:50 pm
by fuhrer
it is a sliding door, told to moveWest however far, and its binded to a lift, which i think rules out waypoints ? i did try making a variable at the start of the script to tell where there doors starting position is, but that didnt seem to work

i also tried moveto ((this.origin[0]) (this.origin[1]) (that.origin)) but that caused the door to float away

Posted: Thu May 06, 2004 9:56 pm
by fuhrer
cant bind func_doors to a moving object? last time i did that they floated away, so i got no chance but to make them a script object

stop

Posted: Fri May 07, 2004 10:54 pm
by tltrude
The command "stop" will make a moving script object stop moving. So, you could do something like this.

$door_left stop
$door_right stop

$door_left moveto $door_left_origin
$door_left move

$door_right moveto $door_right_origin
$door_right waitmove

You would have to bind the two script_origins to the elevator. The triggers would also need to be bound to the doors and very thin so a player could not touch them with the doors closed.

The whole thing would have to be in a while loop so the door will open when one of the triggers is touched. It would have to wait and then try to close them again.