Jump to content

Papyrus Check if Armor is Enchanted?


Recommended Posts

Posted

Does anyone know how it would be possible to (with papyrus coding) check if an armor/clothing/weapon has an enchantment on it?
I do not need to know what the enchantment is, merely if there is an enchantment at all.

I'm thinking it could be done with the GetEnchantement() command, but the wiki states that it'll check the base object and not the object reference, meaning that player-forged and mod-added enchantments would seemingly slip through the cracks of such a check.

Posted

ObjectReference.psc. Requires SKSE.

 

; Returns the player-made enchantment if there is one
Enchantment Function GetEnchantment() native

 

Wiki

 

Quote

This is the only way to obtain player created enchantments. Items equipped on the player, with custom enchantments will return none if used with Armor.GetEnchantment. In order to get player created enchantments, this function must be used on the item outside of a container.

 

it may not work if its not equipped, i forget is player inventory is considered a flat container. there was a lot of crazy things i had to do with expired's nioverride to get items in the inventory to maintain unique data, thats all i really remember.

Posted

Would you mind linking to that wiki?
I'm using the Creationkit.com wiki and that info isn't there in the GetEnchantment article. If there's an alternate wiki with more information than the creationkit website, I could really use it.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...