Alright, I said I'd start making some Tutorials so why not start here.
---------------------------------------------------------------------------------------
Ok today we're going to learn how to do a physics (spring) hinged door.
I'll create a small square room with two lights in it.
Inside this test room I'm going to select the brush tool and make a post
or frame for my door to sit against.
Ok now depending on how many doors you want, depends on how many hinges you'll need
so for this example we'll place a double swinging door. To do that we'll select the right
post and right click and select "TIE TO ENTITY" Func_Brush to each one specifically. (
NOT ALL TOGETHER LIKE THIS) or you'll have problems later on.
Now name the left side something, I named mine FrameLeft.
Now name the right side something, I named mine FrameRight.
Now I'm going to place the doors. (When making your doors its a good idea to
make a space between the door and the frame for better performance)
Now Select your doors one at a time.
First door to the left we'll right click and select "TIE TO ENTITY"
Now select Func_Physbox
Name your LEFT door whatever you want. I named mine "door1".
Do the same to the right side.
Right Click, select "TIE TO ENTITY"
Now select Func_physbox
Name your RIGHT door the same as the first except in numerical order to
keep it simple. So mine is door2.
After that we'll select the entity tool and browse through the objects till
we find something called "PHYS_HINGE"
Now place this at the center of the door to the left side.
Now right click your "PHYS_HINGE" and select properties if the window isn't already
up, and edit a couple of lines:
Name: Hinge1
Entity 1: FrameLeft (This is your frame piece it's connected too)
Entity 2: Door1 (This is the door the PHYS_HINGE will be attached too)
Ok now lets take our selected "HINGE1" and drag the center ball to the top of the door.
Ok Now we'll do the same for the other door
select the entity tool and browse through the objects till
we find something called "PHYS_HINGE" Now place this at the center of the door
to the right side.
Now right click your "PHYS_HINGE" and select properties if the window isn't already
up, and edit a couple of lines:
Name: Hinge2
Entity 1:FrameRight (This is your frame piece it's connected too)
Entity 2:Door2 (This is the door the PHYS_HINGE will be attached too)
Ok now lets take our selected "HINGE2" and drag the center ball to the top of the door.
Awesome so we have hinged doors, now comes the spring part. STAY WITH ME !
Go to your Entity Tool, browse through the objects till you get something called "PHYS_SPRING"
and place this in the center of the left door.
Now were going to right click and select Properties if the window isn't up and edit a couple of lines
Name:Spring1 (What I named my Phys_Spring)
Entity 1:Door1 (Left Door)
Entity 2:Door2 (Right Door)
Spring Constant: 900 (This is the stiffness of the spring, play around with it to find what number suits you.)
exit this window (Always remember to hit Apply)
Now drag your ball across the left door to the center of the right door
IF your really motivated, you can set up individual springs for each door side, but this is a great start.
Now you should have something that looks like a room and a couple of doors.
Place your info_player_start or your spawn entity (I'm using ZPS for my example) So I'll place 1 Info_Player_Human
and 1 Info_Player_Zombie. (This is important if you want to explore your map)
Now make sure you have no leaks or anything and hit F9. Shortly after a screen to compile your map should appear.
I select Normal for all, choose what you wish if you know the difference.
and click "OK"
A screen like this should appear and hopefully with no errors.
Either load up your map upon completion by going to your game and selecting create server
then select your map (Mine is saved as "PhysHingeTutorial" ) or set the run map when completed option after compiling.
If you've ever wondered how to test your map (ZPS specifically) open your developer console
using the "~" tilde key below the ESC button in the upper left of your
keyboard.
In the console type Sv_testmode 1 for THEN select F1 or F2 for human or zombie.
Type Kill in the console if your want to reselect.
Type Sv_cheats 1 then type NOCLIP to fly around your map if you wish.
I hope you enjoyed my tutorial, and if you did I'll look forward to making more.
If you have any questions email me. Youlostchris@gmail.com
Here's the link to the Hammer/ZPS Map example that I made for this if you need more help.
http://www.filefront.com/15555665/SwingingDoors.rarPlease do not redistribute without credit + permission thanks
----------------------------------------------------------------------------------------------
Let me know what you guys think.