Mapping

From Pragma
Jump to: navigation, search

Pragma currently has no own map-editor, for now you can use the hammer map editor from the source SDK.

Setting up hammer

Before starting to map for pragma, there are two things you have to set up first:

FGD Configuration

Pragma's entities differ from the ones in the source engine. To be able to place entities for pragma, you'll have to load the fgd-file for it. To do that, follow these instructions:

  • Go to "tools/options"
  • Enter the tab "Game Configurations"
  • Remove all existing entries in the "Game Data files" block
  • Click "Add" next to the "Game Data files" List
  • Browse to "path/to/pragma/sdk" and choose "base.fgd"
  • Click "Open", save the options and restart hammer

Compiler

To build maps for pragma, you have to use pragma's compiler. It's located in "<root>/bin/wlc.exe". You can either drag and drop your .vmf-file directly on to it, or set it up inside hammer. To do that, follow these instructions: Video: https://youtu.be/B__aAseskNo

  • Press F9 to open the compiler configuration (Alternatively you can go to "File/Run Map...")
  • Click on "Expert..."
  • Create a new configuration by clicking on "Edit", and then "New". Name it "Pragma" and click "Close".
  • Choose "Pragma" from the configuration list.
  • Create a new command by pressing "New".
  • Enter the following in the "Command" field: "path/to/pragma/bin/wlc.exe"
  • Enter the following in the "Parameters" field: "-f $path\$file.$ext"
  • Check the new command in the left list using the checkbox.
  • Click "Go!"
  • If the compilation has been successful, it should say "All operations are complete!" and there should be a ".wld"-file inside the same directory as the .vmf.

Differences to Mapping for Source

There are several things you have to know when mapping for pragma, because they differ from the usual procedures:

  • Skybox

Usually you would just apply the "tools/toolsskybox" to any surface that should draw the skybox. This will not work for pragma. Instead, you have to apply the actual skybox-texture.
The 'skybox'-keyvalue in the map settings won't have any effect. This also means that you can use multiple different skybox sets in the same map. After that, you also have to assign the "skybox"-class to all skybox-brushes. Not doing this step will result in graphical artifacts on the skybox.

  • Leaks

Pragma's compiler will not check for leaks. You should still make sure your map is closed off properly to prevent the player from dropping out of the world.

Using materials and textures from source games

The compiler needs to know where the materials and textures you're using are located, so you will have to specify that as well. To do so, you can use "-mount <path/to/game>" in the parameters for the command properties. e.g. if you're using materials/textures from hl2 and counter-strike, change the "Parameters" field to:

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

You'll also have to extract the materials/textures from those games from their .vpk-files into the specified directories (You can use GCFScape for that).
Note: Materials are .vmt-files in source, textures are .vtf-files. These are usually located in different .vpk-files, so make sure you've extracted all of them!

To make sure the game can find the files as well, you'll have to copy them over to your pragma-installation. The easiest way to do so is by creating a new directory in "addons" (e.g. "hl2_materials"), and copying them into it. It should look something like this: HL2 Materials.png

Using skyboxes from source games

If you want to use skyboxes from a source game, you'll have to do some additional steps: Only .dds-textures are allowed for skyboxes, so you'll have to convert the .vtf-files first. You can find more information on how to do so here. Once that is done, move the .dds-files somewhere into the materials-directory of pragma. They need to have the same name with the following suffixes, depending on which side they represent:

  • basenamebk: Back
  • basenamedn: Down
  • basenameft: Front
  • basenamelf: Left
  • basenamert: Right
  • basenameup: Up

You'll also need a material-file which combines the textures to one skybox. To do so, create an empty text-file with the extension ".wmi" somehwere in "materials" with the following contents:

"skybox"
{
	$cubemap skybox "path/to/skybox/textures/basename"
	$int mipmap_load_mode -1
}

That's all you need to do for pragma, but to apply the skybox in hammer, you'll have to do one additional step: Create a new text-file with the same name as the .wmi-file you have created earlier, but with the extension ".vmt" and the following contents:

"LightmappedGeneric"
{
	"$baseTexture" "tools/toolsskybox"
}

Now move it into the materials-directory of whatever game you've specified in the hammer settings, and make sure it has the same relative path as the .wmi. So if your .wmi file was in "materials/skybox/basename.wmi", and you've specified "C:/Program Files (x86)/Steam/steamapps/common/half-life 2/hl2/" as game directory in hammer, then the .vmt should go to "C:/Program Files (x86)/Steam/steamapps/common/half-life 2/hl2/materials/skybox/basename.vmt".
Now all you have to do is restart hammer (If it was still open) and apply the new material to your skybox.
Make sure to read this part before doing so.