KDScriptCustom HUD elements


ParameterTypeDescriptionDefault value
tool_sight_imagestringpath to a bitmap or name of a symbol (see below)@crosshairs
tool_sight_colorcolorcolor of any symbol or text drawn#808080 (grey)
tool_sight_offset_xintegerx-axis distance from center of screen, in pixels0
tool_sight_offset_yintegery-axis distance from center of screen, in pixels0
tool_sight_deselectbooleanwhether to deselect a stack of the object when it is frobbed in inventoryfalse

KDToolSight displays an image or symbol at the center of the screen when the object is is placed on is selected in inventory. It is intended to help the player target thrown tools and non-bow projectiles, primarily that have little or no gravity (such as magic spells). This is a custom HUD element script; see the custom HUD elements documentation for more details.

The tool_sight_image parameter determines how the tool sight appears. If it is set to one of the predefined symbols (other than @arrow), the named symbol will be drawn in the color specified in the tool_sight_color parameter. Otherwise, this parameter should be a relative path to a bitmap image that will represent the arrow. The bitmap should be relatively small but may have a full alpha channel. Animations and context-sensitive choice of images are not yet supported. If the image cannot be loaded, @crosshairs will be drawn instead.

The center of the bitmap image or symbol will be aligned at the center of the canvas (screen), as offset by the values of tool_sight_offset_x and tool_sight_offset_y.

The “Deselect” option is not supported in the Inv Action field of the Engine Features→FrobInfo property. As such, there is no way to automatically deselect a tool or projectile stack after an instance is thrown. If a tool sight is placed on a scouting orb or other such object, this would leave the sight stuck on screen while the camera is attached. To avoid this, set the tool_sight_deselect parameter to true; the stack will be deselected after being frobbed in inventory.

This script is part of the KDScript module. Copyright © 2012–2013 Kevin Daughtridge. See introduction for details.