I seem to lose the sound handle of background sounds when restoring a save game. But DSB is still playing that sound upon restore -- and I can't stop it without a handle ID.
Is there a way to either
* ensure the handle is retained when saving?
* or stop all sounds upon restore even if the handle has been lost (and then run my own code to re-initialise and re-start any necessary sounds -- mainly background ambience)
Stopping sounds with a lost sound handle?
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: Stopping sounds with a lost sound handle?
You can save the handle by putting it in a variable that you dsb_export, or adding it to an exported table. If you control background sounds with some object in the dungeon, you can also store it in that object's exvar which is also saved.
This should probably do what you want it to, but I could add some brute-force way to stop all sounds if that is needed.
This should probably do what you want it to, but I could add some brute-force way to stop all sounds if that is needed.
- Gambit37
- Should eat more pies
- Posts: 13715
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Stopping sounds with a lost sound handle?
Great, thanks, I'll see if storing the sound handle upon save works.
- Gambit37
- Should eat more pies
- Posts: 13715
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Stopping sounds with a lost sound handle?
So after a lot of experimenting, I think a brute force stop_all_sounds() function would be very, very useful. Please would it be possible for you to add one?