jedp15 Posted July 23, 2024 Share Posted July 23, 2024 So, I've just finished making a quest and want to add custom background music that plays once it's done. Looking in the GECK, none of the vanilla music is listed anywhere other than the AudioMarker(s) placed around the world. I just want to play the song once and have the game revert back to the previous music from the AudioMarker, but at a loss on how to go about this. Wrote a preliminary script, though I don't know if I'm on the right track: scn AerieQuestEndMusicScript float Timer Begin GameMode SetMusicState 1 AerieAudioMarker1REF.disable PlayMusic AerieEndMusic if Timer < 360 ; a little longer than the song (about 6 minutes) set Timer to Timer + GetSecondsPassed else SetMusicState 0 AerieAudioMarker1REF.enable endif end ---------------------------- Link to comment Share on other sites More sharing options...
jedp15 Posted July 23, 2024 Author Share Posted July 23, 2024 Figured it out. Didn't see the Audio section in the object window. Basically, to use the function "PlayMusic" on custom music, you need to create a new "Music Type." Here's the script that ended up working: scn AerieQuestEndMusicScript float Timer short DoOnce Begin GameMode if DoOnce == 0 SetMusicState 1 AerieAudioMarker1REF.disable PlayMusic AerieEndMusic set DoOnce to 1 elseif DoOnce == 1 if Timer < 360 set Timer to Timer + GetSecondsPassed else SetMusicState 0 AerieAudioMarker1REF.enable StopQuest AerieQuestEndMusic endif endif end ------------------------- If you're looking to do the same thing for a quest, you need to create a custom quest that's NOT start game enabled and put a decent delay on it (like 8 seconds), so when your main quest ends, the song won't play until at least a few seconds after. In the main quest's last stage result script, you put StartQuest (the ID of your song quest). Voila. Link to comment Share on other sites More sharing options...
Recommended Posts