First, sorry for my English, it`s not my native language, but I will try to explain my problem as best as I can.
I`m trying to make a new script for bounding armor (in this case it`s just a mask) with some cool effects. One of these effects is animation - Werewolf Change animation.
In original code you have something like this:
Spoiler
Scriptname WerewolfTransformVisual extends ActiveMagicEffectArmor Property WolfSkinFXArmor autoRace Property WerewolfRace autoVisualEffect property FeedBloodVFX autoIdle Property IdleWerewolfTransformation autoSound Property NPCWerewolfTransformation autoSound Property NPCWerewolfTransformationB2D autoSound Property NPCWerewolfTransformationB3D autoQuest Property PlayerWerewolfQuest autoEvent OnEffectStart(Actor Target, Actor Caster); Debug.Trace("WEREWOLF: Starting change anim...") if (Target.GetActorBase().GetRace() != WerewolfRace) ; Add the tranformation wolf skin Armor effect Target.equipitem(WolfSkinFXArmor,False,True) RegisterForAnimationEvent(Target, "SetRace") Target.PlayIdle(IdleWerewolfTransformation) Utility.Wait(10) TransformIfNecessary(Target) endifEndEventEvent OnAnimationEvent(ObjectReference akSource, string asEventName); Debug.Trace("WEREWOLF: Getting anim event -- " + akSource + " " + asEventName) if (asEventName == "SetRace") TransformIfNecessary(akSource as Actor) endifEndEventFunction TransformIfNecessary(Actor Target)if (Target == None); Debug.Trace("WEREWOLF: Trying to transform something that's not an actor; bailing out.", 2) returnendifUnRegisterForAnimationEvent(Target, "SetRace")Race currRace = Target.GetRace()if (currRace != WerewolfRace); Debug.Trace("WEREWOLF: VISUAL: Setting race " + WerewolfRace + " on " + Target) if (Target != Game.GetPlayer()); Debug.Trace("WEREWOLF: VISUAL: Target is not player, doing the transition here.") Target.SetRace(WerewolfRace) ;TEEN WOLF ; Remove the transformation effect armor if he/she has it on. if (Target.GetItemCount(WolfSkinFXArmor) > 0) (Target.Removeitem(WolfSkinFXArmor, 1, True, none)) endif else CompanionsHousekeepingScript chs = (PlayerWerewolfQuest as PlayerWerewolfChangeScript).CompanionsTrackingQuest as CompanionsHousekeepingScript if (chs.PlayerOriginalRace == None) chs.PlayerOriginalRace = currRace endif PlayerWerewolfQuest.SetStage(1) endif endifEndFunctionI`m trying to take as much as it`s possible, to make this animation work, but when animation is finished, my player just stuck. It looks like his stuck on the last frame of this animation. I tried on many ways, but I can`t fix it.
This is my code:
Spoiler
Scriptname woyoboundhollowmask extends ActiveMagicEffectArmor Property ArmorHollowMask AutoEffectShader Property boundEffect AutoEffectShader Property boundEffect2 AutoImageSpaceModifier Property RedScreen AutoSound Property Roar AutoExplosion Property ShockWave AutoInt Property ForcePush AutoEvent OnEffectStart(Actor ckTarget, Actor ckCaster)Utility.Wait(0.1)Game.GetPlayer().EquipItem(ArmorHollowMask, 1, true)boundEffect.Play(ckCaster)boundEffect2.Play(ckCaster)RegisterForAnimationEvent(ckCaster, "HollowHowl")ckCaster.PlayIdle(MegaHowl)Utility.Wait(5)BreakTheHowl(ckCaster)ckCaster.IgnoreFriendlyHits()RedScreen.Apply()roar.play(ckCaster)ckCaster.PlaceAtMe(ShockWave, 1, False, False)if(ckCaster != ckTarget) ckCaster.PushActorAway(ckTarget, ForcePush)endifckCaster.IgnoreFriendlyHits(false)EndEventEvent OnAnimationEvent(ObjectReference akSource, string asEventName) Debug.Trace("WEREWOLF: Getting anim event -- " + akSource + " " + asEventName) if (asEventName == "HollowHowl") BreakTheHowl(akSource as Actor) endifEndEventEvent OnEffectFinish(Actor ckTarget, Actor ckCaster) Game.GetPlayer().RemoveItem(ArmorHollowMask, 1, true)EndEventFunction BreakTheHowl (Actor ckCaster)if (ckCaster == None) Debug.Trace("WEREWOLF: Trying to transform something that's not an actor; bailing out.", 2) returnendifUnRegisterForAnimationEvent(ckCaster, "HollowHowl")EndFunctionIdle Property MegaHowl AutoAs I said, I tried, but now I`m stuck as well
I have no other idea how to fix it.I have to ask for your help. Please, help me resolve my problem. In the future this code can be useful for other people as well.
Edit:
What is very odd with this script is that after animation, when player is stuck, you can`t move in 3rd person view, but in the 1st person view you can move as normal, but still you can see a broken animation.
If anyone want to see this script in action, here is the link on YT:
Spoiler
http://www.youtube.com/watch?v=bUg3IozyGoU
Regardshttp://www.youtube.com/watch?v=bUg3IozyGoU
WoYo-Sensei
