script object doors

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

script object doors

Post 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?
Angex
Major
Posts: 293
Joined: Mon Dec 30, 2002 1:23 pm
Contact:

Post 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).
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

bumpers

Post 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.
Tom Trude,

Image
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

Post 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
fuhrer
Captain
Posts: 253
Joined: Sun Mar 14, 2004 3:36 am

Post 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
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

stop

Post 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.
Tom Trude,

Image
Post Reply