Solora Posted October 13, 2015 Posted October 13, 2015 Hi everyone, I'm currently working on an Imperial werewolf follower, Ayleth, and I'm trying to get it so that whenever she goes into combat, a script activates and monitors her health. Whenever her health goes below 10%, she'll apply a werewolf FX armor and spell FX like how the player transformation is set up, but instead of changing her race, she teleports to an x marker in another cell, and a werewolf npc will teleport into her spot instead. After combat ends, it'll play another transformation FX and armor, then the werewolf will teleport to its own xmarker and my follower will teleport back to the same spot so it looks like she transformed.  I've just started learning Papyrus, I've gone through many tutorials and the CK wiki and I understand a lot of the terms and such, but I have no experience and frankly I'm really not sure how I should go about writing the script. Spwnd has given me permission ( thank you spwnd!) to study his werewolf mods to get a feel for what I should do for my own follower. This is what I've outlined so far, it's not complete yet and some of the functions (equip and play ) I don't know the proper code line for yet but I'll be researching all of the correct terms. I'm just not sure how to go about this, honestly. I don't want the script to affect performance or have save game bloat, so I've got it in states to try to keep it only running when she goes into combat, I THINK this will do it? Turning the state on when she goes into combat, and then deactivating when she exits combat.  Scriptname AylethWerewolf Script extends Actor{Checks Ayleth during combat and handles werewolf transformation, if health drops below 10%, transform}}Auto state Inactive event OnStartCombat ()GoTostate ("Active") EndState if (getActorValuePercentage("health") < 0.1)equip WolfSkinFXArmorplay WerewolfChangeFXMoveTo (AAAylethTeleport) record Ayleth coordinates somehow  (not 100% sure how to put werewolf npc part into script, since the script is attached my follower, but this is pretty much what I want) event werewolf moveto Ayleth coordinates eventend  event OnCombatStateEnd record werewolf coordinates equip transform FX play transform FX moveto AAAylethWerewolfTeleport move Ayleth back to werewolf coordinates  endeventState ActiveEvent OnCombatEndGoToState("Inactive")ObjectReference Property AAAylethTeleport Auto ; Ayleth XmarkerObjectReference Property AAAylethWerewolfTeleport Auto ; Werewolf XmarkerActor property AAAyleth AutoActor Property AAAAA Auto ; werewolfArmor Property WolfSkinFXArmor Auto  SPELL Property WerewolfChangeFX Auto     My big questions are, will something roughly like this work without messing up performance or causing save bloat or ctd's? Will it reactivate when Ayleth goes into combat again? Should I worry about having the State at all, or is there an easier/more efficient way to go about it? Any help or tips are greatly appreciated !  Thanks, Solora
Guest Posted October 13, 2015 Posted October 13, 2015 Use OnEnterBleedout() event to understand if the health is too low. And set that the actor (in the window to edit the actor) that he/she will enter bleedout at 10%.  You may have something like this:   Event OnEnterBleedOut()  Actor me = Self as Actor  me.EquipItem(WolfSkinFXArmor)   WerewolfChangeFX.Cast(me, me)  Utility.wait(1.0) ; "one second for transformation?"   AAAAA.enable()   AAAAA.moveTo(me)  AAAAA.StartCombat(me.getCombatTarget())  me.restoreHealthAndLimbs()  me.disable() EndEvent  And then on the AAAA actor add another script like:   Event OnCombatStateChanged(Actor akTarget, int aeCombatState)  if aeCombatState==1   return  endIf    Actor me = Self as Actor  WerewolfChangeFX.Cast(me, me)  Utility.wait(1.0) ; "one second for transformation?"  AAAyleth.enable()   AAAyleth.moveTo(me)  AAAyleth.UnEquipItem(WolfSkinFXArmor)  me.restoreHealthAndLimbs()  me.disable() EndEvent
Solora Posted October 13, 2015 Author Posted October 13, 2015 Thank you! I didn't think to use the bleedout event. I will try this when I get up later !
Solora Posted October 14, 2015 Author Posted October 14, 2015 Well, I edited the scripts and she'll do the animation and swap with the werewolf npc no problem, but now I can't get her to swap back with the human npc. Oh well, I'll keep poking around and see what I can coem up with. It's progress so far !
Recommended Posts
Archived
This topic is now archived and is closed to further replies.