Page 1 of 1

Issue with custom sound (game crash)

Posted: Fri Sep 14, 2012 1:09 pm
by n0th1n9
Hi,

I started working on a custom dungeon and added a custom sound to it.

To do so I added my wav file in the sounds folder, and edited the sounds.lua file in the "mod_assets\scripts" folder and added :

Code: Select all

defineSound{
name = "evil",
filename = "mod_assets/sounds/evil.wav",
loop = false,
volume = 1,
minDistance = 30,
maxDistance = 32,
}
Then I added a lua script entity to my dungeon triggered by a pressure plate :

Code: Select all

function evil()
	playSound("evil")
end
At this point I had to restart the dungeon editor to make the whole thing work and hear my sound in the preview mode.
I don't know if this is normal or not... Anyway I managed to hear my sound in preview mode.

But, after exporting my dungeon I tried it in the game and got that message :
Image

Here is the error log :
SpoilerShow
[string "SoundSystem.lua"]:0: Seek failed on file mod_assets/sounds/evil.wav
stack traceback:
[C]: in function 'load'
[string "SoundSystem.lua"]: in function 'defineSound'
mod_assets/scripts/sounds.lua:5: in main chunk
[string "Dungeon.lua"]: in function 'import'
mod_assets/scripts/init.lua:13: in main chunk
[string "Dungeon.lua"]: in function 'loadInitFile'
[string "GameMode.lua"]: in function 'loadDungeon'
[string "GameMode.lua"]: in function 'newGame'
[string "GameMode.lua"]: in function 'startGame'
[string "NewGameMenu.lua"]: in function 'startGame'
[string "NewGameMenu.lua"]: in function 'update'
[string "GameMode.lua"]: in function 'update'
[string "Grimrock.lua"]: in function 'display'
[string "Grimrock.lua"]: in main chunk

OS Version 6.1

OEM ID: 0
Number of processors: 8
Page size: 4096
Processor type: 586

Total memory: 6068 MB
Free memory: 3347 MB

Display device 0:
Device name: \\.\DISPLAY1
Device string: NVIDIA GeForce GTX 460M
State flags: 00000005

Display device 1:
Device name: \\.\DISPLAY2
Device string: NVIDIA GeForce GTX 460M
State flags: 00000000

Display device 2:
Device name: \\.\DISPLAYV1
Device string: RDPDD Chained DD
State flags: 00000008

Display device 3:
Device name: \\.\DISPLAYV2
Device string: RDP Encoder Mirror Driver
State flags: 00200008

Display device 4:
Device name: \\.\DISPLAYV3
Device string: RDP Reflector Display Driver
State flags: 00200008
Is it a bug or am I wrong somewhere?

Re: Issue with custom sound (game crash)

Posted: Thu Oct 18, 2012 3:04 pm
by Mebaru
I second this! Game is crashing with custom sounds, while they are played without problems in dungeon editor preview.

Re: Issue with custom sound (game crash)

Posted: Thu Oct 18, 2012 3:31 pm
by msyblade
Your strings look good and all, you may try removing the indent from "playSound" line, and also try it without the min/max distance lines just to narrow down the variables. also try converting the wav file thru

http://media.io

and see if perhaps youre having a compatability issue.

Re: Issue with custom sound (game crash)

Posted: Thu Oct 18, 2012 3:45 pm
by Mebaru
I've made a few test and game is crashing when sound is in stereo (though it works without problems in editor).