Jump to content

[LE] Little music player trick for your player home mods.


NexusComa

Recommended Posts

If you set up music to be played in your home mod and would like that music to be interchangeable with other music. This is a sweet way to set that up ...

Place as many tracks as you wish to have in the music folder (in a folder with your mods name) as blank .wav files. As in a short track of nothing but silence.

Let's say you went with 10 tracks ... Put the 10 tracks in the folder in .wav format. Now from the kit link them as you would any other music keeping them as .wav

files. Create a .bsa with them in place. Now in your music folder once your mod has been packed to a .bsa. You can remove the music .wav file and replace

them by the same name with actual music. The nice part is it can be in either format .wav or .xwm. When you post your mod add the 10 tracks you wish as loose files.

Now the player can use your music or add their own by the same name - in either format ... good stuff!

 

 

Here is a version of a music player (this one also has a light that turns on for a bit when the music is turned on).
The player is toggled via xMarker from a switch in this version also. This one is from my [ Enchanted Ship in a Bottle ]
mod. This player works very well. The mod itself has no music playing. The music tracks change to the next track

each time it is turned on. Actually, it will stop the music then the next click will call the next track on the track list.

How to turn on and off the music can be a bit tricky. This is by far the best way I've found. Thought I'd share.
The "_NONE auto" is set to _None (that is linked to _MUSExploreSILENT30, should be the top one)

xMarker starts out disabled ...

 

Scriptname Ship00_MusicPlayer extends ObjectReference
;* Music Player, NexusComa, nexusmods.com
ObjectReference Property LightMarker Auto
ObjectReference Property Marker Auto
MusicType Property _MusicTrackMain Auto
MusicType Property _NONE Auto
;
Event OnInit()
Marker.Disable()
GoToState("Switch")
EndEvent
;-----------------------
State Switch
Event OnActivate(ObjectReference akActionRef)
If(Marker.IsDisabled())
_Enable()
Else
_Disable()
EndIf
EndEvent
EndState
;-----------------------
Function _Enable()
Marker.Enable()
LightMarker.Enable()
_MusicTrackMain.Add()
Utility.Wait(1.0)
_NONE.Remove()
Utility.Wait(2.0)
LightMarker.Disable()
EndFunction
;-----------------------
Function _Disable()
Marker.Disable()
LightMarker.Disable()
_NONE.Add()
Utility.Wait(1.0)
_MusicTrackMain.Remove()
EndFunction
;
Edited by NexusComa
Link to comment
Share on other sites

  • Recently Browsing   0 members

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