Hello team FMOD!
The game I’m currently working on has a lot of characters that share a similar setup for their sound events. I’m writing a script to automate the import process. Here’s what I’m trying to achieve:
- Using currently selected audio assets in FMOD Studio (working).
- Grouping files with the same prefix (differing only in variation numbers) (working).
- Creating events with a track that contains a multi-instrument for each group (working).
- Adding volume and pitch modulators to the multi-instrument (working).
- Placing events in the correct folder structure - (not working yet).
- Setting the length of the created multi-instrument to the length of the contained assets (not working yet).
- Assigning the created event to a bank that corresponds to the character name (not working yet).
I got quite a lot working already, but I’m having trouble with the last three parts (properly assigning an event folder to the newly created event, adding it to a bank and setting the length of the created multi-instrument to the length of its content, like the corresponding context menu item).
I manage to put the event in the events master folder, using this code:
var myEvent = studio.project.create("Event");
myEvent.name = eventName;
// Set the events folder to the root event folder.
myEvent.folder = studio.project.workspace.masterEventFolder;
For the bank assignment and resizing the multi-instrument I haven’t managed to get anything working yet.
Could you point me in the right direction as to which functions to use for these tasks?
If it helps, I’m happy to share the script I’ve created so far!