I think I've managed to fix the papyrus errors. For those who know how to use Papyrus, all you have to do is add a condition that checks if selfRef is not None before starting.
Spoiler:
Show
Function CountHeavyArmor() if (selfRef != NONE) count = 0 String test = ""; cuirass = selfRef.GetWornForm(0x00000004) as Armor gauntlets = selfRef.GetWornForm(0x00000008) as Armor helmet = selfRef.GetWornForm(0x00000001) as Armor circlet = selfRef.GetWornForm(0x00001000) as Armor
forearms = selfRef.GetWornForm(0x00000010) as Armor
calves = selfRef.GetWornForm(0x00000100) as Armor
shield = selfRef.GetWornForm(0x00000200) as Armor boots = selfRef.GetWornForm(0x00000080) as Armor
Thanks for the instruction. You mean the zzTestScript.psc right? Can I edit with the Notepad and save it or I need specific coding program to recompile it?
Rather late of an answer, but you need either the creation kit with the SKSE source scripts, Notepad++ or other similar text editor with a Papyrus compiler plugin. There is plenty of information on Google. Just search "compile papyrus scripts" or something similar and you'll find how to set up everything.
Been having some game freezes lately - and this is one of the mods I have introduced. As they are freezes and not ctds the crashlogs do not get generated, so the best I can come up with is the papyrus logs. Literally hundreds of these (and by hundreds, closer to 1,000 than 100 in about 1 hour)
[07/05/2021 - 10:01:42PM] Error: Cannot call HasKeyword() on a None object, aborting function call stack: [Active effect 2 on (00000014)].zzTestScript.CountHeavyArmor() - "zzTestScript.psc" Line 114 [Active effect 2 on (00000014)].zzTestScript.OnObjectEquipped() - "zzTestScript.psc" Line 52
which, given the "CountHeavyArmor script I would naturally assume to be this. My character is not wearing ANY heavy armour pieces btw.
I probably should have read the description a bit closer - I thought this was a general effect not just the player character - I only realised when I saw the logs only had reference to (00000014). I never wear Heavy armour, so not much use anyway. Is it perhaps having issues if there are NO (0) pieces of Heavy Armour?
Btw - there is another script bloater going on, producing a similar amount of errors, and that is Nemesis not getting along with XPMSE
I'm not entirely sure based on the description alone, but I assume that the optional file is an alternate version of the mainfile, that I should install on its own instead of like a patch to the main file?
Is it safe to compact the form ID's of this mod's esp in order to ESLify it? I checked this mod's script and it doesn't reference anything from this mod's esp. I suspect it would be safe to compact but I wanted to check here just in case.
35 comments
Function CountHeavyArmor()
if (selfRef != NONE)
count = 0
String test = "";
cuirass = selfRef.GetWornForm(0x00000004) as Armor
gauntlets = selfRef.GetWornForm(0x00000008) as Armor
helmet = selfRef.GetWornForm(0x00000001) as Armor
circlet = selfRef.GetWornForm(0x00001000) as Armor
forearms = selfRef.GetWornForm(0x00000010) as Armor
calves = selfRef.GetWornForm(0x00000100) as Armor
shield = selfRef.GetWornForm(0x00000200) as Armor
boots = selfRef.GetWornForm(0x00000080) as Armor
if(cuirass != NONE && cuirass.HasKeyword(HeavyArmorKeyword))
count = count + 1;
endif
if(gauntlets != NONE && gauntlets.HasKeyword(HeavyArmorKeyword))
count = count + 1;
endif
if(helmet != NONE && helmet.HasKeyword(HeavyArmorKeyword))
count = count + 1;
endif
if(circlet != NONE && circlet.HasKeyword(HeavyArmorKeyword))
count = count + 1;
endif
if(forearms != NONE && forearms.HasKeyword(HeavyArmorKeyword))
count = count + 1;
endif
if(calves != NONE && calves.HasKeyword(HeavyArmorKeyword))
count = count + 1;
endif
if(shield != NONE && shield.HasKeyword(HeavyArmorKeyword))
count = count + 1;
endif
if(boots != NONE && boots.HasKeyword(HeavyArmorKeyword))
count = count + 1;
endif
if(count >= 3)
selfRef.AddSpell(SpellHeavyArmorFlag, false)
else
selfRef.RemoveSpell(SpellHeavyArmorFlag)
endif
endif
EndFunction
replacing the CountHeavyArmor function with that should do the trick.
edit: that code is for the "3 pieces" version. Just replace the 3 in the last statement with 4 for the full version.
[07/05/2021 - 10:01:42PM] Error: Cannot call HasKeyword() on a None object, aborting function call
stack:
[Active effect 2 on (00000014)].zzTestScript.CountHeavyArmor() - "zzTestScript.psc" Line 114
[Active effect 2 on (00000014)].zzTestScript.OnObjectEquipped() - "zzTestScript.psc" Line 52
which, given the "CountHeavyArmor script I would naturally assume to be this. My character is not wearing ANY heavy armour pieces btw.
I probably should have read the description a bit closer - I thought this was a general effect not just the player character - I only realised when I saw the logs only had reference to (00000014). I never wear Heavy armour, so not much use anyway. Is it perhaps having issues if there are NO (0) pieces of Heavy Armour?
Btw - there is another script bloater going on, producing a similar amount of errors, and that is Nemesis not getting along with XPMSE
EDIT: Never mind then, apparently just getting an update, as said on their YouTube channel.
EDIT: Never mind then, apparently just getting an update, as said on their YouTube channel.
I love this mod by the way.
The thing is it's not an ESP-FE and takes a plugin spot.
I was able to change it into a flagged ESL if you want a copy of the file.
I didn't have to fiddle around with anything.
I just ran it in SSEdit, got no errors when I compacted the file, and then chose the ESL flag, and then save, and that was it and it worked.