Durai Posted February 14, 2015 Share Posted February 14, 2015 So long story short, I play Guild Wars 2 every so often, and think adding scepters to Skyrim would be fun. Unfortunately I can't seem to get a script down for doing it. All I would need is for a spell to cast once the player swings their weapon, but I don't know if I need to attach the script to the weapon itself, create an enchantment on the weapon, or create an Alias linked to the weapon. If anyone can help I'd appreciate it. Here's what I've go so far: Reveal hidden contents Spell Property Scepter01 AutoEvent OnInit() RegisterForAnimationEvent(Game.GetPlayer(), "weaponSwing") RegisterForAnimationEvent(Game.GetPlayer(), "WeaponLeftSwing")endEvent Event OnAnimationEvent(ObjectReference akSource, string asEventName) if (akSource == Game.GetPlayer()) && (asEventName == "weaponSwing") Debug.Trace("Cast Spell!") ;This is just so I can see if the script is triggering correctly; hasn't triggered so far Scepter01.Cast(akSource, self) endIf if (akSource == Game.GetPlayer()) && (asEventName == "weaponLeftSwing") Debug.Trace("Cast Spell!") ;This is just so I can see if the script is triggering correctly; hasn't triggered so far Scepter01.Cast(akSource, self) endIfendEvent Link to comment Share on other sites More sharing options...
Mattiewagg Posted February 16, 2015 Share Posted February 16, 2015 It should be working properly. I assume your property is filled and it is a spell that SHOULD be cast on the weapon itself? Because if you attach this script to your weapon (should extend Weapon), you'll be casting the spell on the weapon. Link to comment Share on other sites More sharing options...
Terra Nova Posted February 16, 2015 Share Posted February 16, 2015 Attach the script to a quest. Doesn't need any aliases. Make it start game enabled, make a single quest stage and check the "Start Up Stage" box. That's all there is too it. Note you will have to do additional coding if you only want the event to fire if the weapon is currently equipped. Otherwise it's going to fire every time the player swings any weapon. Link to comment Share on other sites More sharing options...
Recommended Posts