Odd script behavior with soul gems.

Post » Fri Aug 19, 2011 9:49 am

As part of the advanced magecraft mod, we offer the option of removing souls from soul gems. However, I seem to be running into a bit of a problem here..... Petty SG's work fine, any other gems, that have less than a full load... as it were, do not replace correctly. I end up with a petty gem, regardless of what the gem was when I started out. I though this was due to the wrye bash 'tweak names' setting, so, added an 'or' clause to discover what gem I was dealing with, but, that only made sure that it actually removed the soul from the gem. When ti would add an empty one, I would get a petty gem, no matter the original. As I was using the editor ID of the gems, I thought maybe that was the problem, so, reverted to the formID of the gem in question. This worked, sorta... in that gems, regardless of value, that were completely filled, were replaced correctly, I think..... but, those that weren't completely filled, were returned as petty gems.

I went digging thru the CS, trying to find out just why this was so, and it appears that, according to the CS, they all use the same mesh, and icon. But, in my inventory, I can see that the icons are indeed different. I am real curious what is going on here. Here is the script in question:

Spoiler
scn aaaDisensoul

ref Item

Begin Function { Item }

if ( GetSoulLevel Item == 0 )
Message "This Soulgem Is Already Empty!"
Return
endif

if ( NameIncludes "Petty" Item || nameincludes "soul gem I" item )
Player.RemoveItemNS Item 1
Player.AddItemNS 23d67 1
MessageEx "%n: Disensouled!" Item
Return
elseif ( NameIncludes "Lesser" Item || nameincludes "soul gem II" item )
Player.RemoveItemNS Item 1
Player.AddItemNS 23d69 1
MessageEx "%n: Disensouled!" Item
Return
elseif ( NameIncludes "Common" Item || nameincludes "soul gem III" item )
Player.RemoveItemNS Item 1
Player.AddItemNS 15b8b 1
MessageEx "%n: Disensouled!" Item
Return
elseif ( NameIncludes "Greater" Item || nameincludes "soul gem IV" item )
Player.RemoveItemNS Item 1
Player.AddItemNS 15b8c 1
MessageEx "%n: Disensouled!" Item
Return
elseif ( NameIncludes "Grand" Item || nameincludes "soul gem V" item )
Player.RemoveItemNS Item 1
Player.AddItemNS 15b8e 1
MessageEx "%n: Disensouled!" Item
Return
elseif ( NameIncludes "Black" Item )
Player.RemoveItemNS Item 1
Player.AddItemNS BlackSoulGem 1
MessageEx "%n: Disensouled!" Item
Return
else
MessageEx "%n: Cannot Be Disensouled!" Item
Return
endif

End

User avatar
Steph
 
Posts: 3469
Joined: Sun Nov 19, 2006 7:44 am

Return to IV - Oblivion