Currently I have an Event that has a Parameter Sheet, how should I get what Parameters the Parameter Sheet corresponds to, and what Events are on Tracks?
For example, I would like to be able to analyze the New Event in the diagram by code and know that it has a Parameter Sheet called TestParameterAAA.
The Parameter corresponding to Sheet TestParameterAAA is TestParameterAAA.
(I realized that the name of this Sheet seems to be linked to the name of the Parameter, and if the name of the Sheet is changed, the name of the Parameter is also changed)
TestParameterAAA has three values, Value A, Value B, and Value C. In this Sheet, they correspond to TestEvent1, TestEvent2, and TestEvent3.
Assuming you have a reference to your event as event already:
// list of all paremeters used by the event
// get name of parameter i
// get list of labels for values of parameter i
// get name of instrument j on parameter i
// get starting parameter value of instrument j on parameter i
// get length of instrument j on parameter i
// this is in case it spans multiple parameter values
I seem to be able to get all the ActionSheets by way of studio.project.model.ActionSheet.findInstances() and get which Event the ActionSheet exists in by way of actionSheet.event.
Is there a way to get if it has an ActionSheet by Event?
How do you get each Instrument in an ActionSheet? I guess maybe actionSheet.modules.sounds.
How do I get what specific action a Command Instrument performs?
I selected Set Parameter for Command Type in Command Instrument, which seems to correspond to actionSheet.modules.sounds.commandType.
The Value parameter seems to correspond to actionSheet.modules.sounds.targetValue.
The Target parameter seems to correspond to actionSheet.modules.sounds.commandTarget, which is an instance of ManagedObject:GameParameter.
I don’t know if my speculation is correct.
In actionSheet.modules.sounds.commandTarget, an instance of ManagedObject:GameParameter is available, but it does not have a member with name.
The ManagedObject:ParameterPreset is the instance with the name member, which is consistent with what is shown in FMOD Studio’s Preset Browser.
What is the relationship between ManagedObject:GameParameter and ManagedObject:ParameterPreset?
Action sheets are stored in the event.parameters array as an object of type ManagedObject:ActionSheet.
Internally, instruments in an action sheet are stored in a multi-instrument, so yes, actionSheet.modules.sounds is what you want.
Your speculation is correct.
A GameParameter is a parameter associated with an event, and can have a value which effects event behaviour - it can be a built-in parameter that has its value calculated by FMOD, or can have its value set by the user.
A ParameterPreset is an object representing a “preset parameter”, which is essentially a template for that specific type of parameter. The type, properties, default values, etc. of GameParameter are taken from the corresponding ParameterPreset.
When a Parameter is used on an Event, the various parameters initialized by that Parameter come from the ParameterPreset, and when the Parameter is modified, the various contents of the GameParameter may change, but the ParameterPreset does not change at all.
The ParameterPreset is like a “production template”, and every new GameParameter is created according to it.