Jump to content

Make certain music play when in werewolf form?


IVIiru

Recommended Posts

So I wanted to make a mod, that after you have transformed, it would play a whole set of new ambient tracks. Having Exploration Music play, and when you get into combat it would play the combat themes.

 

I am wondering what I need to do so these tracks are specifically labeled to the Werewolf. As I have no clue, anyone to go too?

 

Awaiting awnsers.

Link to comment
Share on other sites

I did something analogous to this in my Jaws mod. Add your new Music Tracks in CK. Make a custom Music Type (it's better to do it this way, rather than to modify the vanilla Music Types, as it would cause compatibility issues). Add your Music Tracks to the Music Type. Then you will need to design a script that adds your custom Music Type to the play stack (very simple, no?) when the player transforms into a werewolf. The script could either be attached to a Quest alias pointing to the player, or added to a Magic Effect as part of an ability or spell. Possibly a simple script fragment might do the job if there was a boolean variable available to use in a Condition Function to test if the player is in werewolf form (I can't confirm if there is, but I'd be very surprised if there wasn't).

 

You can either have two separate Music Types (one for exploration and one for combat) or you could simply have one Music Type with a condition on each track to only play specific tracks while in combat. The way the music stack works though, it's possible for normal combat and boss tracks to override any music currently playing on the stack. I used the script event "OnCombatStateChanged" to detect when combat starts and then I used this function to remove the regular combat Music Type from the play stack before adding my custom music to the stack.

 

Strangely, there's no script function that lets you query what Music Type is currently playing, so you just have to guess. However I found in practice that repeatedly calling "add" and "remove" from the play stack can break the music completely until the savegame is reloaded, so take care and use these commands sparsely.

 

I helped another modder in another thread on writing a script to play custom music while sneaking. That should give you an idea of how it is done. What you want to do is a bit more complex though. The script that I use in my Jaws mod is far more sophisticated, but I don't want to give all my trade secrets away :tongue:

Edited by steve40
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...