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. As usual, if the filename begins with a "+" character then it refers to one of the standard files shipped with the game (in knights_data/client/std_files), otherwise it refers to a file included as part of the current mod. (In the latter case, the WAV file data will automatically be downloaded to the client in network games, so there is no need to install the mod on each player's computer individually.)

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).

Notes

The Steam version of Knights will disable the automatic downloading of sound files from the server, for security reasons. Instead, Steam Workshop will (most likely) be used for managing mods. Players would have to make sure they have any required mods downloaded and installed locally, before joining any game that has been configured to use mods.

See Also

kts.Graphic

kts.PlaySound