—» Home
—» Screens
—» Help
—» F.A.Q.
—» Armory
—» Download
Help Home

Tutorials

Weapon Scr. I
Weapon Scr. II

Cmd Reference

All Commands
General
Load
Graphics
HUD
Sounds
Player
Terrain
Projectiles
Particles
Collision
Objects
AI

Commands: hud

Legend

X - X is a number
'X' - X is a string (a letter/word/text)
[X=0] - X is an optional parameter with value 0 when omitted (NEVER add [] to your script!)


hudammobar(AMMO, TOTAL)

Parameters:
AMMO - left ammo value
TOTAL - total ammo value
Draws a 'ammo bar' HUD element which shows how many ammo is left.

hudchargebar(CHARGE, TOTAL)

Parameters:
CHARGE - current charge value
TOTAL - maximum charge value
Draws a 'charge bar' HUD element which shows the charge power of your weapon.
CHARGE has to be <= TOTAL. The bar is full as soon as CHARGE equals TOTAL.

hudcrosshair([X OFFSET=0], [Y OFFSET=0])

Parameters:
[X OFFSET=0] - crosshair x offset
[Y OFFSET=0] - crosshair y offset
Draws a crosshair for the current player. Use X OFFSET and Y OFFSET to adjust the crosshair position.

hudinfo('TEXT', [CURRENT ONLY=1], [RED=255], [GREEN=255], [BLUE=255])

Parameters:
'TEXT' - info text
[CURRENT ONLY=1] - show for current player only?
[RED=255] - color red (0 to 255)
[GREEN=255] - color green (0 to 255)
[BLUE=255] - color blue (0 to 255)
Displays TEXT at the screen.
By default this message is only displayed for the current player. All other players don't see it. Use 0 for CURRENT ONLY if you want everyone to see the message.
The color of TEXT is white by default. You can use the RED, GREEN and BLUE parameters to change this color.

Attention: The weapon selection menu has to be closed to see TEXT!

hudmapborder()

Draws a red border around the map (the same border is also displayed in certain positioning modes)

hudpositioning(MODE, [IMAGE=0], [RANGE=100], [TERRAIN=1], [PLAYERS=1], [OBJECTS=1])

Parameters:
MODE - positioning mode
[IMAGE=0] - optional ID of image which will be positioned
[RANGE=100] - positioning range around the player
[TERRAIN=1] - check col. with terrain
[PLAYERS=1] - check col. with players
[OBJECTS=1] - check col. with objects
Lets the player define a position by left-clicking the map. A valid click will then set some Lua variables.
There are different modes availabe:

pos_normal: free positioning, RANGE doesn't matter, an X marks the position

pos_invisible: same as pos_normal but without the X

pos_build: positioning within RANGE around the player, also displays the borders of the map

pos_range: positioning within RANGE around the player, doesn't show borders of the map

This command affects 3 global weapon variables. As soon as the player clicks a valid position it will set:
weapon_position = 1
weapon_x = clicked X coordinate
weapon_y = clicked Y coordinate

Use IMAGE to define an image which will check collisions at the clicked position. The position will only be accepted when this image does not collide with terrain/players/objects (depending on TERRAIN, PLAYERS and OBJECTS). The image will also be drawn at the players mouse position when using pos_build as MODE. Just use 0 for IMAGE if you do not want to use an image.

hudtimer(INITIAL, [MIN=1], [MAX=5])

Parameters:
INITIAL - initial timer value
[MIN=1] - minimum timer value (1-10)
[MAX=5] - maximum timer value (1-10)
Draws a 'timer bar' HUD element which shows the current weapon timer setting. The setting can be changed in-game with the numeric keys (1,2,3,4,5,6,7,8,9,0[=10]) on the keyboard and will be saved in the global Lua variable weapon_timer.
By default the timer ranges from 1 (minimum) to 5 (maximum).
It will be automatically set to the initial value on each turn/weapon change.