Sliding Doors ?


(Mark.C) #1

I know this has been asked before, i have searched for 2 days here now to no avail…

How do you make a door slide to one side, instead of it rotating ? AND is it possible to have the doors slide in opposite directions, triggered by a player BEFORE they walk through it?

I have seen a tutorial on these forums showing this, or a link to one, but im miffed if i can find it :frowning:


(carnage) #2

func_door does this… but if you want more control over your doors then use script_movers

the script is pretty simple and even to add more complex things in doesnt make it too hard ither

EDIT/ also to trigger by a player walking through it, just make a trigger mulltiple at both sides of the door and make that target your section of the script that opens the door script

ill try post a script up l8a


(carnage) #3

k double post put what the heck


//this is the part of the script looking after the left door
left_door
{

// run this when the door is opened
trigger open
{

// the script may be in the wait section already and so close too early this will stop and force the script to restart
halt

//set the left door to open
gotomarker (the open postion marker name)

//make the script wait before closing the door, here we have 3 secodns
wait 3000

//close the doors again
gotomarker (the closed position marker name)

}

}


//the same script but this time for the right door
right_door
{

// run this when the door is opened
trigger open
{

// the script may be in the wait section already and so close too early this will stop and force the script to restart
halt

//set the right door to open
gotomarker (the open postion marker name)

//make the script wait before closing the door, here we have 3 secodns
wait 3000

//close the doors again
gotomarker (the closed position marker name)

}

}

here is a more complex version that has a variable controling if the door is locked or not


//this is the part of the script looking after the left door
left_door
{

// run this when the door is opened
trigger open
{

//this will only run the script if the door is open
accum 1 abort_if_greater_than 0

// the script may be in the wait section already and so close too early this will stop and force the script to restart
halt

//set the left door to open
gotomarker (the open postion marker name)

//make the script wait before closing the door, here we have 3 secodns
wait 3000

//close the doors again
gotomarker (the closed position marker name)

}


//lock the door
trigger lock
{

//set the variable use to check to see if door is locked to the locked position
accum 1 set 1

//set the doors to close stright away when lock is activated
gotomarker (the closed position marker name)

}


//open the door
trigger open
{
//set the variable use to check to see if door is locked to the open position
accum 1 set 0
}


}


//the same script but this time for the right door
right_door
{

//this will only run the script if the door is open
accum 1 abort_if_greater_than 0

// run this when the door is opened
trigger open
{

// the script may be in the wait section already and so close too early this will stop and force the script to restart
halt

//set the right door to open
gotomarker (the open postion marker name)

//make the script wait before closing the door, here we have 3 secodns
wait 3000

//close the doors again
gotomarker (the closed position marker name)

}

//lock the door
trigger lock
{

//set the variable use to check to see if door is locked to the locked position
accum 1 set 1

//set the doors to close stright away when lock is activated
gotomarker (the closed position marker name)

}

//open the door
trigger open
{
//set the variable use to check to see if door is locked to the open position
accum 1 set 0
}

}

if you read you will see that there are three main areas of the script that you must target from your mat for it to work effectively

the open, to open the doors
the lock, to stop the doors opening
the open, to re open the doors when locked

there are bound to be errors in an untested script and if anyone can see them plz post


(Mark.C) #4

So for the first script all i have to do is set up 2 gotomarker entities, with the appropriate names for each door ?

#Can you not just make either door slide by changing the angle the door opens ?

#Can the doors be opened by a trigger multiple, using the gotomarkers, with the first script ?


(EB) #5

If you use a normal func_door entity value on a brush, it will do just what you’re asking for. Within the entities menu you can adjust its speed. Also these doors are easily opened when shot at while set with the allowteams option, activated or even targeted by a func_mult but with a wait applied.
Remember there is a func_door(slide) and func_rotating_door(hinged).
FUNC-DOOR:


-------- KEYS --------
"key" -1 for locked, key number for which key opens, 0 for open.  default '0' unless door is targeted.  (trigger_aidoor entities targeting this door do /not/ affect the key status)
"model2" .md3 model to also draw
"angle" determines the opening direction
"targetname" if set, no touch field will be spawned and a remote button or trigger field activates the door.
"speed" movement speed (100 default)
"closespeed" optional different movement speed for door closing
"wait" wait before returning (3 default, -1 = never return)
"lip" lip remaining at end of move (8 default)
"dmg" damage to inflict when blocked (2 default)
"color" constantLight color
"light" constantLight radius
"health" if set, the door must be shot open
"team" team name.  other doors with same team name will open/close in syncronicity
"type" use sounds based on construction of door
-------- SPAWNFLAGS --------
TOGGLE wait in both the start and end states for a trigger event.
START_OPEN the door to moves to its destination when spawned, and operate in reverse.  It is used to temporarily or permanently close off an area when triggered (not useful for touch or takedamage doors).
-------- NOTES --------
sound types:
     0 - nosound (default)
     1 - metal
     2 - stone
     3 - lab
     4 - wood
     5 - iron/jail
     6 - portcullis
     7 - wood (quiet)

If you explain in specific ideas what you would like, then our approach to solving this would be just as specific. What how when where why maybe even who. Variables can range from easy to slightly complex.


(Mark.C) #6

2 sliding doors, both sliding in opposite directions, opened by the use function.


(.Chris.) #7

thats easy.

make 2 func doors next to each other then with angle key make them open in opposite directions, EG: one door angle 360 the other door angle 180 , then add the following key/value to each door. Key: team Value: sliding door
if wanted additional doors to open at same time as these doors just add the team/sliding door to the extra doors, if want a speperate set of sliding doors just use another value for the key team.


(Ifurita) #8

The problem i’ve had with that is that the doors don’t necessarily open in tandam, especially if you approach them along one of the walls


(carnage) #9

i have also had probelms like that with func_doors thats why i was so keen to use script_movers


(SCDS_reyalP) #10

Thats what teamed doors are for. If that doesn’t work, ignore me :stuck_out_tongue: (i’ve used teamed rotating doors, but I’m not sure I’ve tried sliding doors.)

The original poster seems to want one that that is triggered by a trigger brush, which may make teems unnecessary anyway. I do recall that you need some extra entities to lock/unlock them, or did in RTCW.