HELP: How can i play an .ogg sound file
Posted: Sat Sep 15, 2012 10:37 am
How can I play a .wav or .ogg sound triggered by an hidden pressure plate?
Thanks.
Thanks.
Official Legend of Grimrock Forums
https://mail.almosthumangames.com/forum/
https://mail.almosthumangames.com/forum/viewtopic.php?t=3129
Code: Select all
playSound("level_up")Code: Select all
function playLevelUp()
playSound("level_up")
endIf i got an external file, i must mention the extention or simply the name? And, the this function will watch in the asset/sound folder automaticaly?Shroom wrote:You can find a list of these sound assets http://www.grimrock.net/modding/list-of ... ed-sounds/Code: Select all
playSound("level_up")
So create a function in a lua entity
Then add a connector from the plate, to the enity and select the function you wantCode: Select all
function playLevelUp() playSound("level_up") end
You need to define a new sound asset and refer to the asset's name from you level script. Add something like this to your sounds.lua:Daght wrote:If i got an external file, i must mention the extention or simply the name? And, the this function will watch in the asset/sound folder automaticaly?Shroom wrote:You can find a list of these sound assets http://www.grimrock.net/modding/list-of ... ed-sounds/Code: Select all
playSound("level_up")
So create a function in a lua entity
Then add a connector from the plate, to the enity and select the function you wantCode: Select all
function playLevelUp() playSound("level_up") end
Code: Select all
defineSound{
name = "cool_sound",
filename = "mod_assets/sounds/cool_sound.wav,
loop = false,
volume = 0.8,
}
Code: Select all
function playCoolSound()
playSound("cool_sound")
end