KDScript

Custom HUD elements

The following scripts add a variety of custom HUD (head-up display) elements to the Dark Engine interface. These scripts are incompatible with NewDark custom HUD scripts from any other OSM.

All text drawn in HUD elements will appear in the font named in the gui_font configuration variable in dark.cfg, dromed.cfg, or likewise. This is same font used for the onscreen names of weapons and tools and, unfortunately, for the loadout and load/save screens, where larger sizes may lead to layout issues. By default, this font is intrface\smalfont.fon in the actual game, but editor\textfont.fon in DromEd game mode. Any type of Dark Engine font can be used, including fully antialiased fonts.

HUD elements are affected by the d3d_disp_scaled_2d_overlay (scale), d3d_disp_force_filter_scale2d (scaling filter), and d3d_disp_2d_overlay_alpha (opacity) settings in cam_ext.cfg, which can also be placed in dark.cfg for distribution with FMs.

If custom HUD elements (such as KDStatMeter) are replacing the light gem and/or health bar, the default versions should be disabled in dark.cfg by setting vismeter_zoom and/or hpbar_zoom, respectively, to -1. Disabling the default breath meter would be more complicated.

If a HUD element script is placed on an object on which metaproperties are added or removed in-game, the element may temporarily disappear at certain times. This issue should always be fixable by entering the in-game menu and returning to game mode. Especially, a HUD element script placed directly on an AI may temporarily disappear after that AI dies or is knocked out. To avoid this form of the issue, avoid placing a HUD element script directly on an AI: whenever possible, place it on a fnord with a reference to the AI instead.

Note that a maximum of 128 HUD-related images can be loaded at a time; animation frames count individually towards this limit.

Symbols

Some HUD element scripts may be configured to draw line art symbols on screen. For script parameters that define symbols, the following values are possible:

@none
No image or symbol is drawn.
@arrow
An arrow is drawn, pointing at an appropriate direction (some elements only).
@crosshairs
Simple crosshairs are drawn.
@reticule
A reticule with a square and crosshairs is drawn.
@square
A filled square is drawn.
This documentation is part of the KDScript module. Copyright © 2012–2013 Kevin Daughtridge. See introduction for details.