I have an event that I need to have loaded at all times. It is a one-shot sound that is triggered when I get a parameter value of ‘0’. From there, it has a velocity that quickly moves the parameter to 1.0, which hits a sustain point. From there, I can quickly give the event another 0 to retrigger it. Effectively, I’m just pausing the event after it plays.
However – on level start, the event gets enabled for the first time and is instanced with the parameter at 0 – so I hear it on level start, which I don’t want.
Is there a way for me to force the event to get enabled with a parameter value other than 0?
- Symbiotic asked 10 years ago
There wasn’t any particular reason – I just don’t like having to go back to my engineer to have him enter in new values if I can work around it within designer.
Anyway, I had forgotten that I could set the parameter start and end values to anything, so I set start to -.1 and end to 1, with a sustain point just before zero and just after the event.
This effectively starts the event as silent – parameter moves (via velocity) to -.000001 (or so) and sustains. We send a value of 0 which triggers the sound definition – and the event sustains again after that. Then, we just keep sending a new ‘0’ to the event anytime we want to retrigger it. Works like a charm!
Sure – the main reason is that it is easier for me to have a single event enabled and ‘always on’ rather than enable and disable the event (of which I only want to allocate enough memory for one instance).
You can’t ‘restart’ an event before it has finished playing – unless you manually stop it. If you stop it, the sound stops playing, which doesn’t work for this particular sound. The only way around that is to allow for more than one instance, which costs memory.
Instead, I can simply enable one instance, and retrigger the sound definition multiple times – I’m only allocating memory for the one instance, and getting the exact behavior I want.
Please login first to submit.