Can you have scripts that are 'per project'?

I’m currently using fmod scripting api but for user scripts to show up it seems they must go in %localappdata% on a per machine level. When using source control and multiple develolpers it would be much nicer to have a script that’s only really valid for 1 project to be included in the project folder somehow. Is this at all possible?

Many thanks

Yes, this is possible!

As detailed in the FMOD Studio User Manual, FMOD Studio actually looks for script files in three different locations.

  • The system scripts directory is the one you’ve already discovered. It’s used for user-specific scripts, i.e.: for when there are multiple people who have accounts on the same computer, and they each have their own personal scripts:
    • Windows: %localappdata%/FMOD Studio/Scripts
    • Mac: ~/Library/Preferences/FMOD Studio/Scripts
    • Linux: ~/.config/fmod-studio/Scripts
  • The built-in scripts directory is for scripts that are shared by all accounts using the same computer:
    • Windows: %fmod_install_directory%/Scripts
    • Mac: %fmod_bundle%/Scripts
    • Linux: %fmod_install_directory%/Scripts
  • The project scripts directory is for scripts that are associated with a specific FMOD Studio project, and are shared by everyone working on that project:
    • %project_root_directory%/Scripts

Whenever you load a project in FMOD Studio, FMOD Studio automatically loads scripts from all three of these locations, so you can freely use all three of them in combination if you want.

In any case, it sounds like you want the project scripts directory. Just open your FMOD Studio project folder (i.e.: the folder that contains the .fspro file) and create a subfolder named “Scripts”. Then, put any script files you want to share inside that “Scripts” folder. If you do this while your FMOD Studio project is open, you will need to select “Scripts > Reload” before you can use them in FMOD Studio, and you will need to save the project before you can submit them to your source control repository.

oh perfect! Just tried and worked great, I must of completely missed that when looking it up, sorry :smiley:

I am struggling to get the built-in scripts approach to work on OSX Sequoia.

I believe the suggested path no longer exists unless I am missing something:

  • Mac: ~/Library/Preferences/FMOD Studio/Scripts

If that’s true, where else should the scripts go to be available for all users and independent of the application itself?

Thanks!

The built-in scripts directory is for scripts that are shared by all users on the same computer. On MacOS, the built-in scripts directory is %fmod_bundle%/Scripts

I’m not sure what you mean by “independent of the application itself.” An FMOD Studio script is a script that runs inside FMOD Studio, so it is impossible by definition for an FMOD Studio script to function independently of FMOD Studio.

Sorry for my lack of clarity:
I mean the path of the „system scripts“ you mentioned as the first in your list in this post does not seem to work.