Script to fix soul trap ?

Post » Wed Feb 20, 2013 7:11 am

Consider these two soul gems, and their IDs inside the Creation Kit:

- PettySoulGem: 0002E4E2 (empty)
- PettySoulGemFilled: 0002E4E3 (filled)

When a soul is trapped using spell or weapon, the empty gem is still considered the empty object type, even after being filled. And you can easily see this by calling "player.getitemcount 0002E4E2" before and after filling your gem. I mean, the empty gem object (0002E4E2) is not transformed into the filled version (0002E4E3), but rather flagged in some way to show it's filled now. This is probably the reason why we have different prices for filled gems, stacking issues, gems losing the soul when dropped, and so on.. On the other hand, found/bought filled gems are of the correct type (0002E4E3), and have no issues at all.

So, I'm trying to create a script that traps the soul correctly from the start. And this means correctly changing the gem ID when a soul is trapped, effectively removing one empty gem from the player "removeitem(0002E4E2)" and adding a filled one "additem(0002E4E3).

However, there are some serious problems here. I have no way to know which empty gems in inventory are already filled. For example, the player can already have a Petty gem filled with Petty soul, or even a Lesser gem with Petty soul, and my script will treat all these gems as empty, eventually being removed during "removeitem(0002E4E2)".

Any ideas how to do this?
User avatar
Nana Samboy
 
Posts: 3424
Joined: Thu Sep 14, 2006 4:29 pm

Return to V - Skyrim