Player Rendering
Starting with v8.0, Mapbase adds a few new features which allow the player’s model to appear in first-person.
💡 Tip: In Half-Life 2, the player's model can be set through the Protagonist System.
Showing the player externally
By default, the player is completely invisible to itself, even in mirrors or on cameras. You can allow the player to appear in these views through one of the following methods:
- Using the
SetPlayerDrawExternallyinput onlogic_playerproxy.- (Use this method if you are making a single map)
- Adding
player_default_draw_externally 1togameinfo.txt.- (Use this method if you are making an independent mod)
- Setting
cl_playermodel_draw_externally_overrideto1in-game.- (Use this method for debugging or for giving the player a customizable option)
Showing the player’s legs
You can draw legs beneath the player’s camera through one of the following methods:
- Using the
SetPlayerDrawLegsinput onlogic_playerproxy.- (Use this method if you are making a single map)
- Adding
player_default_legs 1togameinfo.txt.- (Use this method if you are making an independent mod)
- Setting
cl_playermodel_legs_overrideto1in-game.- (Use this method for debugging or for giving the player a customizable option)
The code automatically positions the model and hides bones based on data from the model’s QC keyvalues. This covers most conventional human models already, but if you need to hide more bones or change the camera’s position, see Mapbase’s model sources; the keyvalues block for playermodel data cam be seen here, with the associated bone list transcluded from here.
