Best practice for a sound effect that plays whenever a parameter is changed, but NOT when the event starts

Hi there, Im testing out an event right now, and basically I want a crash sound to play whenever the player steps on or off of a platform, so I have a simple parameter sheet right now set to play that sound when the parameter changes. However the sound also plays whenever the event starts (because the parameter will always be yes or no), and I cannot for the life of me work out a way to have it just ignore the parameter at the start of the event. Is there a better way I should be doing this?

There’s a number of ways to work around this. Off the top of my head:

  • Avoid creating an instance of the event until the player first gets onto or off the platform during a play session.
  • Add a third value to the parameter (perhaps something like “undeclared” or “maybe”) and make the new value be the parameter’s initial value. Of course, that may require you to change when and how your game sets the value of the parameter.
  • Rather than using one event instance that always exists, create two separate events, one for when the player enters the platform and one for when they leave it, and trigger them in your game accordingly.
  • If you know the player can’t possibly enter or leave the platform within the first ten seconds of their spawning into the level, you could automate the event’s volume on the timeline such that it’s silent for the first ten seconds after it starts. That way, even though the sound effect will play, it won’t be audible.
  • You could give the parameter a third value between “yes” and “no,” move the “no” instrument to the new value," add a seek modulator to the parameter’s value, and set that modulator to be asymmetric such that the seek speed is instant when ascending but but passes through the intervening takes a few moments when descending. Note that this method might produce undesirable results if the player gets onto and off the platform repeatedly in a short span of time.

Do any of those methods work for your purposes?

I do think the solution is going to be a separate event for this. The even itself is the music track for the level, so I cant have it start when the player enters the platform. Id love to have the crash happen on beat with the music but that is not necessary. Alternatively, having a 3rd state as the default may work too. This is my first time programming a game myself so I am very inexperienced there, but I may look into seeing in Godot if I can have the music even start in a 3rd state, then only switch to yes or no when the player enters or leaves the platform (I have since switched “platform” to a big invisible box around the area because I realized the platform made it so the crash played whenever the player jumped, lol)

Oh, you can do that. It’ll be compatible with the middle three of the suggestions I made - which is to say, with all of them except the first and last.

All you need to do is:

  1. Select one of your crash instruments.
  2. In the deck, expand the insturment’s “Trigger Behavior” drawer, and click the appropriate note type under where it says “Quantization Inteval.”
  3. Repeat the above for the other crash instrument.
  4. If you haven’t done so already, add a tempo marker to the event’s timeline, and set its BPM and time signature to define when beats occur.

Oh really? So say, if 2 events are both set to 90 bpm with a tempo marker, they will be synced with each other regardless of when each event starts? (In regards to the third option you listed)

Ah, no, sorry - I got my dot points confused when I was writing that answer. As you’ve intuited, they would need to be started at the same time. So, quantizing the instruments to your level’s music is only compatible with the second and fourth dot points, and potentially also with the fifth if you only need one of the two sounds to be quantized to the beat.