OK, some sound related questions
1) How do I play different sounds for different types of doors opening/closing? Is there a property I can set in door archs, I couldn't find one?
2) How do I play a "one-shot" ambient sound? (Not looped)
3) Related to #2, there seems to be a "noloop = false" exvar, but it doesn't work? At least, I have that exvar on one of my sound objects, no idea where it came from
Sound Questions
Moderator: Sophia
Forum rules
Please read the Forum rules and policies before posting.
Please read the Forum rules and policies before posting.
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: Graphics Replacement in DSB
Yes, it's move_sound.Gambit37 wrote:How do I play different sounds for different types of doors opening/closing? Is there a property I can set in door archs, I couldn't find one?
Set the exvar no_loop to true. (Don't forget the underscore!)Gambit37 wrote:How do I play a "one-shot" ambient sound? (Not looped)
- Gambit37
- Should eat more pies
- Posts: 13720
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Sound Questions
Sorry about putting those questions in the graphics thread, oops!
It appears that all door sounds are played four times: is this hardcoded or can I override it? I know I could play a local "one_shot" ambient sound instead using dungeon mechanics, and set the door itself to silent, but I wondered if there's a way of overriding the four repeats in the arch itself?
It appears that all door sounds are played four times: is this hardcoded or can I override it? I know I could play a local "one_shot" ambient sound instead using dungeon mechanics, and set the door itself to silent, but I wondered if there's a way of overriding the four repeats in the arch itself?
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: Sound Questions
It's hardcoded. However, this is something that is easy for me to change in the base code.
For 0.55, you'll be able to specify, by doing this:
(Open and close sound should be obvious; reverse sound is what plays if the door bangs into something on the way down and changes direction)
For 0.55, you'll be able to specify, by doing this:
Code: Select all
obj.my_door.move_silent = true
obj.my_door.open_sound = snd.one_time_clank
obj.my_door.close_sound = snd.one_time_clank
obj.my_door.reverse_sound = snd.one_time_clank
- Gambit37
- Should eat more pies
- Posts: 13720
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Sound Questions
He he, awesomeSophia wrote:(Open and close sound should be obvious; reverse sound is what plays if the door bangs into something on the way down and changes direction)
- Gambit37
- Should eat more pies
- Posts: 13720
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Sound Questions
Can I stop a looped sound attached to a monster?
I revisited my code for the buzzing insect that swaps between a walking state and a flying state. When I use qswap to switch the flying version to the walking version, the looped flying sound effect is still playing and gets "left behind" on the tile where the creature was last in its flying state.
How do I fix this?
I revisited my code for the buzzing insect that swaps between a walking state and a flying state. When I use qswap to switch the flying version to the walking version, the looped flying sound effect is still playing and gets "left behind" on the tile where the creature was last in its flying state.
How do I fix this?
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: Sound Questions
In whatever code that you do the dsb_qswap, you also need to call stop_sound_handle with an appropriate description. For example, if you have a looping step_sound, do this:
Code: Select all
stop_sound_handle(id, "step_sound")
- Gambit37
- Should eat more pies
- Posts: 13720
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Sound Questions
Aha, right, I didn't know about this function. Where should this go in the Wiki, since it's not a dsb_ function?
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
Re: Sound Questions
We should probably make a separate page for utility functions that are defined as part of the base code.
Right now, what little documentation there is about these is mixed in with the dsb_* functions.
On the other hand, I'm not sure if the end user reading the documentation cares whether the function is defined as part of the base code or as part of the core-- they just want to know what the functions are. So maybe we should just mix them in and change the name of the page.
Right now, what little documentation there is about these is mixed in with the dsb_* functions.
On the other hand, I'm not sure if the end user reading the documentation cares whether the function is defined as part of the base code or as part of the core-- they just want to know what the functions are. So maybe we should just mix them in and change the name of the page.