Converting Maps

From Pragma
Jump to: navigation, search

Description

Converting maps is fairly straight forward and only requires a few changes. First of all, you need to set up pragma's compiler for hammer. You'll also need the .vmf-file of the map you want to convert.
Generally you don't need to convert textures(.vtf-files) or materials(.vmt-files) from the source engine, as they're supported directly (You should just be able to copy the files). This is, however, not recommended, and you should convert them to the appropriate formats in pragma.

Convert entities

Entity names and keyvalues differ in pragma, so you will have to change them. Here's a list of common entities and their equivalents in pragma:

Spawn points

The player spawn point ("info_player_start" in the source engine) is called "game_player_spawn" in pragma. If no such entitity is placed, all players will spawn at the map's origin.

Lights

Pragma has three light types: Spot lights, point lights and directional/hemispherical lights.

  • light / light_dynamic: env_light_point
  • light_spot: env_light_spot
  • light_environment / light_directional: env_light_directional

Note: There should only ever be 1 directional light active at a time. You can switch between them (Turn off one and turn on another), but there mustn't be more than 1 active at the same time.

Skyboxes

Placing a skybox texture on a brush is not enough to make it a valid skybox, you'll have to tie it to a "skybox" entity as well. You can find more information about this here.

Sounds

Sound entities in pragma are called "env_sound" and are equivalent to source's "ambient_generic" entity. For soundscapes, use "env_soundscape".

Materials and textures

Pragma has support for .vtf- and .vmt-files, so you can just copy them over to the pragma "materials" directory. It is recommended that you convert them, but it's not required.
However, to properly compile your map, you'll have to make sure the compiler can find all of the materials and textures in the map (Check the compile log for warnings).
By default the compiler will look inside the directory where the map is located, as well as the directories of several source games (HL2, HL2: EP1, HL2: EP2, Counter-Strike Source, etc.). If the compiler is still unable to locate some materials or textures, you can use the "-mount" parameter in the "Run Map" advanced properties. For example:

-f $path\$file.$ext -mount "C:/Program Files (x86)/Steam/steamapps/common/half-life 2/hl2"

This would allow the compiler to look for materials inside the "materials" directory of the mount path.

Running the map

After the map was compiled, the compiler will have placed a '.wld'-file inside the same directory as your '.vmf'. To load it, place it into the 'maps' directory of your pragma installation and it should appear in the list when starting a new game.
Additionally, you can create a ".txt"-file with the map's name and add some additional information (Such as the author's name), which will be displayed in the map list as well:

"map_name"
{
	$string name "Test Map"
	$string author "Map Author Name"
}

See Also