Author Topic: How to keep your gTheSoundFX from interupting gTheMusic  (Read 5635 times)

0 Members and 1 Guest are viewing this topic.

Offline Cloudee1

How to keep your gTheSoundFX from interupting gTheMusic
« 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.


Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline MusicallyInspired

Re: How to keep your gTheSoundFX from interupting gTheMusic
« Reply #1 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.
« Last Edit: September 15, 2010, 10:59:37 PM by MusicallyInspired »
Brass Lantern Prop Competition

Offline Cloudee1

Re: How to keep your gTheSoundFX from interupting gTheMusic
« Reply #2 on: September 23, 2010, 07:08:15 PM »
Are you ever going to elaborate?
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline MusicallyInspired

Re: How to keep your gTheSoundFX from interupting gTheMusic
« Reply #3 on: September 24, 2010, 08:08:29 AM »
Elaborate on what exactly?
Brass Lantern Prop Competition

Offline Cloudee1

Re: How to keep your gTheSoundFX from interupting gTheMusic
« Reply #4 on: September 24, 2010, 09:07:11 AM »
What were you thinking that this actually did, or hoped it would do?
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline MusicallyInspired

Re: How to keep your gTheSoundFX from interupting gTheMusic
« Reply #5 on: September 24, 2010, 06:53:09 PM »
Allow to play two sounds at the same time.
Brass Lantern Prop Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.052 seconds with 23 queries.