bf6-portal-mod-types
    Preparing search index...

    Function LoadMusic

    • Loads a music package to then be triggered with the mod.PlayMusic action. Music packages must first be loaded (such as loading in all Battle Royale music using mod.LoadMusic(mod.MusicPackages.BR)). It is advised to do this as early as possible to allow a few seconds of time for the music to load in. Typically, you'd load it in during OnGameModeStarted(). The way a music package is laid out, is that certain music events are designed to seamlessly transition into the next event.

      Parameters

      Returns void

      export async function OnGameModeStarted() {
      mod.LoadMusic(mod.MusicPackages.Core);
      mod.SetMusicParam(mod.MusicParams.Core_Amplitude, 1.3);
      }

      function SomeFunctionInYourExperience(winningTeam: Team, losingTeam: Team) {
      mod.SetMusicParam(mod.MusicParams.Core_IsWinning, 1, winningTeam);
      mod.SetMusicParam(mod.MusicParams.Core_IsWinning, 0, losingTeam);
      mod.PlayMusic(mod.MusicEvents.Core_EndOfRound_Loop);
      }
    • Loads a music package to then be triggered with the PlayMusic action.

      Parameters

      Returns void