Choosing Player Models

From Valve Developer Community
(Redirected from .kv)
Jump to: navigation, search
Choosing Player Models
Counter-Strike: Global Offensive Level Creation
See KeyValues for the file format.

In Counter-Strike: Global Offensive Counter-Strike: Global Offensive, custom maps can be configured to use different player models, or a variety of player models, for the Terrorist and Counter-Terrorist teams. These models are specified in a <mapname>.kv file that lives in the csgo/maps/ directory.

Creating a .kv file

		"tm_anarchist" ""
		"tm_anarchist_variantA" ""
		"tm_anarchist_variantB" ""
		"tm_anarchist_variantC" ""
		"tm_anarchist_variantD" ""
		"ctm_swat" ""
		"ctm_swat_variantA" ""
		"ctm_swat_variantB" ""
		"ctm_swat_variantC" ""
		"ctm_swat_variantD" ""
If this is the content of csgo/maps/de_example.kv, then
de_example.bsp will use Anarchist and Swat player models.

The .kv file is simply a text file that shares a name with the map, with the .txt extension changed to .kv. For example, if there were a custom map called de_example.bsp in the Counter-Strike Global Offensive/csgo/maps/ folder, then there should be a file called de_example.kv in the same folder.

The .kv file contains a list of key/value pairs formatted similarly to other text files used by the source engine, such as VMT files for materials.

As can be seen in the example on the right, it is possible to configure a map to use a variety of world player models for each team. Unlike in previous Counter-Strike games, the player's model is chosen randomly from this list, instead of allowing the player to choose.


See the example on the right. The first word in quotes must be the map's filename.

The key of each KeyValue inside "t_models" and/or "ct_models" is supposed to be the path to a player model. If <model> is such a key, then the game will try to use the first of the following models that exists:

  1. csgo/models/player/custom_player/legacy/<model>.mdl
  2. csgo/models/player/<model>.mdl
  3. csgo/models/error.mdl

The value of each of these KeyValues is ignored, so it can be left empty.

Tip.png Tip: Use the Hammer model browser to see the available models at those places. You can also see below for lists to copy-paste.
Tip.png Tip: Generally, there can be any number and any combination of player models in a list.
Tip.png Tip: If there are huge error boxes moving around the map, then you probably have misspelled at least one player model name.
Note.png Note: Since the glove update, it's unnecessary to define the arms model, the engine uses the sleeve model instead.

Relation to Gamemodes.txt

The information of this file will to some extent be merged with csgo/gamemodes.txt. The official maps don't have a csgo/maps/<mapname>.kv file as their content is already in gamemodes.txt. The map list in that file can be extended with gamemodes_server.txt according to the following example.

Warning.png Warning: Information in these files overrides any map specific csgo/maps/<mapname>.kv file!
		// ...

		// ...

				// ...
				// ...

				// ...
				// ...

		// ...
Clarify: The official maps use more KVs than just t_models and ct_models. Apparently, the nameID determines the displayed map name in the loading screen, however this KV does not seem to work in <mapname>.kv? So where is the map specific file <mapname>.kv read in code? Ideas:
  • void GameTypes::AddMapKVs( KeyValues* pKVMaps, const char* curMap )
  • void GameTypes::CheckShouldSetDefaultGameModeAndType( const char* szMapNameFull )
Both are defined in gametypes.cpp. In both cases it should actually be possible to ship more KVs with this file but apparently it isn't.[Why?]

Model List

These excerpts are set up so that one block represents a commonly used group of models.

The other custom player models can also be used. In the lists below, they are named but commented out (//) to retain a commonly used group of models.

Tip.png Tip: You can use T models for CTs and vice versa! The models have nothing to do with the team of a player with one of these models.
Note.png Note: The model of a player also determines the arms seen for the viewmodel, as well as the radio command voice. However, it will not make the player use the appropriate radio voice of the assiciated agent (e.g. no female voice this way).

Counter-Terrorist Models

FBI English
//		"ctm_fbi_variantE"""
//		"ctm_fbi_variantF"""
//		"ctm_fbi_variantG"""
//		"ctm_fbi_variantH"""
GIGN Français
GSG9 Deutsch
IDF עִברִית
		"ctm_sas""" // identical to A-E?
//		"ctm_sas_variantF"""
//		"ctm_sas_variantG"""
SEAL Team 6 English
//		"ctm_st6_variantE"""
//		"ctm_st6_variantG"""
//		"ctm_st6_variantI"""
//		"ctm_st6_variantJ"""
//		"ctm_st6_variantK""" // German
//		"ctm_st6_variantL"""
//		"ctm_st6_variantM"""
//		"ctm_st6_variantN""" // Brazilian
SWAT English
//		"ctm_swat_variantE"""
//		"ctm_swat_variantF"""
//		"ctm_swat_variantG"""
//		"ctm_swat_variantH"""
//		"ctm_swat_variantI"""
//		"ctm_swat_variantJ"""
//		"ctm_swat_variantK"""

Terrorist Models

Anarchist English
//		"tm_balkan_variantF"""
//		"tm_balkan_variantG"""
//		"tm_balkan_variantH"""
//		"tm_balkan_variantI"""
//		"tm_balkan_variantJ"""
//		"tm_balkan_variantK"""
//		"tm_balkan_variantL"""
Elite Crew
//		"tm_leet_variantF"""
//		"tm_leet_variantG"""
//		"tm_leet_variantH"""
//		"tm_leet_variantI"""
//		"tm_leet_variantJ"""
//		"tm_leet_variantK"""
Phoenix Connexion
//		"tm_phoenix_variantF"""
//		"tm_phoenix_variantG"""
//		"tm_phoenix_variantH"""
//		"tm_phoenix_variantI"""
Professional English
//		"tm_professional_varF"""
//		"tm_professional_varF1"""
//		"tm_professional_varF2"""
//		"tm_professional_varF3"""
//		"tm_professional_varF4"""
//		"tm_professional_varF5"""
//		"tm_professional_varG"""
//		"tm_professional_varH"""
//		"tm_professional_varI"""
//		"tm_professional_varJ"""
Separatist Français Español

Other Models

Note.png Note: Giving players the model of a Heavy Phoenix or a Heavy CT changes only their appearance; it does not give them an item_heavyassaultsuit.
Heavy Phoenix
Heavy CT
(CS:GO Co-op Strike Co-op Strike)
(CS:GO Danger Zone Danger Zone)
(OpRiptide.pngOperation Riptide)
Gendarmerie Nationale Français
(OpRiptide.pngOperation Riptide)
Guerrilla Warfare
(OpRiptide.pngOperation Riptide)

External Links

KV File Writer: A gui tool that streamlines setting up and saving a CT vs T .kv

Web-based KV File Generator: A web-based utility that generates a .kv based on user input.