Jump to content

Making an item that changes the bg music


champkind

Recommended Posts

Hey there, I'm pretty new to all of this, just installed oblivion yesterday but I've done a bit of modding before.

 

I'm editing the Sauron Armor for my own use, (specifically the one ring) so that it changes the music to a song from LOTR.

 

For the enchantment, I have a script effect enabled that runs this script. I have it running as a Magic Effect, not sure if that makes any difference.

 

scn 1lotrmusic


Begin ScriptEffectStart

StreamMusic "Data\Music\Ring\lotr.mp3"

End

Begin ScriptEffectUpdate

End

Begin ScriptEffectFinish



End

 

As you can see it's very simple and I can't see why it isn't working. I unwield and rewield the ring but nothing plays. If I go to the console and type StreamMusic "Data\Music\Ring\lotr.mp3", it plays, so I'm not really sure what's going on.

 

Any help is appreciated! Thanks!

Link to comment
Share on other sites

If you are adding the music to an item like the ring you need an "onEquip player" and "onUnequip player"block and it needs to be an Object script.

 

Something like this script I used to add a spell to the player via a ring when equipped and removing the spell when the ring is unequipped. That's assuming you want to the music to stop when you remove the ring, or if you intend to remove it at all when playing.

 

scn AAPlayerGhostScript
short doonce

begin onEquip player
   if doonce == 0
       player.addspell AASoulThief
       set doonce to 1
   endif
end

begin onUnequip player
   if doonce == 1
      player.removespell AASoulThief
       message "The Essence of Spirit Unity has been removed."
       set doonce to 0
   endif
end

 

Have you created the music to be played in the CS under Misc\Sounds? You need to do that before you can create the script so you have it's ID to add to the script. You can't add a line to play from your data folder like this "StreamMusic "Data\Music\Ring\lotr.mp3." The music file must exist in the CS first and also in data\Sound\fx\YourModName.

 

 

The CS Wiki seems to be down at the moment :wallbash: otherwise I would check for the correct commands for streaming music, and I can't find it anywhere else with a quick search. You won't need the message part in my script.

 

I suggest when the Wiki is available again to check "StreamMusic" and PlaySound3D for the correct way to start and stop it. With streaming music I don't think it will stop when unequipping the ring, but I'm not sure without being able to check. Besides that you may need a timer so it doesn't stop playing while the ring is equipped.

 

This is the Wiki link for when it's back:

http://cs.elderscrolls.com/constwiki/index.php/StreamMusic

 

There's also this page at TES Alliance which should help with adding sounds to item scripts, but I think streaming music commands may be slightly different.

http://tesalliance.org/forums/index.php?/tutorials/article/40-adding-sounds-effects-to-your-mod/

 

Anyway, I hope that helps a bit and hasn't confused the issue. :smile:

Edited by Maigrets
Link to comment
Share on other sites

  • Recently Browsing   0 members

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