AslanKebab Posted October 24, 2018 Share Posted October 24, 2018 Hello I have added keywords to a few pieces of armors that enhance the effect of an enchantment of the main armor piece.The intention is to give the actor the full effect of an enchantment once they are equipped with a with a complete set by adding to a modifier variable. Scriptname ArmorCheckScript extends activemagiceffect ;------------------------------------------------------ Float Property protModifier Auto ;----------------------------------------------------- Keyword BattleMageCuirass Keyword BattleMageHelmet Keyword BattleMageBoots Keyword BattleMageGloves ;----------------------------------------------------- Actor ActorREF ;---------------------------------------------------- Event OnEffectStart(Actor akActor, Actor akCaster) ActorREF = akActor EndEvent ;---------------------------------------------------- Event OnObjectUnequipped(Form akBaseObject, ObjectReference akReference) if ActorREF.WornHasKeyword(BattleMageCuirass) protModifier = 0.36 Debug.Notification("Actor has unequipped Battle Mage Cuirass") endif if ActorREF.WornHasKeyword(BattleMageHelmet) protModifier -= 0.27 Debug.Notification("Actor has unequipped Battle Mage Headgear") endif if ActorREF.WornHasKeyword(BattleMageBoots) protModifier -= 0.23 Debug.Notification("Actor has unequipped Battle Mage Boots") endif if ActorREF.WornHasKeyword(BattleMageGloves) protModifier -= 0.14 Debug.Notification("Actor has unequipped Battle Mage Gloves") endif EndEvent ;---------------------------------------------------- Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) Utility.Wait(0.5) if ActorREF.WornHasKeyword(BattleMageCuirass) protModifier = 0.36 Debug.Notification("Actor has equipped Battle Mage Cuirass") endif if ActorREF.WornHasKeyword(BattleMageHelmet) protModifier += 0.27 Debug.Notification("Actor has equipped Battle Mage Headgear") endif if ActorREF.WornHasKeyword(BattleMageBoots) protModifier += 0.23 Debug.Notification("Actor has equipped Battle Mage Boots") endif if ActorREF.WornHasKeyword(BattleMageGloves) protModifier += 0.14 Debug.Notification("Actor has equipped Battle Mage Gloves") endif EndEvent Here´s the bit of script. As far as I can see, the WornHasKeyword() is returning negative. and Debugging for it in-game is producing [Form in the notifications. I've also used this variation below. (DrV_BattleMageBarrierPrototype as DRV_GuardEnchScript).protModifier protModifier = 0.36 if akBaseObject as Armor && akBaseObject.HasKeyword(BattleMageHelmet) protModifier -= 0.27 Debug.Notification("Actor has unequipped Battle Mage Headgear") endif if akBaseObject as Armor && akReference.HasKeyword(BattleMageBoots) protModifier -= 0.23 Debug.Notification("Actor has unequipped Battle Mage Boots") endif if akBaseObject as Armor && akReference.HasKeyword(BattleMageGloves) protModifier -= 0.14 Debug.Notification("Actor has unequipped Battle Mage Gloves") endif EndEvent ;---------------------------------------------------- Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference) Utility.Wait(0.5) if ActorREF.HasKeyword(BattleMageHelmet) protModifier += 0.27 Debug.Notification("Actor has equipped Battle Mage Headgear") endif if akBaseObject as Armor && akReference.HasKeyword(BattleMageBoots) protModifier += 0.23 Debug.Notification("Actor has equipped Battle Mage Boots") endif if akBaseObject as Armor && akReference.HasKeyword(BattleMageGloves) protModifier += 0.14 Debug.Notification("Actor has equipped Battle Mage Gloves") endif EndEvent Both seem to return negative. Unfortunately, I am not Using SKSE or SSE at the moment.So, I can not make use of :of GetWornForm() event or IsEquippedArmorType feature. Any help with this would be greatly appreciated! Link to comment Share on other sites More sharing options...
ReDragon2013 Posted October 24, 2018 Share Posted October 24, 2018 (edited) Remember the difference between "script variable" and "property"! Keyword PROPERTY BattleMageCuirass auto ; prefill with CK, the keyword you have created Keyword PROPERTY BattleMageHelmet auto Keyword PROPERTY BattleMageBoots auto Keyword PROPERTY BattleMageGloves automaybe for better explaining, but this is not really important Actor target EVENT OnEffectStart(Actor akTarget, Actor akCaster) target = akTarget ENDEVENTit does not make sense if akBaseObject as Armor && akReference.HasKeyword(BattleMageBoots)better would be the next, https://www.creationkit.com/index.php?title=HasKeyword_-_Form IF (akBaseObject as Armor) IF akBaseObject.HasKeyword(BattleMageBoots) protModifier += 0.23 ; modifier you like to change, ;; What do you think about GlobalVariable instead of Float? Debug.Notification("Actor has equipped Battle Mage Boots") ; for testing only ENDIF ENDIF Edited October 24, 2018 by ReDragon2013 Link to comment Share on other sites More sharing options...
AslanKebab Posted October 25, 2018 Author Share Posted October 25, 2018 (edited) Thanks For the Clarification I and made the variables, properties and now this is working. Thanks for the other tips aswell Cheers Redragons! Edited October 25, 2018 by AslanKebab Link to comment Share on other sites More sharing options...
Recommended Posts