utopia-rise / fmod-gdextension

FMOD Studio GDExtension bindings for the Godot game engine
MIT License
485 stars 52 forks source link

Is there a way to set an FMOD event parameter by label #186

Closed RetroSpecter closed 6 months ago

RetroSpecter commented 10 months ago

Currently trying to set up FMOD music transitions through labels thought I am not sure how to do that here.

Is there a method that I am missing, or if it is not implemented yet, a workaround to get it working?

below is the documentation from FMODs Event Instance class (not sure if it is entirely 1 to 1 with this libraries FmodEvent class) image

MindlessRuff commented 9 months ago

I'm new to using FMOD, but I was able to figure this out.

Here is my parameter with labels in FMOD (Note the column to the right where it says Value):

image

In Godot, I created an enum to correspond to each label value like so:

enum {MAIN_LOOP_INTRO, MAIN_LOOP_CURIOUS, MAIN_LOOP_EERIE, MAIN_LOOP_DRONE, MAIN_LOOP_GARBLED}

Then I was able to set the parameter like this (you can do this at the Event level too): FmodServer.set_global_parameter_by_name("mainLoopLevel", MAIN_LOOP_CURIOUS)

Hope that helps.

rune-scape commented 6 months ago

theres a missing method on FmodServer and FmodEvent :/

rune-scape commented 6 months ago

theres still a missing method by the same name in FmodServer, this should be reopened