How can I get sheet content by javascript?

This has some relevance to my last post, see: About WebGL project load bank and memory useage

I’m going to analyze the dependencies in an Event for other Banks via JavaScript.
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
1 Like

I have a more similar question, how do I get the Action Sheet and Timeline Sheet for Event?
Also, is event.parameters the mapping to the Parameter Sheet?

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[0].commandType.
The Value parameter seems to correspond to actionSheet.modules.sounds[0].targetValue.
The Target parameter seems to correspond to actionSheet.modules.sounds[0].commandTarget, which is an instance of ManagedObject:GameParameter.

I don’t know if my speculation is correct.

In actionSheet.modules.sounds[0].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.

Please see our documentation on model.GameParameter and model.ParameterPreset for more info.

1 Like

Do you mean:

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.