igotnousername Posted August 4, 2015 Share Posted August 4, 2015 How do I check if an actor has a helmet equipped and store the helmet as a variable to use it in some parts of the script? Link to comment Share on other sites More sharing options...
skinnytecboy Posted August 5, 2015 Share Posted August 5, 2015 http://www.creationkit.com/OnEquipped_-_ObjectReference Not sure what it is that you want to do with your variable. You'll need to be a little more descriptive if you want help from people. Link to comment Share on other sites More sharing options...
igotnousername Posted August 5, 2015 Author Share Posted August 5, 2015 Basically I was trying to make a script that drops enemies helmet when they die.I got it working but only for the player and pretty much restrictive. With the way things now, I need to edit every single helmet and add the script with it. I was hoping I can do it by just when the enemy is dying, it checks if enemy has a helmet, store that helmet as a variable, and then DropObject(Helmet). Link to comment Share on other sites More sharing options...
scrivener07 Posted August 5, 2015 Share Posted August 5, 2015 The Footprints of skyrim mod mechanically does something similar to what your after. I have not dissected this mod myself but I have observed it only affects the actors immediately near the player. With that I bet you could have a script on the player that applies a spell/magiceffect to all the actors in the same cell as the player. You can then attach your drop helmet script to this magic effect. Thats the idea, obviously not considering maintenance. Link to comment Share on other sites More sharing options...
igotnousername Posted August 6, 2015 Author Share Posted August 6, 2015 I see. I still need to edit every single helmet though. Because I have no idea how assign a variable automatically unless being stated in the properties. I also notice that enemies drops their weapons when dying sometimes. Has anyone know how?How does the disarm scripted as well? Link to comment Share on other sites More sharing options...
scrivener07 Posted August 6, 2015 Share Posted August 6, 2015 Editing every single helmet is a terrible idea :pinch: I think something like this might work better, hopefully the script guru chimes in.Armor Function GetActorHelmet(Actor akActor) If(akActor != none) int headSlotMask = 0x00000001 Armor headSlotItem = akActor.GetWornForm(headSlotMask) as Armor If(headSlotItem != none && headSlotItem.IsHelmet()) return headSlotItem EndIf EndIf return none EndFunction Function DropActorHelmet(Actor akActor) int headSlotMask = 0x00000001 Form headSlotItem = akActor.GetWornForm(headSlotMask) If(headSlotItem != none && (headSlotItem as Armor).IsHelmet()) akActor.UnequipItem(headSlotItem) akActor.DropObject(headSlotItem) EndIf EndFunction Link to comment Share on other sites More sharing options...
igotnousername Posted August 6, 2015 Author Share Posted August 6, 2015 So it was 0x0000001? I tried something similar like this but it was 2 not 1. Link to comment Share on other sites More sharing options...
scrivener07 Posted August 6, 2015 Share Posted August 6, 2015 Yup, as stated in the reference http://www.creationkit.com/Slot_Masks_-_Armor So it worked lol!? That weird for me to bang out a working script in one go. Link to comment Share on other sites More sharing options...
Recommended Posts