musicChangeTrack event when the game is changing to play a new piece of music.
--- @param e musicChangeTrackEventData local function musicChangeTrackCallback(e) end event.register(tes3.event.musicChangeTrack, musicChangeTrackCallback)
This event supports blocking by setting
true or returning
false. Blocking the event prevents vanilla behavior from happening. For example, blocking an
equip event prevents the item from being equipped.
An event can be claimed by setting
true, or by returning
false from the callback. Claiming the event prevents any lower priority callbacks from being called.
context(string): Read-only. A short lowercase string that describes why the music is being played, to give more context.
combatvalues mean the game has chosen a new background music to play.
titlewill play (and loop) on the main menu.
levelwill play whenever the player has rested and is ready to level up.
mwscriptmeans a script has used the
deathmeans the player has died.
luameans that a lua script has requested new music.
crossfade(number): The number of milliseconds of crossfade that will be used to blend the current music to the new music.
music(string): The track that will be played. This can be changed to a new path, but it must be valid. Note that unlike the
musicSelectTrackevent, this value is not relative to
situation(tes3.musicSituation): Read-only. Maps to
tes3.musicSituation, indicating combat, non-combat, or scripted music.
volume(number): The volume of the track to be played, ranging from
1.0. This can be modified.