06-05-2006, 09:16 PM
I'm not sure if you've figured out anything more with music scripting but I dug up an old plugin I started for Morrowind that might be of some help. I haven't familiarized myself with the new CS so I'm not sure how similar the script is - I could just be wasting my time here... :|
This first script is applied to an activator - in this case it's every external door to a merchant's shop
Begin a_daggerSHOP_begin
if ( OnActivate == 1 )
StartScript, "a_daggerSHOP_timer"
StreamMusic, "daggerSHOP.mp3"
Activate
endif
End a_daggerSHOP_begin
*********************************
This script is started by the last script and sets the activated song to loop at a pre-specified number of seconds - in this case 108 seconds which is how long the song is.
Begin a_daggerSHOP_timer
Short songactive
if ( songactive == 0 )
Set DaggerMusic_timer to 0
Set songactive to 1
endif
Set DaggerMusic_timer to ( DaggerMusic_timer + GetSecondsPassed )
if (DaggerMusic_timer > 108 )
StreamMusic, "daggerSHOP.mp3"
Set DaggerMusic_timer to 0
endif
End a_daggerSHOP_timer
*********************************
This script is applied to every internal merchant shop's door to stop the loop and start the explore music when you leave the shop
Begin a_daggerSHOP_end
if ( OnActivate == 1 )
StopScript, "a_daggerSHOP_timer"
StreamMusic, "explore/mx_explore_2.mp3"
Activate
endif
End a_daggerSHOP_end
*********************************
This system has a number of bugs. For instance if you leave an area (in this case a shop) without using the doorway, then the script won't end and the same song will loop continuously until you activate the correct stopscript (I'm not sure how it would react if you activated another streammusic command without stopping the old script...). There are also some small annoyances like hearing the same explore song every time you leave a shop or not activating the script if you load a saved game inside a shop. However, the biggest problem is with the script itself: when the streammusic command is activated the volume is automatically reset to maxium every time.
I doubt any of this will help but I thought I'd try. When I have time I will familiarize myself with the new CS and see if I can help you figure out a solution.
This first script is applied to an activator - in this case it's every external door to a merchant's shop
Begin a_daggerSHOP_begin
if ( OnActivate == 1 )
StartScript, "a_daggerSHOP_timer"
StreamMusic, "daggerSHOP.mp3"
Activate
endif
End a_daggerSHOP_begin
*********************************
This script is started by the last script and sets the activated song to loop at a pre-specified number of seconds - in this case 108 seconds which is how long the song is.
Begin a_daggerSHOP_timer
Short songactive
if ( songactive == 0 )
Set DaggerMusic_timer to 0
Set songactive to 1
endif
Set DaggerMusic_timer to ( DaggerMusic_timer + GetSecondsPassed )
if (DaggerMusic_timer > 108 )
StreamMusic, "daggerSHOP.mp3"
Set DaggerMusic_timer to 0
endif
End a_daggerSHOP_timer
*********************************
This script is applied to every internal merchant shop's door to stop the loop and start the explore music when you leave the shop
Begin a_daggerSHOP_end
if ( OnActivate == 1 )
StopScript, "a_daggerSHOP_timer"
StreamMusic, "explore/mx_explore_2.mp3"
Activate
endif
End a_daggerSHOP_end
*********************************
This system has a number of bugs. For instance if you leave an area (in this case a shop) without using the doorway, then the script won't end and the same song will loop continuously until you activate the correct stopscript (I'm not sure how it would react if you activated another streammusic command without stopping the old script...). There are also some small annoyances like hearing the same explore song every time you leave a shop or not activating the script if you load a saved game inside a shop. However, the biggest problem is with the script itself: when the streammusic command is activated the volume is automatically reset to maxium every time.
I doubt any of this will help but I thought I'd try. When I have time I will familiarize myself with the new CS and see if I can help you figure out a solution.