Using Papyrus, how do you determine if an item is enchanted?

Post » Wed Jun 20, 2012 7:59 am

For my next Creation Kit brain teaser, we delve into the handling of items in the OnItemAdded event. What I would like to know is to find out if the currently added item has any level of enchantment or not...???
.
Thanks in advance
User avatar
Emzy Baby!
 
Posts: 3416
Joined: Wed Oct 18, 2006 5:02 pm

Post » Wed Jun 20, 2012 5:53 pm

FormList Property EnchantedItemFLST AutoEvent OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)	If EnchantedItemFLST.HasForm(akBaseItem)		;Do something	EndIfEndEvent
...is all I can think of, then sort WEAP and ARMO items in the CK by "Enchanting" and add the enchanted ones to EnchantedItemFLST. Probably won't cover player enchanted stuff and definitely won't catch mod added ones though... Perhaps, in time, SKSE could hook up a Form.IsEnchanted() function.
User avatar
Sammykins
 
Posts: 3330
Joined: Fri Jun 23, 2006 10:48 am

Post » Wed Jun 20, 2012 5:25 am

FormList Property EnchantedItemFLST AutoEvent OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)	If EnchantedItemFLST.HasForm(akBaseItem)		;Do something	EndIfEndEvent
...is all I can think of, then sort WEAP and ARMO items in the CK by "Enchanting" and add the enchanted ones to EnchantedItemFLST. Probably won't cover player enchanted stuff and definitely won't catch mod added ones though... Perhaps, in time, SKSE could hook up a Form.IsEnchanted() function.
.
Thank you, http://www.gamesas.com/user/408976-justinother/. While they're at it, a Form.IsFavorite() function would be kind of handy for a page or squire package which, on a dialogue option, strips everything out of your inventory and sorts it away (over 24 game-hours) - except for designated kit or gear you mark as favorite so that it stays with you. Just imagine, less time pottering around at home and more time getting harassed, pummeled and pounded on the road.
.
As you can see, I'm not in my right mind today, which probably means you'll find me in my left mind.
User avatar
Heather Stewart
 
Posts: 3525
Joined: Thu Aug 10, 2006 11:04 pm

Post » Wed Jun 20, 2012 3:14 pm

behippo mentioned IsFavorite() is in their list, so it will be. I actually need that function too, so I can't wait! ^__^ *drools*
User avatar
josie treuberg
 
Posts: 3572
Joined: Wed Feb 07, 2007 7:56 am

Post » Wed Jun 20, 2012 3:10 pm

I think it would be even better if one of Bethesda's updates were to include expanded access to object variables ... Hint, hint....
User avatar
JD bernal
 
Posts: 3450
Joined: Sun Sep 02, 2007 8:10 am


Return to V - Skyrim