HUD Scripting

From Warfork
Revision as of 23:10, 5 February 2020 by caine (Caine) (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page needs to be completed.

HUD Script Commands

Command names are not case sensitive.

Command Arguments Parameters Description
setScale 1 Scaling method (#DEFAULTSCALE|#NOSCALE|#SCALEBYWIDTH|#SCALEBYHEIGHT) Sets the scaling method for cursor and size commands.
setCursor 2 Horizontal position, vertical position Changes cursor position on the hud parsers virtual grid
moveCursor 2 horizontal offset, vertical offset Moves the cursor position relative to current position
setAlign 2 horizontal alignment (#LEFT|#CENTER|#RIGHT), vertical alignment (#TOP|#MIDDLE|#BOTTOM) Changes alignment of things like images or text
setSize 2 - Sets width and height. Used in various hud commands for pictures, models and containers
setFontSize 1 - Sets font size.
setFontFamily 1 Available arguments by default: Droid Sans, Droid Sans Mono, Hemi Head Rg, Kimberley Bl, warsow, Silhouette, Virtue. Sets font Family.
setFontStyle 1 Available arguments: Bold, Italic, Normal. Accepts 'con_fontsystemsmall', 'con_fontsystemmedium' and 'con_fontsystembig' as shortcut to default game fonts Sets font Style.
setColor 4 - Sets color setting in RGBA mode. Used to change colors of boxes, bars, text and images
setColorToTeamColor 1 - Sets cursor color to the color of the team provided in the argument
setColorAlpha 1 - Changes the alpha value of the current color
setRotationSpeed 3 - Sets rotation speeds as vector. Used for models
setCustomWeaponIcons 3 1st argument specifies the weapon it should affect (either by id, or better use #ITEM_GUNBLADE etc constants)
2nd argument tells if you want to replace the NOGUN icon (0) or the regular weapon icon (1)
3rd argument is the path to the graphic you want to use as a replacement
modifies an individual image on the graphical weaponlist.
setCustomWeaponSelect 1 the only and required argument is a file path to a valid graphic modifies the image around current selected weapon on the list of weapons
drawObituaries 2 - Draws graphical death messages. Arguments: horizontal alignment, iconsize
drawAwards - - Draws award messages
drawClock - - Draws a clock that shows remaining play time
drawHelpString - - Draws the help message
drawPlayername 1 - Draws the name of the player with id provided by the argument
drawPointing - - Draws the name of a player that is being pointed at (the player under the crosshair)
drawTeamMates 0 - Draws indicators where team mates are
drawStatString 1 - Draws configstring of argument id
drawItemName 1 - Draws the name of the thing that is given as argument in form of item index
drawString 1 - Draws the text in argument at cursor position using currently set font and color
drawStringNum 1 - Can be used to output referenced numbers as text, using currently set font, position and color
drawNum 1 - Draws numbers of given character size. Use setSize to set character size
drawStretchNum 1 - Draws numbers stretched inside a given size
drawBar 2 value, maxvalue Draws a bar of size setting, the bar's longest dimension, or its width if it's a square, is filled in proportion to the arguments
drawPicBar 3 value, maxvalue, imagefile Draws an image bar of size setting, is filled in proportion to the arguments.
drawCrosshair - - Draws the game crosshair
drawKeyState 1 forward, backward, left, right, fire, jump, crouch, special. Use setSize to scale and setCursor to position each element. Draws icons showing if the argument key is pressed.
drawNetIcon - - Draws the disconnection icon
drawChat 3 - Draws the game chat messages
drawPicByIndex 1 - Draws a pic with argument as imageIndex
drawPicByItemIndex 1 - Draws a item icon pic with argument as itemIndex
drawPicByName 1 - Draws a pic with argument being the file path
drawModelByIndex 1 - Draws a model with argument being the modelIndex
drawModelByName 2 - Draws a model with argument being the path to the model file
drawModelByItemIndex 1 - Draws an item model with argument being the item index
drawWeaponIcons 4 Offset x, offset y, size x, size y Draws the icons of weapon/ammo owned by the player
drawCaptureAreas 3 icon-width, icon-height and alignment (either horizontal or vertical) Draws capture area HUD icons.
drawMiniMap 2 Playernames (0|1), itemnames (0|1) Shows miniature map overview for spectators.
drawWeaponWeakAmmo 3 Offset x, offset y, fontsize Draws the amount of weak ammo owned by the player
drawWeaponStrongAmmo 3 Offset x, offset y, fontsize Draws the amount of strong ammo owned by the player
drawTeamInfo - - Draws the Team Info (locations) box
drawTimer 1 - Draws a digital clock using currently set font.
drawPicVar 6 value, minval, maxval, firstimg, lastimg, imagename## (replacing ## by the picture number, no leading zeros, starting at 0) Draws a picture from a sequence, depending on the value of a given parameter.
drawLocationName 1 location tag/index Draws the location name
if 1 Accepts operands >, <, ==, >=, <=, etc. Conditional expression.
endif - - End of conditional expression block


add more