Day of Defeat: Source (custom).fgd
Jump to navigation
Jump to search
Tip:Select the beginning of the line (usually the "//" comment) by clicking it, scroll down then hold ⇧ Shift, and click at the end of the line to select all.

This is a draft page. It is a work in progress open to editing by anyone.
Remember to check for any notes left by the tagger at this article's talk page.
Remember to check for any notes left by the tagger at this article's talk page.
Unofficial updated version of Day of Defeat: Source.fgd. Requires Hammer++ for some features; not tested in
Hammer 4.x.
This FGD requires a few extra assets; they can be downloaded here (direct download). Extract the VPK from the 7z, and place it in Day of Defeat Source/dod/custom/
.
- Todo: Test which CBaseTrigger things work on dod_capture_area and dod_bomb_dispenser. Do not make them inherit the Trigger BaseClass, as that adds an origin KV, causing leaks.
FGD
- This is a FGD (Forge Game Data) file used to define all of the entities of a game for a map editor (such as Hammer).
To add a FGD file to the map editor, copy the following text into a text editor such asNotepad++, and save it with "save as type" being "all files" and .fgd appended to the file name. Then open your map editor and add the FGD to your game configuration.

//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =======
//
// Purpose: Day of Defeat: Source game definition file (.fgd)
//
// Updated by SirYodaJedi
//
//=============================================================================
@include "base.fgd"
//-------------------------------------------------------------------------
//
// Base Classes
//
//-------------------------------------------------------------------------
@BaseClass = Target
[
// unused leftover from GoldSrc?
target(target_destination) : "Target"
]
@BaseClass = TeamNum
[
TeamNum(choices) : "Team" : 0 =
[
0 : "Neutral"
2 : "Allies"
3 : "Axis"
]
input SetTeam(integer) : "Changes the entity's team (0=Neutral,2=Allies,3=Axis)"
]
@BaseClass base(Targetname, Angles, Parentname, RenderFields) color(0 0 200) = DoDSWeapon
[
spawnflags(Flags) =
[
1 : "Start asleep (don't fall to ground)" : 0
]
ammo(integer) : "Reserve ammo" : : "Ammo to include with the weapon. Default 0."
output OnPlayerUse(void) : "Fires when the player +uses this weapon"
output OnPlayerPickup(void) : "Fires when the player picks up this weapon"
input Ignite(void) : "Sets the item on fire."
output OnIgnite(void) : "Fired when the item is set ablaze."
]
@FilterClass base(BaseFilter) size(-8 -8 -8, 8 8 8) = filter_activator_team :
"A filter that filters by the team of the activator."
[
filterteam(choices) : "Filter Team Number" : 2 : "The team number to filter by.\nIf the filter mode is Allow, only entities whose team number matches the given team will pass the filter. If the filter mode is Disallow, all entities EXCEPT those whose team number matches the given team will pass the filter." =
[
2 : "Allies"
3 : "Axis"
]
]
//-------------------------------------------------------------------------
//
// Point Classes
//
//-------------------------------------------------------------------------
// Player spawns
// Attempting to use the actual playermodels causes weird rotation issues
// (and looks weird, because hammer t-poses instead of using default anim)
@PointClass base(Angles,Targetname,EnableDisable) studio("models/editor/american_rifleman.mdl") = info_player_allies :
"This entity marks the start point for Allied players.\nPlace 16 units above the ground to prevent spawn from being invalid." []
@PointClass base(Angles,Targetname,EnableDisable) studio("models/editor/german_rifleman.mdl") = info_player_axis :
"This entity marks the start point for Axis players.\nPlace 16 units above the ground to prevent spawn from being invalid." []
// Weapons -- TODO
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_k98_rg.mdl") = weapon_riflegren_ger : "Axis Rifle Grenade.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_k98_rg_grenade.mdl") = weapon_riflegren_ger_live : "Axis Live Rifle Grenade.\n\nExplodes after a few seconds." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_garand_gren.mdl") = weapon_riflegren_us : "Allies Rifle Grenade.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_garand_rg_grenade.mdl") = weapon_riflegren_us_live : "Allies Live Rifle Grenade.\n\nExplodes after a few seconds." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_stick.mdl") = weapon_frag_ger : "Axis Frag Grenade.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_stick.mdl") = weapon_frag_ger_live : "Axis Live Frag Grenade.\n\nExplodes after a few seconds." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_frag.mdl") = weapon_frag_us : "Allies Frag Grenade.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_frag.mdl") = weapon_frag_us_live : "Allies Live Frag Grenade.\n\nExplodes after a few seconds." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_30cal.mdl") = weapon_30cal : "Allies Machine Gunner's .30Cal.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_bar.mdl") = weapon_bar : "Allies Support's BAR.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_bazooka.mdl") = weapon_bazooka : "Allies Rocket's Bazooka.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_c96.mdl") = weapon_c96 : "Axis C96 Sidearm.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_colt.mdl") = weapon_colt : "Allies Colt Sidearm.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_garand.mdl") = weapon_garand : "Allies Rifleman's M1 Garand.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_k98.mdl") = weapon_k98 : "Axis Rifleman's K98k.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_k98s.mdl") = weapon_k98_scoped : "Axis Sniper's K98 Sniper.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_m1carb.mdl") = weapon_m1carbine : "Allies M1 Carbine.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_mg42bd.mdl") = weapon_mg42 : "Axis Machine Gunner's MG42.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_mp40.mdl") = weapon_mp40 : "Axis Assault's MP40.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_mp44.mdl") = weapon_mp44 : "Axis Support's Stg44.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_p38.mdl") = weapon_p38 : "Axis Walther P38 Sidearm.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_pschreck.mdl") = weapon_pschreck : "Axis Rocket's Panzerschreck.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_smoke_ger.mdl") = weapon_smoke_ger : "Axis Smoke Grenade.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_smoke_us.mdl") = weapon_smoke_us : "Allies Smoke Grenade.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_spade.mdl") = weapon_spade : "Axis Melee Spade.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_spring.mdl") = weapon_spring : "Allies Sniper's Springfield.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_thompson.mdl") = weapon_thompson : "Allies Assault's Thompson.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(DoDSWeapon) studioprop("models/weapons/w_amerk.mdl") = weapon_amerknife : "Allies Melee Knife.\n\nDespawns after a few seconds; spawn with point_template or VScript." []
@PointClass base(Targetname) size(-32 -32 -32, 32 32 32) studio("models/items/dod_gift.mdl") = holiday_gift : "A festive present.\n\nDisappears after 30 seconds; spawn with point_template or vscript." []
// DoD game logic
@PointClass base(Targetname, EnableDisable) iconsprite("editor/dod_icon.vmt") = info_doddetect : "DoD Gamerules"
[
//Respawn factor
//==============
detect_allies_respawnfactor(string) : "Allies Respawn delay factor" : "1.0" : "Respawn delay multiplier for the Allied team. Regardless of what respawn factor is used, the respawn delay will not go below 5 seconds or above 20 seconds."
detect_axis_respawnfactor(string) : "Axis Respawn delay factor" : "1.0" : "Respawn delay multiplier for the Axis team. Regardless of what respawn factor is used, the respawn delay will not go below 5 seconds or above 20 seconds."
// default is 5, because that's the actual default used by game code
detect_allies_startroundvoice(choices) : "Start round command for Allies" : 5 =
[
0 : "Attack"
1 : "Defend"
2 : "Beach"
3 : "Timed Attack"
4 : "Timed Defend"
5 : "Flags"
]
detect_axis_startroundvoice(choices) : "Start round command for Axis" : 5 =
[
0 : "Attack"
1 : "Defend"
2 : "Beach"
3 : "Timed Attack"
4 : "Timed Defend"
5 : "Flags"
]
]
@PointClass base(Targetname,TeamNum) iconsprite("editor/enigma.vmt") = dod_scoring : "Custom Scoring"
[
point_give_delay(integer) : "Seconds between point gives" : 60
point_give_amount(integer) : "Points to give each time" : 1
point_give_max_times(integer) : "Max number of times to give points" : 10
input GiveTickPoints(integer) : "Give tick points to the selected team"
]
@PointClass base(Targetname,EnableDisable) iconsprite("editor/dod_flag.vmt") = dod_control_point_master : "Control Point Master"
[
cpm_use_timer(choices) : "Use round timer?" : 0 =
[
0 : "No"
1 : "Yes"
]
cpm_timer_length(integer) : "Round timer length in seconds" : 300
cpm_timer_team(choices) : "Which team wins when timer expires" : 2 : "Stalemates are *not* permitted; setting this to any value other than 2 or 3 will result in the round continuing after the timer expires." =
[
2 : "Allies"
3 : "Axis"
]
output OnAlliesWin(void) : "Output sent when Allies win the round. Do not use for victory music; overwrite `Game.USWin` soundscript in `maps/<mapname>_sounds.txt` instead."
output OnAxisWin(void) : "Output sent when Axis win the round. Do not use for victory music; overwrite `Game.USWin` soundscript in `maps/<mapname>_sounds.txt` instead."
input AddTimerSeconds(integer) : "Add seconds to the duration of the round timer"
input RoundInit(void) : "Re-initializes the round, resetting all control points and capture zones. Does not actually restart the round, so the round timer and any bomb targets are not reset."
]
@PointClass base(Targetname) iconsprite("editor/dod_location.vmt") = dod_location : "Location"
[
location_name(string) : "Name of this location" : "TODO: Set Name" : "Max 63 characters."
]
@PointClass base(Targetname, EnableDisable, Angles) studioprop() = dod_control_point :
"A Control Point, representing a capturable objective; there can be up to 8 of these in a map.\n\nCan be the visual representation of the control point, or the model can be disabled and a prop_dynamic be used via this entity's outputs instead."
[
spawnflags(flags) =
[
1: "Hide Control Point on HUD" : 0
2: "Start with model hidden" : 0
4: "Give tick points for bombs remaining" : 0
]
point_printname(string) : "Location name" : "TODO: Set Name" : "The control point name displayed on the Hud when captured. Can be either a regular string or a reference to a localization string."
point_timedpoints_axis(integer) : "Time based point value for Axis" : 0 : "Points given to Axis as they own this flag over time."
point_timedpoints_allies(integer) : "Time based point value for Allies" : 0 : "Points given to Allies as they own this flag over time."
point_default_owner(choices) : "Default owner of the control point" : 0 =
[
0 : "Neutral"
2 : "Allies"
3 : "Axis"
]
point_axis_capsound(sound) : "Axis capture sound" : "Voice.German_FlagCapture" : "Sound made when Axis capture this point"
point_allies_capsound(sound) : "Allies capture sound" : "Voice.US_FlagCapture" : "Sound made when Allies capture this point"
point_resetsound(sound) : "Sound made when point resets" : ""
// first, we define some KVs that are used by Hammer++, but ignored by the game, to get around some editor hardcoding
model(studio) : "Editor model" : "models/mapmodels/flags.mdl" : "Model to display in the map editor (no effect in-game). This should match the model used by the default owner."
body(choices) : "Editor model bodygroup" : 3 : "Bodygroup to use for the editor model (no effect in-game). This should match the bodygroup used by the default owner (descriptions given are for models/mapmodels/flags.mdl)." =
[
0 : "0 (Vanilla is German)"
1 : "1 (Vanilla is American)"
2 : "2 (Vanilla is British)"
3 : "3 (Vanilla is Neutral)"
]
// Then, the actual KVs used in-game
point_axis_model(studio) : "Axis model" : "models/mapmodels/flags.mdl" : "Model when Axis own the point"
point_axis_model_bodygroup(integer) : "Axis model bodygroup" : 0
point_allies_model(studio) : "Allies model" : "models/mapmodels/flags.mdl" : "Model to use when Allies own the point"
point_allies_model_bodygroup(integer) : "Allies model bodygroup" : 1
point_reset_model(studio) : "Neutral model" : "models/mapmodels/flags.mdl" : "Model when neither team owns the point"
point_reset_model_bodygroup(integer) : "Neutral model bodygroup" : 3
output OnAxisCap(void) : "Send when owner is changed to Axis (including round resets)"
output OnAlliesCap(void) : "Send when owner is changed to Allies (including round resets)"
output OnCapReset(void) : "Send when owner is changed to Neutral (including round resets)"
output AxisCapturePoint(void) : "Send when Axis capture this point (not triggered on round resets)"
output AlliesCapturePoint(void) : "Send when Allies capture this point (not triggered on round resets)"
point_group(integer) : "Group Index" : 0
point_index(integer) : "Index of this point (unique)" : 0 : "Unique identifier; used with dod_capture_area"
point_hud_icon_neutral(material) : "Hud icon - Neutral" : "sprites/obj_icons/icon_obj_neutral"
point_hud_icon_axis(material) : "Hud icon - Axis" : "sprites/obj_icons/icon_obj_axis"
point_hud_icon_allies(material) : "Hud icon - Allies" : "sprites/obj_icons/icon_obj_allies"
point_hud_icon_timercap(material) : "Hud icon - bomb planted" : "sprites/obj_icons/icon_obj_neutral"
point_hud_icon_bombed(material) : "Hud icon - point destroyed" : "sprites/obj_icons/icon_obj_neutral"
input HideModel(void) : "Hide the control point model"
input ShowModel(void) : "Show the control point model"
input SetOwner(integer) : "Set the current owner of this point (0=Neutral,2=Allies,3=Axis)"
// TODO - probably just an int?
point_num_bombs(choices) : "Number of Bombs required to destroy" : 0 : "The number of bomb required to destroy the point, if used as a bomb objective. Ignore if used as a flag." =
[
0 : "0"
1 : "1"
2 : "2"
3 : "3"
]
// ===== CBaseAnimating KVs and I/O that aren't overridden by dod_control_point =====
solid(choices) : "Collisions" : 0 : "Note that the default model lacks a collision mesh, so VPhysics will be unavailable." =
[
0 : "Not Solid"
2 : "Use Bounding Box"
6 : "Use VPhysics"
]
skin(integer) : "Skin" : : "Some models have multiple versions of their textures, called skins. Set this to a number other than 0 to use that skin instead of the default.\n\nUse the `skin` input with the `OnAxisCap`, `OnAlliesCap`, and `OnCapReset` outputs if you need to use different skin indices per faction."
modelscale(float) : "Model Scale" : : "A multiplier for the size of the model."
sequence(integer) : "Animation Sequence" : : "Default animation sequence index for the model to be playing after spawning. (Default 0)"
lightingorigin(target_destination) : "Lighting Origin" : : "Name of entity (not info_lighting!) from which to sample lighting instead of this entity's $illumposition."
disableshadows(choices) : "Disable Shadows" : "" : "Used to disable dynamic shadows on this entity." =
[
"" : "No"
1 : "Yes"
]
disablereceiveshadows(choices) : "Disable Receiving Shadows" : "" : "Prevent the entity from receiving dynamic shadows on itself."=
[
"" : "No"
1 : "Yes"
]
shadowcastdist(integer) : "Shadow Cast Distance" : : "Sets how far the entity casts dynamic shadows. 0 or absent means default distance from the shadow_control entity."
// Inputs
input skin(integer) : "Changes the model skin to the specified number."
input DisableShadow(void) : "Turn shadow off."
input EnableShadow(void) : "Turn shadow on."
input AlternativeSorting(bool) : "Used to attempt to fix sorting problems when rendering. True activates, false deactivates."
input SetModelScale(string) : "Takes two values separated by a space. The first is the target model scale. The second value is the number of seconds the change in scale will be spread over."
// Outputs
output OnIgnite(void) : "Fired when this object catches fire."
]
@PointClass base(Targetname, Angles, EnableDisable) studioprop("models/weapons/w_tnt_red.mdl") line(0 128 0, targetname, target_control_point) = dod_bomb_target : "Bomb Target.\n\nIf this bomb explodes, it is deactivated for the rest of the round unless set the Enable input."
[
target_control_point(target_destination) report : "Target Control Point" : "Control point to help capture. Leave blank if this is not tied to a control point."
bombing_team(choices) : "Bombing Team" : 2 : "To create a team-agnostic bomb target, place two dod_bomb_targets in the same location with the same angles. Send the `Disable` input to the opposite team's bomb target via `OnBombPlanted`, and send the `Enable` input to the opposite team's bomb target via `OnBombDefused`." =
[
2 : "Allies"
3 : "Axis"
]
add_timer_seconds(integer) : "Add To Timer (sec)" : 0 : "Add this many seconds to the round timer when bomb explodes."
output OnBombTargetActivated(void) : "Send when bomb target becomes active"
output OnBombTargetDeactivated(void) : "Send when bomb target becomes inactive"
output OnBombPlanted(void) : "Send when bomb is planted at this target"
output OnBombExploded(void) : "Send when timer expires and bomb explodes"
output OnBombDefused(void) : "Send when bomb is completely defused"
]
//-------------------------------------------------------------------------
//
// Solid Classes
//
//-------------------------------------------------------------------------
// This is not in base.fgd, but is in dod.fgd, so any changes should be made to both files!
@SolidClass = func_ladder : "Brush ladder. Players will be able to freely along this brush, as if it was a ladder.\n\nIf you are using toolsinvisibleladder or any other material with %CompileLadder, use func_detail instead, especially if does not have %CompileDetail as well."
[
targetname(string) : "Name" : : "Name to display in the map editor's 2D views and Entity Report; no effect in-game."
]
@SolidClass base(Targetname,EnableDisable) line(0 128 0, targetname, area_cap_point) = dod_capture_area : "Capture Area"
[
area_allies_cancap(choices) : "Can Allies Cap?" : 1 =
[
0 : "No"
1 : "Yes"
]
area_axis_cancap(choices) : "Can Axis Cap?" : 1 =
[
0 : "No"
1 : "Yes"
]
area_allies_numcap(choices) : "Number of Allies to cap" : 1 : "Client crash if set above 5. The limit is supposed to be 9." =
[
1 : "1"
2 : "2"
3 : "3"
4 : "4"
5 : "5"
]
area_axis_numcap(choices) : "Number of Axis to cap" : 1 : "Client crash if set above 5. The limit is supposed to be 9." =
[
1 : "1"
2 : "2"
3 : "3"
4 : "4"
5 : "5"
]
area_time_to_cap(float) : "Time to cap (sec)" : 5
area_cap_point(target_destination) report : "Linked control point" : "" : "Name of the control point this area is linked to"
output OnAlliesStartCap(void) : "Sent when Allies start capture"
output OnAlliesBreakCap(void) : "Sent when Allies break capture"
output OnAlliesEndCap(void) : "Sent when Allies end capture"
output OnAxisStartCap(void) : "Sent when Axis start capture"
output OnAxisBreakCap(void) : "Sent when Axis break capture"
output OnAxisEndCap(void) : "Sent when Axis end capture"
output OnStartCap(void) : "Sent when either team starts capture"
output OnBreakCap(void) : "Sent when either team break capture"
output OnEndCap(void) : "Sent when either team end capture"
input RoundInit(void) : "Re-parse the ''area_allies_numcap'', ''area_allies_numcap'', and ''area_time_to_cap'' KVs."
]
@SolidClass base(Targetname,EnableDisable) = dod_bomb_dispenser : "Bomb Dispenser Area"
[
dispense_team(choices) : "Team to give bombs to" : 0 =
[
0 : "Both Teams"
2 : "Allies Only"
3 : "Axis Only"
]
]
@SolidClass base(Targetname) = func_team_wall : "Team Blocker Wall.\n\nUnlike func_teamblocker, it is able to be loaded via an ENT file, cannot have its team value changed without AddOutput, and is preserved between rounds."
[
blockteam(choices) : "Team to block" : 0 =
[
0 : "Neither"
2 : "Allies Only"
3 : "Axis Only"
]
warn(choices) : "Show warning" : "" : "Show warning when touching this entity as the enemy team." =
[
"" : "No"
"1" : "Yes"
]
mins(string) : "mins" : : "The uppermost and northernmost point of the bounding box; used instead of bmodel if present."
maxs(string) : "maxs" : : "The bottommost and southernmost point of the bounding box; used instead of bmodel if present."
]
@SolidClass base(Targetname, Parentname, TeamNum) = func_teamblocker :
"Walls that players of a certain team are unable to pass through.\n\nUnlike func_team_wall, it cannot be loaded via an ENT file, can have its team value changed with an input, and is reset between rounds."
[
spawnflags(flags) =
[
2: "Don't show hint when touched" : 0
]
]
//-------------------------------------------------------------------------
//
// Editor stuff
//
//-------------------------------------------------------------------------
@AutoVisGroup = "Entities"
[
"DoD Rules"
[
"info_doddetect"
"dod_scoring"
"dod_control_point_master"
//"dod_control_point"
]
"Objectives"
[
"dod_capture_area"
"dod_bomb_dispenser"
"dod_bomb_target"
"dod_control_point"
]
"Team Clip"
[
"func_teamblocker"
"func_team_wall"
]
]
@MaterialExclusion
[
// want to use custom hl_basics, not broken vanilla hlbasics
"hlbasics"
// additional vgui subfolders (vgui iself isn't, because we need vgui/black)
"vgui/crosshairs"
]