FGD format changes

Valve Hammer Editor 3.4

FGD Format Changes

A number of changes have been made to the FGD format to allow for enhanced entity properties and to facilitate the display of sprites in the 3D view.

Iconic Entities Iconic Entities are those entities that have a sprite associated with them. Icon sprites should be stored in Valve Hammer Editor\sprites and are referenced with the iconsprite() helper. The format is like this:

@PointClass iconsprite("sprites/lightbulb.spr") base(Light) = light : "Light Entity"
[
  &ldots;
]

Icon sprites should be of alphatest type.

Sprite-based Entities
Sprite-based entities are those entities that have some connection to a sprite. For Half-Life, this includes the env_glow, env_sprite, and cycler_sprite. These entities use the sprite() helper. Below is the modified version of the env_sprite.

@PointClass sprite() base(Targetname, RenderFields) size(-4 -4 -4, 4 4 4) = env_sprite : "Sprite"
[
  framerate(string) : "Framerate" : "10.0"
  model(sprite) : "Sprite Name" : "sprites/glow01.spr"
  scale(string) : "Scale" : ""
  spawnflags(flags) =
  [
    1: "Start on" : 0
    2: "Play Once" : 0
  ]
]

The first difference is the addition of the sprite() helper in the definition line. The other is that the model key is now a sprite type, rather than a generic string. The sprite listed in this key will be displayed in the 3D view.

The sprite() helper is looking specifically for the model key. It will also look at the value of the framerate, scale, and rendermode keys, so the sprite will be displayed as it is meant to (ie: animated sprites animate at the specified framerate).

File Browsing
Any entity property that accepts the path/filename of a sprite, sound, or model should now be of the sprite, sound, or studio type, rather than just a simple string.

  model(sprite) : "Sprite Name" : "sprites/glow01.spr"
  model(studio) : "Model Name" : "models/can.mdl"
  message(sound) : "WAV Name"

The result of using these key types rather than the generic string type is the entity properties will have a button beside them allowing you to browse through the appropriate game directories for the files. This does not provide any preview capabilities.

For this to work correctly, you must have the sprite, model, and sound folders unpacked from the PAK files to the appropriate directories. Wally (the texture editor) provides a simple UI for exploring and exporting files from the PAK file. Wally is available at http://www.telefragged.com/wally/.

Decals
The decal entity definition now requires the addition of the decal() helper to make it work properly in the editor.

@PointClass decal() base(Targetname, Appearflags) = infodecal : "Decal"
[
  texture(decal)
]

Without the decal() helper, decals will appear as small square blocks in the editor's 3D view.