Calling event with a non-used local parameter causes FMOD to report an error

Hey community & team FMOD!

I am using a couple of events which are shared between characters in my game. In order to personalize these events, I am using local parameters, which are set up in the character Unity prefab.

In the current setup, whenever the code calls one of those shared events, it sets all parameters defined for the character that is currently on screen.

This works, but… not all events are using all local parameters defined in the character.

When I call an event that doesn’t use a certain parameter, FMOD throws errors like this one:

(prm_bodyfall_size, huge) returned ERR_EVENT_NOTFOUND for STUDIO_EVENTINSTANCE (0x213980).

Since the events trigger and play back fine, shouldn’t this be a mere warning, rather than an error?

My workaround to fix this is to add a dummy track to each offending FMOD event, and add parameter curves for each ‘missing’ parameter to the volume button.

Is this a feasible fix, or would adding those additional parameter curves cause a significant increase in processing load?

Could you think of another fix (apart from somehow defining which event needs which parameters, which would be more complicated than just adding those curves)?

1 Like

Hi,

Thank you for the information.

Could I please grab your Unity and FMOD integration versions please?

Not necessarily, as this is informing you the error you are trying to set could not be found rather than being related to the event being played. So it is still required to be an error.

No, having the parameters present will not greatly affect performance.

An options would be checking which parameters the event has before attempting to set them.
Something like:

EventInstance.getDescription(out FMOD.Studio.EventDescription eventDesc);

eventDesc.getParameterDescriptionCount(out int count);
List<string> paramnames = new List<string>();
for (int i = 0; i < count; i++)
{
    eventDesc.getParameterDescriptionByIndex(i, out FMOD.Studio.PARAMETER_DESCRIPTION paramDesc);
    paramnames.Add(paramDesc.name);
}

// Then using the name list, you can check if the param exists before trying to set it. 
if (paramnames.Contains("prm_bodyfall_size"))
{
    // set parameter here
}

Hope this helps!