so my issue is that i get a stackoverflow on my etitly script from the playsound
defineSound{
name = "rat_2",
filename = "mod_assets/samples/dungeon/rats_2.wav",
loop = false,
volume = 1,
minDistance = 1,
maxDistance = 1,
}
and my scripte et.
function playSound()
playSound ("rats_2")
sound scripting
Re: sound scripting
I'm not sure.
Have you tried
Also, your playSound says "rats_2"
but your defined sound is "rat_2"
This sort of error is almost always just a typo.
Have you tried
Code: Select all
function playSound()
playSound ("rats_2")
endbut your defined sound is "rat_2"
This sort of error is almost always just a typo.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!
- JohnWordsworth
- Posts: 1397
- Joined: Fri Sep 14, 2012 4:19 pm
- Location: Devon, United Kingdom
- Contact:
Re: sound scripting
Suggestions...
1. As Neikun said, make sure you call 'playSound(...)' with the same name that you have defined in your defineSound command.
2. Make sure your function has a unique name that doesn't hide an existing function. If the function you are making is indeed called playSound, then when you try to call 'playSound' from within that function you are calling that function from within itself, which is causing infinite recursion (that would cause a crash). You might want to use a different name for your function to play that SFX.
3. If your wav file is of an invalid format, that too can cause a crash / problems. I've outlined a bunch of settings I have successfully used here: http://grimwiki.net/wiki/Custom_Sound_Tutorial
1. As Neikun said, make sure you call 'playSound(...)' with the same name that you have defined in your defineSound command.
2. Make sure your function has a unique name that doesn't hide an existing function. If the function you are making is indeed called playSound, then when you try to call 'playSound' from within that function you are calling that function from within itself, which is causing infinite recursion (that would cause a crash). You might want to use a different name for your function to play that SFX.
Code: Select all
function playRatSound()
playSound("rat_2");
endMy Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
Re: sound scripting
Also, for future reference, please don't post the same question in multiple spots because you hadn't received an answer yet.
The best course of action is to start your own thread as you've done here. And then simply bump if you feel your question has been forgotten. If the topic is still on the first page, it's too early to bump.
Welcome to the forums! =D
The best course of action is to start your own thread as you've done here. And then simply bump if you feel your question has been forgotten. If the topic is still on the first page, it's too early to bump.
Welcome to the forums! =D
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!
-
dukester70
- Posts: 21
- Joined: Thu May 16, 2013 11:31 pm
Re: sound scripting
thank you all for the help will try out the links and sorry for being impatient and posting everywhere... again thank you and will tell how it worked out.... 
-
dukester70
- Posts: 21
- Joined: Thu May 16, 2013 11:31 pm
Re: sound scripting
thank you all again .... and thank you john ... i did have to rename the playsound and add the rat to it and it worked 
