Page 1 of 1

Rotating Door Upwards ?

Posted: Mon Mar 19, 2007 8:30 pm
by *GCC*Nigel
I tried to make a func_rotating door open upwards, like the foot rest on a reclining chair, but it didn't work. I looked at tltrude's door map, and couldn't find the type I was looking for. If it is possible to do, can you then get it to launch a player as well?

Cannon

Posted: Tue Mar 20, 2007 2:27 am
by tltrude
My "explodingdoor" tutorial map has a cannon that shoots players into the air.

Image

Also, there is a manhole elevator, in the doo2 map, that is made from a func_door. If you set the time lower (0.2) and stood on top, it would probably launch you into the air.

http://gronnevik.se/rjukan/index.php?n= ... veElevator
Image

You can also change the speed of the trap door. But, you have to use the script because func type doors will not rotate up or down.

Posted: Wed Mar 21, 2007 12:05 am
by *GCC*Nigel
So I can't make something like the trapdoor up from the kitchen in Door2, but going the other way? It's not necessary that it launches the player, but it'd sure be cool if it did...

trap door

Posted: Wed Mar 21, 2007 3:19 am
by tltrude
To make it go the other way, just move the red "origin" textured brush to the other side. The origin brush is the hinge point of the script_object door.

It is not a func_door, its a script_object entity with a targetname and a trigger. When a player uses the trigger, a thread in the script rotates the door entity around its origin -- the center of the origin brush.

Here are all the script lines that make the trap door work.

//=============================================

main:

level waitTill prespawn

$trap_door movedown 64 // door moved up for lighting edges
$trap_door move

thread trap_door_mover // start the thread named "trap_door_mover".

level waittill spawn

end

//------------------------------------------
// trap_door
//------------------------------------------

trap_door_mover:

$trap_door_trigger waittill trigger // script waits until a player uses the trigger.
$trap_door time 2 // time it takes to open or close in seconds ( can be a fraction of a second, like 0.2).
$trap_door playsound ("door_wood_open_move" + (randomint(3) + 1))
$trap_door rotateXup 90 // rotate the door up 90 degrees on the x axis.
$trap_door waitmove // script wait here until it has moved.
$trap_door playsound door_wood_open_stop
wait 20 // seconds
$trap_door playsound ("door_wood_close_move" + (randomint(1) + 1))
$trap_door rotateXdown 90 // rotate the door down 90 degrees on the x axis
$trap_door waitmove // script wait here until it has moved
$trap_door playsound ("door_wood_close_stop" + (randomint(2) + 1))

goto trap_door_mover // go back to the start of the thread and wait for another trigger event

end

//=============================================

Note: If you change the speed (time), the sounds will not work right because they take 2 seconds to play. But, there are other sounds you can use.

Posted: Sun Apr 29, 2007 8:24 pm
by *GCC*Nigel
Just an add on thought, how did the door on the axis side of malta work? It's the kind of Thing I was trying to do. It opened upwards trapdoor-like. The thing I need needs the origin rotated 90 degreese so the door ends up horizontal starting vertical (downwards).

Posted: Mon Apr 30, 2007 10:31 am
by bdbodger
Like tltrude said you can't do that with a door . func rotatingdoors only rotate on the yaw axis and func doors only slide up,down,left or right , the only way to do what you want is to make a script object by making two brushes one of which has the origin texture on it and then making them a script object then using rotation commands .

Malta

Posted: Mon Apr 30, 2007 11:31 am
by tltrude
Sorry, I don't have Spearhead installed. If I did, I would look at the script for Malta to see if it is a scripted trapdoor -- it might be a "gag" or "global" script.

Posted: Mon Apr 30, 2007 11:39 pm
by *GCC*Nigel
I looked at it and it's nearly identical to yours except the move down is only 8. The origin on your door does not reach both ends, is there a reason for that? I tried a door with the hindge down, even with the door, and the hindge is unrealistic, which I understand, but why is it shorter?

origin

Posted: Tue May 01, 2007 3:40 am
by tltrude
The center point of the origin brush is used to change the origin point of the door brush. So, the shape of the origin brush does not matter -- only its center point matters.