Is there a way to access FMOD_STUDIO_PARAMETER_ID within a Studio Script?

Hey there,
I’m working on a small Fmod Studio tool where I need to access FMOD_STUDIO_PARAMETER_ID, yet I couldn’t find a way to go even into parameter descriptions. Is there a way to access that info within a Studio Script?

Hi,

With a parameter selected in the Preset Browser


using the console you can access its ID using:

studio.window.browserCurrent().id
{e9b7aafa-2df0-4193-b32e-a74e5753cfa0}

Is this what you were looking for?

If not, would it be possible to elaborate on what the script is aiming to do?

Hey Connor, that appears not the ID I’m looking for :slight_smile:

I’m looking for FMOD_STUDIO_PARAMETER_ID-type value, where I pass to SetParameterByID function.

1 Like

Hi,

I see, would it be possible to see the full script or could you elaborate on what you are trying to do with the script?

Thanks

Hey Connor, we’re trying to parse all event IDs to be passed to our dedicated server which doesn’t do FMOD at all yet still needs to know these IDs beforehand. Luckily we have access to the Source Code and found out how you generate those IDs. We’ll be mimicking that and all will be good.

Still, I think you need to come up with a way to access this ID for customers that doesn’t have Source code access.

Cheers,

1 Like

Hi,

Good to hear you found a solution. I will pass your suggestion on to our development team to look into further.

Would it be possible to share how PARAMETER_IDs are generated? I am attempting something similar: to bake the PARAMETER_IDs to a C# file whenever banks are built in FMOD.

I haven’t been able to find a way to access the PARAMETER_ID in FMOD’s javascript scripting engine. Is there some way I’m not aware of?

Ultimately, we want to provide access to PARAMETER_ID within FMOD Studio, however currently that’s not possible. Considering it’s not possible, and having an immediate solution would be beneficial, I will share how we generate them. Be advised that we reserve the right to change the implementation at a later date.

The method is simple, we use a hash of the GUID using the hashlittle2 algorithm, which is a public domain algorithm you can get here.

Here is the usage from our source:

FMOD_GUID temp = guid;
FMOD_STUDIO_PARAMETER_ID id = { 0, 0 };

hashlittle2(&temp.Data1, sizeof(temp.Data1), &id.data1, &id.data2);
hashlittle2(&temp.Data2, sizeof(temp.Data2), &id.data1, &id.data2);
hashlittle2(&temp.Data3, sizeof(temp.Data3), &id.data1, &id.data2);
hashlittle2(temp.Data4, sizeof(temp.Data4), &id.data1, &id.data2);