Creating a condition for a sound

Hi!
I’m very new and am trying to learn FMOD a little bit more… And I am at the moment trying to create a situation where a sound only triggers once, but is attached to two events. My goal is that if both events happen, the second event chooses not to play the asset once again.

To explain it in another way: I have a situation where event B can happen, and event A+B can happen (letters for chronological order) ((A cannot happen alone)).
A has one original asset + the asset it shares with B (2 sounds in total).
B also has one original asset + the asset it shares with A.
If A+B happens, I want the shared sound to happen during A but not during B.
If only B happens, the shared sound needs to be triggered during B.

What I would LIKE to do: make B somehow feel that A has been triggered very recently and only play its original asset, but not the shared one.

I feel like my explanation is a word salad, but I hope someone understands me :slight_smile:

Hi,
Are you talking about “events” in a general sense, or FMOD events?
Can you tell more about the content? Is there a loop involved? What’s the common part length, compared to A and B?

The content are simple one-hit SFX. 2 sec long all three of them.
If A+B happens, they don’t happen simultaneously.

To try to be more specific. B is a death sound of the character dying. If she dies, I want to add a little scream. However, if she falls of a cliff towards her death another sound is played (A) about a second before the death sound. If this happens I want the scream to happen during A, but I don’t want her to scream again when her death event (B) is triggered. It would sound odd with 2 screams.

Why not simply have 2 different events, one for the normal death, one for the cliff fall, and the game code will only call the appropriate one?

I agree :slight_smile: But I don’t think I can affect the game calls in any way? The game is already made and these two events are what the game calls for. Sorry, very new to this, so I don’t quite know my options.

So to be clear, the problem occurs when there’s a cliff fall, because the game calls a first event specific to the cliff fall (which you’d like to be the death scream) and then it calls the standard death scream (which you’d like not to be played in this case). Am I correct?
What’s the 3d sound?

Kinda. The cliff fall calls an event that plays a negative sound effect (like “death is imminent” kinda thing), then the actual death plays a little “boom”. The scream itself is the 3rd sound.

By 3d sound, I meant the sound you didn’t mentioned previously. You said there were 3 sounds, a death sound, a scream, and?..
Can you tell what sound is A, what sound is B and what sound is the common one?

Haha sorry, I’m not explaining this very well.

A- a “negative” SFX (can’t explain it better) ((the cliff fall))
B- a small boom ((the actual death))
Common- Scream

The solution, not very elegant, is to use a global boolean parameter (say “Cliff fall”), set to 0 by default. When the cliff fall event occurs, pass 1 to Cliff fall by a command instrument. In the death event, condition the sound you don’t want to hear, to not trigger when Cliff fall=1, then do a command instrument to reset the parameter to 0.

Aah I see. Makes sense!
Ok, so the reset parameter at the end is then because otherwise it wouldn’t reset naturally and then the scream wouldn’t happen anymore during B?

Exactly.

1 Like

If the player pauses the game exactly between the two events and restarts the level, there could be a case where the parameter isn’t reset :slight_smile:

Hmm I was thinking about that… I’ll see how it works out and get back to you.
Thank you so much for explaining it all btw :slight_smile:
Mike

Easy to work around, though: also reset the parameter with a command instrument in other events, like the one being played when starting a level.