sound help please.
Posted: Sun Sep 01, 2013 4:18 am
I'm trying to get my custom gong to work in game but I am having an issue with the sound.
I have a define sound in my .lua file
Then I put a lua script activated by a wall button that opens a door and playSound("gong_hit"). That works ok, door opens and sound plays fine.
In my gong definition I have a function call onDamage which calls the lua script and again the door opens and the gong sound plays.
When I take out the dashes in front of the hitSound parameter (and edit out the playSound() in the lua script) then the barrel_hit sound plays whenever the party hits the the gong.
Everything is great to this point. But when I change the hitSound to hitSound = "gong_hit" as soon as I hit the gong the game crashes to desktop with no error report generated. I have gone over my typing a dozen times looking for something but can't find anything.
In summary gong_hit sound works in a playSound() lua script, gong calls the function when hit, gong plays stock sound ok but when it tries to play the custom sound (which works in a playSound() script) game crashes without error report.
Any ideas?
I have a define sound in my .lua file
SpoilerShow
defineSound{
name = "gong_hit",
filename = "mod_assets/RG_assets/RG_gong/sounds/gong.wav",
loop = false,
volume = 2,
minDistance = 2,
maxDistance = 10,
}
name = "gong_hit",
filename = "mod_assets/RG_assets/RG_gong/sounds/gong.wav",
loop = false,
volume = 2,
minDistance = 2,
maxDistance = 10,
}
Then I put a lua script activated by a wall button that opens a door and playSound("gong_hit"). That works ok, door opens and sound plays fine.
In my gong definition I have a function call onDamage which calls the lua script and again the door opens and the gong sound plays.
SpoilerShow
defineObject{
name = "RG_gong",
class = "Blockage",
model = "mod_assets/RG_assets/RG_gong/models/RG_gong.fbx",
brokenModel = "mod_assets/RG_assets/RG_gong/models/RG_gong.fbx",
placement = "floor",
health = 300000,
evasion = -10000,
-- hitSound = "barrel_hit",
-- hitEffect = "hit_wood",
onDamage = function(self)
gong.soundGong()
end,
editorIcon = 56,
}
name = "RG_gong",
class = "Blockage",
model = "mod_assets/RG_assets/RG_gong/models/RG_gong.fbx",
brokenModel = "mod_assets/RG_assets/RG_gong/models/RG_gong.fbx",
placement = "floor",
health = 300000,
evasion = -10000,
-- hitSound = "barrel_hit",
-- hitEffect = "hit_wood",
onDamage = function(self)
gong.soundGong()
end,
editorIcon = 56,
}
Everything is great to this point. But when I change the hitSound to hitSound = "gong_hit" as soon as I hit the gong the game crashes to desktop with no error report generated. I have gone over my typing a dozen times looking for something but can't find anything.
In summary gong_hit sound works in a playSound() lua script, gong calls the function when hit, gong plays stock sound ok but when it tries to play the custom sound (which works in a playSound() script) game crashes without error report.
Any ideas?