Ok what I have done is to create a new base effect with a script effect and the following script...
scn StealthScriptref npcbegin scripteffectstartset npc to getfirstref 200 1label 10if(npc) if(npc.getplayerteammate) npc.CastImmediateOnSelf StealthboyCompanion endif set npc to ArmorCombat set npc to getnextref goto 10endifendifend
I added this effect to the stealth boy with a 2 second duration, though the duration may not be important since it loops.
The SlealthboyCompanion is just a new ingestible that was a copy of the normal stealthboy without the new script effect.
I just had a look at the NVSE commands, I get what getfirstref is for, but what's the purpose of " 200 1" and what does setting the npc variable to "ArmorCombat" do?
Use getcontainer to return the NPC equipping an item.
If you use addperk or any other command which takes a reference, and you don't give a reference, it uses the object which activated the script. This would apply the perk to the armor, which is not what you want. You can use "set rRef to getcontainer" to get the owner (container) of the armor.
Ugh, now I feel like a complete idiot, I must have glanced pass that link in the wiki a 100 times today...
or scripting all light armors. Not very practical I think.
Yeah, that's what I was going to do. It'd be time consuming adding it to armours that already have a script, but it's the only option coming to mind.
I am not sure a perk is the best way to add an armor effect. If you look at some of the existing armors with "magic effects" like the powered armor, they use an object effect. There are many existing ones to choose from and you can make your own.
I had considered that, but I didn't want the PC to be affected.
Thanks guys, you've been very helpful.