Jump to content

Cannot get event to trigger


ElliotSternberg

Recommended Posts

I have set up a mod to allow the player to recharge ANY weapon's enchantments (Even modded ones I've never seen.) by creating soul gems with magicka. The problem is that I can't just hand the player soul gems, because it can be abused easily to get crazy enchanting $$$. What I'm doing is adding a new soul gem, "Magicka Crystal", then adding a lesser power to add one into your inventory and remove any unused gems after 2 seconds out of menu. This way it can be used as a recharger, but no-one can enchant something in that time.

 

Unfortunately when I use the power nothing happens. I can add the Magicka Crystal manually and use it to recharge, so that shouldn't be the problem.

 

Assets(ID-Name-Function):

MagickaCrystalItem-Magicka Crystal-Grand Soul Gem

MagickaCrystalEffect-Magicka Burst-Holds the script

MagickaCrystalPower-Create Magicka Crystal-Fires the magic effect

MagickaCrystalScript-Detailed Below:

Scriptname MagickaCrystalScript extends activemagiceffect 
SoulGem Property MagickaCrystalItem  Auto  

Event OnEffectStart(Actor akTarget, Actor akCaster)
Game.GetPlayer().AddItem(MagickaCrystalItem, 1)
Debug.MessageBox("Crystal Added")
RegisterForSingleUpdate(2.0)

EndEvent
Event OnUpdate() ; This event removes an unused gem after 2 seconds.	
Int Crystals = Game.GetPlayer().GetItemCount(MagickaCrystalItem)
If(Crystals > 0)
Game.GetPlayer().RemoveItem(MagickaCrystalItem, Crystals)
EndIf
EndEvent

The script compiles nicely, but doesn't work in game. Your thoughts?

 

Thanks in advance,

-Elliot Sternberg

Link to comment
Share on other sites

  • Recently Browsing   0 members

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