Ladders
Ladders in Source games are more complex than those of earlier games, but they provide better control for the level designer and player alike. Ladders in Counter-Strike: Source are implemented differently than those in Half-life 2 and other mods. See below for Counter-Strike: Source ladder implementation.
Half-Life 2/DM Method
To create a ladder you must define the volume in which the player will move through space while on the ladder. This includes a starting and end position. The volume is described via the func_useableladder
entity. The entity has two positions: a starting point and an ending point (See Fig. 1a) . These can be typed into the key-value fields, or more typically the ladder can be defined by using the visual ladder tool, visible when the entity is selected (it's the center circle) (See Fig. 1b) . Using this tool you can drag the start and end point of the ladder into appropriate positions in the 2D view. The ladder's start and ending point may be of arbitrary orientation and length (See Fig. 1c). Simply pull the endpoints where you want them and the player will move between these points while on the ladder. Watch out that the ladder volume does not touch any models or brushes otherwise it will not be usable.
The ladder's volume must be clear of obstructions. If a solid brush surfaces passes through the space you define, the ladder may not be climbable.
Along with the volume of movement, the ladder also needs "dismount" points (See Fig. 1d). These points are defined using the info_ladderdismount
entity. These are markers in space that define where a player can exit a ladder from. They are most easily thought of as hints to good positions to place the player in. When a player reaches the top or bottom of a ladder, the code attempts to find the nearest dismount point to where the player is standing and in the direction the player is looking. If there is a dismount point within a certain threshold tolerance, the player will automatically dismount the ladder and move onto that dismount point. The entity has a keyvalue field called LadderName which holds the name of the ladder it is used by. Like the ladder volume, the dismount points must be free of obstruction and allow the player to stand at their position without intersecting solid world geometry.
Generally these are best placed around the base of the ladder from center, left and right.
Testing
Once the func_useableladder
entity and its info_ladderdismount
points have been placed, you can compile your map and test them. Using the sv_showladders
console command, you can cause the engine to draw debugging information about the ladder system (Note: You'll have to restart a map if one is already running when you enable this console command). This information will show you the start and end points of the ladder, as well as the dismount points (See Fig. 2a).
If any of these entities is not setup properly (commonly due to interpentration with solid world geometry or the prop model of the ladder itself), it will display this. (See Fig. 2b).
Counter-Strike: Source Method
To create a ladder for CS:S, create a prop_static with a ladder model (props_c17). You can also create a brush-based ladder using a simple brush and a ladder texture. In front of the object/brush you want to be climbable, create another brush as close as you can to it, but without touching. Make sure the face is the same width/height as the climbable object. Assign the material tools/toolsinvisibleladder to this brush and then hit CTRL+T to create an entity. Select func_ladder from the Object Properties dialog. You now have a climbable face which is in front of the object/brush. This gives the illusion that you are climbing the model ladder, where in fact you are scaling the invisible ladder entity just in front of it.
File:Cssladderprop01.png Counter-Strike: Source ladder |
In the image above you can see the (static) prop ladder placed against a brush.
In front of the prop ladder is the func_ladder textured with tools/toolsinvisibleladder.
- There are 5 types of ladders for CS:S in this example: LaddersCSS.zip (7k)
- While on a ladder in CS:S you will not be able to shoot other players.