lordbevan1 Posted June 5, 2019 Share Posted June 5, 2019 Looking for help creating a script which runs only if the player isn't wearing armor. Link to comment Share on other sites More sharing options...
lordbevan1 Posted June 5, 2019 Author Share Posted June 5, 2019 (edited) I think I managed to do what I wanted, but I've yet to test it. Here's the script: scn 01DraconianScales begin gamemode if Player.GetRace == Draconian Player.AddSpell AbRaceDraconianShield endif if Player.GetArmorType == 0 Player.RemoveSpell AbRaceDraconianShield endif if Player.GetArmortype == 1 Player.RemoveSpell AbRaceDraconianShield endif end Edited June 5, 2019 by lordbevan1 Link to comment Share on other sites More sharing options...
Oblivionaddicted Posted June 5, 2019 Share Posted June 5, 2019 I think I managed to do what I wanted, but I've yet to test it. Here's the script: scn 01DraconianScales begin gamemode if Player.GetRace == Draconian Player.AddSpell AbRaceDraconianShield endif if Player.GetArmorType == 0 Player.RemoveSpell AbRaceDraconianShield endif if Player.GetArmortype == 1 Player.RemoveSpell AbRaceDraconianShield endif end Glad for you if it works but always start your editor ID's and script names with letters, otherwise your game will be unstable. Link to comment Share on other sites More sharing options...
lordbevan1 Posted June 5, 2019 Author Share Posted June 5, 2019 (edited) It didn't work, also thanks for the tip.EDIT: I think I realized why it didn't work. If it works, I might post my race mod on the nexus Edited June 5, 2019 by lordbevan1 Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted June 6, 2019 Share Posted June 6, 2019 GetArmorType cannot be called on an actor. It needs to be called on a wearable item, preferably an armor, to work. I for one would likely use GetArmorRating rather than running a loop through all items the actor wears via GetEquippedItems and check their armor type then sum it up. But depending on the actual intention the latter might as well be the only feasible way. Link to comment Share on other sites More sharing options...
lordbevan1 Posted June 26, 2019 Author Share Posted June 26, 2019 I want to add a shield effect to the character, but ONLY while unarmored Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted June 27, 2019 Share Posted June 27, 2019 Does wearing a shield or not make a problem? Because GetArmorRating sounds like the perfect tool for the job, "but" it will also return a value > 0 when wearing only a shield and a 1-hand weapon. Otherwise, yes, looping through all GetEquippedItems and checking the armor type of each via GetArmorType, provided it's not a weapon or similar, would be the other option. At the end of the loop you'll know if you wear any armor or not, and shields can be excluded. I can provide an example script for the loop, too, if you need it. Link to comment Share on other sites More sharing options...
lordbevan1 Posted June 30, 2019 Author Share Posted June 30, 2019 No, shield effect. Like the spell. Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted June 30, 2019 Share Posted June 30, 2019 Yes, I know. Sorry, if I expressed myself poorly. I was asking whether in detecting if you're wearing armor holding a shield should count as wearing armor or not, too, because that's how the most simple solution, the GetArmorRating function works. It returns values > 0 when you're not wearing any armor but holding a shield and have your 1-hand weapon out. If that's no problem in your detection and the shield spell should only apply while not wearing any armor "or" shield, then go for GetArmorRating first. It will return "0" when neither is the case, and your shield spell can apply. Link to comment Share on other sites More sharing options...
lordbevan1 Posted July 24, 2019 Author Share Posted July 24, 2019 (edited) I'm looking for something that'll ignore the shield. Still, this'd be good for testing if the script syntax works. I would also like that example script, thank you. Edited July 26, 2019 by lordbevan1 Link to comment Share on other sites More sharing options...
Recommended Posts