Page 4 of 4
Re: Sound script
Posted: Sun Mar 16, 2014 7:35 pm
by THOM
Can anyone explain me how to group sounds? I have two sounds for "alarm" and I want to have them played randomly (like the damage-sounds for the party or others). But I don't know how to define a sound-group. All I get is, that one sound overrides the other...
I have tried this:
Code: Select all
defineSound{
name = "alarm",
filename = "mod_assets/sounds/alarm1.wav",
loop = false,
volume = 1.5,
minDistance = 1,
maxDistance = 7,
}
defineSound{
name = "alarm",
filename = "mod_assets/sounds/alarm2.wav",
loop = false,
volume = 1.5,
minDistance = 1,
maxDistance = 7,
}
Re: Sound script
Posted: Sun Mar 16, 2014 7:38 pm
by THOM
Got it! Sometimes looking into the original-definition can be helpful...
Code: Select all
defineSound{
name = "alarm",
filename = {
"mod_assets/sounds/alarm1.wav",
"mod_assets/sounds/alarm2.wav",
},
loop = false,
volume = 1.5,
minDistance = 1,
maxDistance = 7,
}
Re: Sound script
Posted: Thu Aug 28, 2014 7:14 pm
by trancelistic
I had a problem playing a short ( or long) song. If the puzzle would be the value of not opening the door it would still play the song.
So if you tried the puzzle a few times and still didnt solved it then the song will duplicate and duplicate itself so in the ends its like you're playing 100 songs, each starting at a different timeline resulting in insane chaos echo:)
Anyhows I solved it with "lever_6"
function pullLever()
if lever_4:getLeverState() == "activated" and
lever_5:getLeverState() == "activated" and
lever_7:getLeverState() == "activated" and
lever_8:getLeverState() == "deactivated"
then
dungeon_door_wooden_locked_6:open()
else
dungeon_door_wooden_locked_6:close()
end
if lever_4:getLeverState() == "activated" and
lever_5:getLeverState() == "activated" and lever_6:getLeverState() == "deactivated"
then
lever_6:toggle()
-- this lever is located in solid rock, so its unreachable.
-- It prevents the song to be played double/tripple etc. the" loop = false" doesn't preventt that.
-- I though I'd share it with you.
playSound("muziek2")
end
end