lofgren Posted January 30, 2016 Share Posted January 30, 2016 All the script is doing is adding a perk to the player. The effects of the perk are determined by the perk entries. So if you have a perk entry that says give all armor pieces +1000, then of course all armor pieces are going to have +1000 from that point on. You COULD add another block to the script that would remove the perk if the item is unequipped. I don't recommend doing that for the same reason that the USKP team removed that block from the silver weapon script and the Dawnguard team never added the block to the Dawnguard item script. It can lead to oddities based on when the script fires, which can be unpredictable. None of these conditions are resource intensive so your best bet is to just add the perk to the player and then leave it alone. Link to comment Share on other sites More sharing options...
Prismuth Posted January 30, 2016 Author Share Posted January 30, 2016 (edited) Perk is still crashing the inventory. I removed the script from both my files and from the armor pieces, made a perk for each piece, and put them where they belong. Then I assigned the perk entries to the keywords using WornHasKeyword. Loaded up a save before the script was working and opened my inventory. No issues. Activated the perk via console, opened the inventory, and CTD'd. u.u I'm really not sure what's going wrong here. >_> EDIT: I FOUND THE PROBLEM. The spell condition somehow ended up in the wrong place. *facepalm* I think things should still work better than prior though. I'll want to do some tests to ensure things aren't stacking. The effects I actually want are so minor, I can't really test just them. I'm surprised I don't seem to need any spells and magic effects. Happily surprised though. Thank you very much for all your patience with this. Now, since apparently scripts behave difficultly, what method would you recommend for getting the perk placed properly? Edited January 30, 2016 by Prismuth Link to comment Share on other sites More sharing options...
lofgren Posted January 30, 2016 Share Posted January 30, 2016 The script you were using ought to be fine. The only problem is that it will not work for NPCs. Link to comment Share on other sites More sharing options...
Prismuth Posted January 30, 2016 Author Share Posted January 30, 2016 Oh? I got the impression it'd be glitchy. With my NPC, I can just put the perk on her directly, yes? Link to comment Share on other sites More sharing options...
lofgren Posted January 30, 2016 Share Posted January 30, 2016 You might add a check to see if the character already has the perk. But no, it shouldn't be glitchy. It's trying to add and remove the perk every time an item was equipped or unequipped that would be glitchy. Link to comment Share on other sites More sharing options...
Prismuth Posted January 30, 2016 Author Share Posted January 30, 2016 So the first time the armor is equipped, it will add the perk? Link to comment Share on other sites More sharing options...
lofgren Posted January 31, 2016 Share Posted January 31, 2016 Yep, and then the player will have the perk from that point on. Link to comment Share on other sites More sharing options...
Prismuth Posted January 31, 2016 Author Share Posted January 31, 2016 Alright, I'll re-add the script to all the armor pieces then. Would it be too much trouble to ask what the check might look like? Link to comment Share on other sites More sharing options...
lofgren Posted January 31, 2016 Share Posted January 31, 2016 (edited) This script should do you. scriptname ArmorEquipTest extends ObjectReference perk property PerkToAdd auto event OnEquipped(actor akActor) if(akActor == game.GetPlayer()) if(akActor.HasPerk(PerkToAdd) == false) akActor.AddPerk(PerkToAdd) endif endif endEvent Another alternative would be to remove the script from the armor and just use a quest to give it to the player. Create a new quest, set it to start game enabled. Create a new stage and a new log entry. Check "start up stage." In the Papyrus fragment box, type a semicolon ( ; ). Click OK. Reopen the quest. Delete the semicolon. Then add this for the Papyrus fragment: Game.GetPlayer().AddPerk(PerkToAdd) stop() Of course you will also have to create a property on this script called PerkToAdd and point it to your perk. Edited January 31, 2016 by lofgren Link to comment Share on other sites More sharing options...
Recommended Posts