Author Topic: Making an invetory object make sound ("music box")  (Read 350 times)

Legacy_Alice24

  • Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
Making an invetory object make sound ("music box")
« on: January 08, 2015, 04:13:40 pm »


               

Hi guys. I added a music file to my hakpak that I want to be played every time the user activates a certain item (a music box). But when I try to edit the item, I don't see any place where I can add a script for that. Can you help me figure out how to do it?



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Making an invetory object make sound ("music box")
« Reply #1 on: January 08, 2015, 05:31:10 pm »


               One way to do this is to add "Cast Spell : Unique Power Self Only" to the item's Properties tab. Then, when the item is used, it will trigger the module's OnActivateItem script. GetItemActivated() will return the item that was used. A minor downside is that the PC will do a spellcasting animation.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Making an invetory object make sound ("music box")
« Reply #2 on: January 14, 2015, 01:04:14 pm »


               

If I remember correctly, if you clone the unique power line in spells.2da, remove the animation references, and link the new line through iprp.spells.2da (may have the wrong 2da), the PC won't do the animation sequence.