Jump to content

Custom Music


jaminb236

Recommended Posts

Hey guys I am rather new to modding but understand most of the construction set. I'm currently working on a mod for one of my friends and I want music to play when he enters a cell...The music should only play in the specific cell and it should loop any help?

Link to comment
Share on other sites

Here is a script from another mod that could be adapted to yours:

 

scn AAMusicChangeScript

short UpdateMusic
short CurMusic
short MusicTimer
float fQuestDelayTime


Begin GameMode

set fQuestDelayTime to 1

  if Player.GetInCell AAMyCustomCell == 1 

     if (CurMusic == 0)
        set CurMusic to 1

     else

        if (UpdateMusic == 0)
           set UpdateMusic to 1
           StreamMusic "data\music\special\MyCustomMusic.wav"

           set MusicTimer to 39
       
        endif

        if (UpdateMusic == 1)
           if (MusicTimer > 0)
              set MusicTimer to (MusicTimer - GetSecondsPassed)
           else
              set UpdateMusic to 0
           endif
        endif
     endif
  else
     set UpdateMusic to 0
     set CurMusic to 0
     set MusicTimer to 0
  endif

end   

Link to comment
Share on other sites

  • Recently Browsing   0 members

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