Qazwox Posted August 11, 2012 Share Posted August 11, 2012 Hi guys, I'm trying to create an ActiveMagicEffect where whenever the player mounts on a horse, some stats change. I'm having trouble getting my mod to recognize when the player is using a horse. Here is my attempt so far. The player successfully acquires the spell and is registered for some animation, but when I hop on a horse, nothing happens. I've tried with other animations, such as sprinting, but it seems to never pickup the OnAnimationEvent. I feel that I may be completely off or going about this the wrong way. Any help? ScriptName HLMSpellScript extends activemagiceffect{Manages HLMSpell} Event OnEffectStart(Actor akTarget, Actor akCaster) if akTarget == Game.getPlayer() ;RegisterForUpdate(5.0) Debug.Trace("Player acquired spell") RegisterForEvents() endif EndEvent Event OnAnimationEvent(ObjectReference akSource, string asEventName) Debug.Trace("OnAnimationEvent for HorseEnter") if asEventName == "HorseEnter" Debug.Trace("Player got on horse") EndIfEndEvent bool isRegisteredForEvents = false function RegisterForEvents() Debug.Trace("Player registering for animation") isRegisteredForEvents = True RegisterForAnimationEvent(Game.GetPlayer(), "HorseEnter") Debug.Trace("Player registered for animation")endfunction Link to comment Share on other sites More sharing options...
fore Posted August 12, 2012 Share Posted August 12, 2012 OnAnimationEvent seems to be totally unreliable, to say the least. Several modder have confirmed same problems. In another thread I read a comment saying that "triggered" events will work, while "notified" events will not (this refers to the type of nodes in the behavior that is raising the particular event). But even with that background I was not able to raise one of the events I wanted. Link to comment Share on other sites More sharing options...
Qazwox Posted August 12, 2012 Author Share Posted August 12, 2012 Thank you for the response fore. I will look into trigger events as you say. Does anyone have any other suggestions or anything to add to fore's trigger events? Link to comment Share on other sites More sharing options...
Qazwox Posted August 17, 2012 Author Share Posted August 17, 2012 (edited) I'm having trouble getting my mod to recognize when the player is using a horse. For anyone else's reference, the solution to this problem was remarkably simple. It could be done by using RegisterForSingleUpdate and then looking for Player.IsOnMount() under OnUpdate(). Edited August 17, 2012 by Qazwox Link to comment Share on other sites More sharing options...
Recommended Posts