kts.Sound

Name

kts.Sound – create a Sound

Synopsis

result = kts.Sound(filename)

Description

A Sound represents a sound file (.wav file) that can be played during the game.

To create a Sound, call kts.Sound passing the filename of a valid .wav file. For the time being, this must refer to a file in the knights_data/client/std_files/ folder. Only alphanumeric characters, underscores and dots are allowed.

Once a Sound has been created, it can be passed to kts.PlaySound to play the sound at appropriate times during gameplay.

Return Value

The return value is the newly created Sound (a Lua userdata object).

Bugs

Currently only sound files shipped with the game (in the std_files folder) can be loaded. This prevents mods from including their own graphics. A future version of Knights will rectify this by allowing mods to load graphics from their own directory (or from other mods that they "depend" on).

See Also

kts.Graphic

kts.PlaySound