0
0

Hi everyone,
I am currently creating a script for FMOD studio using FMOD Studio’s tool scripting API using Javascript. I have accomplished creating an event and adding it to the master bank manually and via script. With my event selected, I am also able to manually create a game parameter by pressing the “+” tab > “Add Parameter” > “New Parameter”. Under “Name:”, I typed “engine_rotation_speed_rad_sec[*]”, pressed “OK”, and the parameter was created successfully with the name on the tab.
My Problem is when I try to create a parameter via script. When I try to set the name to “engine_rotation_speed_rad_sec[*]” or “engine_rotation_speed_rad_sec[\*]” I get a message saying “The following characters are not parmitted: <>:”/\|?*”, and the parameter name remains undefined. Even when I tried “myParameter = studio.project.workspace.addGameParameter(“User”);”, the same message appears when I try “myEvent.addGameParameter(myParameter)”.

What frustrates me is that I am able to name a property manually using the same characters prohibited in the script. Is there a workaround to naming the parameters using those characters via the script instead of having to manually name each of them each time?

  • You must to post comments
1
0

Hi Zachary,

This is a known issue we are working on. The scripting output is the correct behaviour – you should not be able to add these characters to a parameter’s name.

In regards to creating game parameters via scripting, it’s a little more complicated than that.

You will need to first use “addGameParameter” on the event you wish to add it to. The code you pasted is trying to add a parameter to the project itself.

Once you have the event, you need to add the properties of the parameter with the following format:

eventVariable.addGameParameter({ 
    name: "Test", 
    type: studio.project.parameterType.User, 
    min: -1, 
    max: 20 
});

If you have further questions on scripting, please let us know.

Thanks,
Richard

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.