PsychoSlammer Posted March 18, 2020 Share Posted March 18, 2020 this armor set i created for my follower, i only want the helm to appear during combat. is there a small script to add to it or do i need to create a quest and script it? Link to comment Share on other sites More sharing options...
dylbill Posted April 4, 2020 Share Posted April 4, 2020 (edited) this armor set i created for my follower, i only want the helm to appear during combat. is there a small script to add to it or do i need to create a quest and script it? Hey, yes you can do this fairly easy by creating a new spell / ability that detects whether the NPC is in combat or not. Make a new magic effect: Script, Constant effect, Self. Then make a new spell, Type: Ability, constant effect, self, and put your magic effect on it with the condition IsInCombat == 1. Put this script on your Helm: Scriptname MyhelmScript extends ObjectReference Spell Property DetectCombatState Auto ;This is the spell you just made Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) If (akNewContainer as actor) (akNewContainer as actor).AddSpell(DetectCombatState) ;adds detect combat spell ability to NPC Endif If (akOldContainer as actor) If (akOldContainer as actor).GetItemCount(Self.GetBaseObject()) == 0 (akOldContainer as actor).RemoveSpell(DetectCombatState) ;remove detect combat spell from old NPC Endif Endif EndEventName the script something unique. Put this script on your magic effect: Scriptname DetectCombatScript extends ActiveMagicEffect Armor Property Helm Auto Event OnEffectStart(Actor akTarget, Actor akCaster) ;effect starts when NPC starts combat akTarget.EquipItem(Helm) EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) ;effect stops when NPC leaves combat akTarget.UnEquipItem(Helm) EndEvent Again, name the script something unique. Edited April 4, 2020 by dylbill Link to comment Share on other sites More sharing options...
dylbill Posted April 4, 2020 Share Posted April 4, 2020 (edited) I had another thought. If you only want this function for your specific follower, you could make a new quest, start game enabled, and make a new reference alias on the quest that points to your follower. Put this script on the reference alias: Scriptname HelmEquipScript extends ReferenceAlias Armor Property Helm Auto Event OnCombatStateChanged(Actor akTarget, int aeCombatState) If aeCombatState == 1 GetActorRef().EquipItem(Helm) Elseif aeCombatState == 0 GetActorRef().UnEquipItem(Helm) Endif EndEvent Again name the script something more unique. Edited April 4, 2020 by dylbill Link to comment Share on other sites More sharing options...
PsychoSlammer Posted April 4, 2020 Author Share Posted April 4, 2020 hey thanx, i did already get it done. i found a short script that i placed on the follower and does not require the item to be in inventory. Link to comment Share on other sites More sharing options...
dylbill Posted April 5, 2020 Share Posted April 5, 2020 Cool good to hear! Link to comment Share on other sites More sharing options...
Recommended Posts