Community

SCI Programming => SCI Community How To's & Tutorials => Topic started by: Cloudee1 on September 15, 2010, 08:47:48 PM

Title: How to keep your gTheSoundFX from interupting gTheMusic
Post by: Cloudee1 on September 15, 2010, 08:47:48 PM
Ok, so I admit that I know very little about our sound and music / coding possibilities. What I do know is that in the first room of my game there is music playing as well as a repetitive soundfx (water dripping) and every time it played it would interfer with the music. First I tried playing around with a priority property, but nothing ever really came of that. Then I figured I would just make a timer and count down to when the music should be over but I didn't want to add any more than necesary to my main script. Things are running pretty tight as it is. Anyway I started looking and it turns out that both instances have a state property built in. Then it just became a matter of checking for 0.
Code: [Select]
(if(== (send gTheMusic:state()) 0) (send gTheSoundFX:number(15)loop(1)play()))And there it is, the soundfx will no longer play until after the music has finished. Hope this helps someone else, it seems simple enough but I didn't know how to do it yet.
Title: Re: How to keep your gTheSoundFX from interupting gTheMusic
Post by: MusicallyInspired on September 15, 2010, 09:46:37 PM
Sweet! Up until now I thought this was impossible in SCI0 games!

EDIT: Ah, it's not exactly what I was hoping for (that'll teach me to skim excitedly). But still a great solution to an annoying problem. Nice find.
Title: Re: How to keep your gTheSoundFX from interupting gTheMusic
Post by: Cloudee1 on September 23, 2010, 07:08:15 PM
Are you ever going to elaborate?
Title: Re: How to keep your gTheSoundFX from interupting gTheMusic
Post by: MusicallyInspired on September 24, 2010, 08:08:29 AM
Elaborate on what exactly?
Title: Re: How to keep your gTheSoundFX from interupting gTheMusic
Post by: Cloudee1 on September 24, 2010, 09:07:11 AM
What were you thinking that this actually did, or hoped it would do?
Title: Re: How to keep your gTheSoundFX from interupting gTheMusic
Post by: MusicallyInspired on September 24, 2010, 06:53:09 PM
Allow to play two sounds at the same time.