"UserLabled" parameter scripting

Hi, everybody!
I’m trying to create labeled parameter via script. Unfortunately I couldn’t find any information about that and my script doesn’t work.
How I can to define a labels in addGameParameter() method?
How I can to define initial value?
And how to use addParameterCondition() with labeled parameter correctly?

This example works for me:

var param = event.addGameParameter(“”);
param.preset.presetOwner.name = “Test Parameter”;
param.preset.parameterType = 2;
param.preset.minimum = 0;
param.preset.maximum = 3;
var paramList = [‘First Label’, ‘Second Label’, ‘Third Label’];
param.preset.enumerationLabels = paramList;

initial value example:

param.preset.initialValue = 1

and then:

singleSound.addParameterCondition(param.preset, 2);

to add a trigger condition (Third Label here).

Thank you, alexzzen. It works! :slight_smile:

1 Like