Source Mapping, Materials, Modeling and Code tutorials.
Main Custom Files All Downloads Search all TutorialsSearch all Tutorials
Hosted by GBC Game Design program
Check out more Source tutorials at City 7: Toronto Conflict
 

Printer Friendly

Ladders



Note: In Hammer 4 you can create ladders with the HL2 Prefabsimple_ladder”.
If you are mapping for CS:S the ladder system is not the same as HL2.
On this Valve Developer wiki page I've created serveral ladders for CS:S.

In this tutorial we’re going to:
1) Use a Static ladder model from HL2.
2) Turn it into a ladder that Players and NPCs can use.

The first thing I’ve done is place the model for the ladder I’m going to use.
As you probably know it’s only good for looking at once we place it, players won’t be able to use it yet.



When you use models for your ladders make them prop_static and adjust the properties setting “Collisions” to “Use VPhysics” if you want to use physics for the ladder as it looks, “Use Bounding Box” if you want to block off the area around the ladder (the yellow frame you see when the model is selected in Hammer) or best yet for most ladder models “Not Solid” which means the Player and other physics can go right through it.

The following are the settings for the model I’m using for this tutorial:
Class: prop_static
World Model: models/props_c17/metalladder002.mdl
Collisions: Use VPhysics
Disable Shadows: No

We could create this same ladder without any model at all, for example to allow players to climb up the side of Trash dumpsters.

The entity we are going to create next is a func_useableladder.
1) Click the Hammer Entity tool.
2) On the right side of Hammer select:
Categories: Entities
Objects: func_useableladder
3) With your 2D view ports place the func_useableladder where you want it.
4) You should see a large red rectangle.
5) Expand one of the small white circles in the 2D view ports until you have stretched out the func_useableladder. The size of your ladder will be determined by the two red blocks. Make the bottom block flush with the ground but extend the top one a little above the height of your ladder.

Note: Raise the top block above the highest stepping plane if you want the player to be able to face the ladder and climb back down, lower it some if you want to force the player to turn and climb down, up to you.





Notice that the func_useableladder is not over the ladder model.

Now we need to place a few info_ladder_dismount entities.
These are used to create Enter and Exit points for your ladder.
Use the Entity tool and place these at each end of your ladder where the player will be entering and exiting.




Select the func_useableladder and give it a name. (Ladder1)

Left-Click one of the info_ladder_dismount’s and then hold down Ctrl and left-click on the other info_ladder_dismount’s until all of them are selected. (You can do the same thing with the Map, Entity Report tool from the top toolbar.)

Once they are all selected press Alt+Enter to bring up the common properties for these.
Change “LadderName” to “Ladder1”, the name of our func_useableladder and Apply.

Run your map and go test the new ladder.

Your ladder should already be working perfectly with the few steps it took here.
Experiment with the placement of your info_ladder_dismount’s and the position of your func_useableladder. It really is simple so if you’re having trouble just delete them and start over, it may be easier, especially at times when the points for a func_useableladder can mess up in Hammer, when that happens it may be a lot quicker to recreate them.

There are a few things we can do to our ladder.
1) Create Player clips so they don’t get hung-up on the ladder.
Here’s a tutorial on creating those: Player Clips
2) Create sounds for our ladder.

The sounds can be a nice touch but you’re somewhat limited in that while we can play a sound when the player is going up or down I haven’t found a way to know if the player stopped moving on the ladder. Like the Fast Moving Zombies rushing up a pipe in Ravenholm you can safely play a sound while the Zombie is on the pipe, just use a trigger over the ladder and play the sound you want every 0.4 seconds.

Once you’ve created a few HL2 ladders you’ll have the hang of it.


There’s a lot more you can do, I hope I’ve stimulated your imagination.Smile

  DownloadThe example used in this tutorial.





Valve, the Valve logo, Half-Life, the Half-Life logo, and the Lambda logo are trademarks and/or registered trademarks of Valve Corporation Site.