Sound script

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Sound script

Post 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,
	}
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Sound script

Post by THOM »

Got it! Sometimes looking into the original-definition can be helpful... :roll:

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,
	}
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
trancelistic
Posts: 275
Joined: Sat Jun 16, 2012 5:32 am

Re: Sound script

Post 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"
SpoilerShow
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
Post Reply