4
\$\begingroup\$

I'm working on a mod for soul gems in Skyrim and want to add something like a Bag of Holding from souls.

The most simplyfied strategy I can come up with is

  1. Create an invisible Black Soul Gem to catch a trapped soul in inventory
  2. Create an item to act as representation of the soul wallet in inventory
  3. Create an invisible container somewhere to store the souls and link it to the above
  4. Create a script that detects soul trap and transfers it from inventory to soul wallet as a real black soul gem (or whatever is needed).

Ideally I'd want to make this a little more balanced that just handing out soul gems like candy but I think I could do that on my own once I actually get this far.

So this is about both parts (now):

  1. How can I carry around an inventory within my inventory?
  2. How can I detect that a soul has been captured (in my invisible gem)?
\$\endgroup\$
  • \$\begingroup\$ To make this a bit more balanced, you could require the player to put soul gems into the soul wallet. Anyway, for the inventory in inventory: create a new interior cell in creation kit, place a container inside. Upon using the soul wallet, call the function which opens a container on the container in your cell (by id of that container). I haven't looked very deep into papyrus scripting so far. But, I think the second part might require SKSE (skyrim script extender) for checking when the player casts spells with the soul trap effect. \$\endgroup\$ – Exilyth Feb 19 '16 at 21:24
2
\$\begingroup\$

Let's go through this step by step.

Before you can do anything else, you need to prevent the game from filling a normal empty soul gem which the player might be carrying in open inventory. The most thorough way to do this is to remove the normal soul trap magic effect from the soul trap spell and enchantment, and replace it with your own. Alternatively, you can use inventory events to detect when the player picks up a soul gem and remove it from their inventory, but this is likely to interfere with player freedom ("Why does this mod keep stealing my soul gems?"). An invisible black soul gem will not work, for several reasons, most importantly because there's no way to force the game to select that gem. If the player is carrying other black soul gems, a smaller gem that's big enough to hold the soul in question, or Azura's Star, you cannot prevent the game from selecting the "wrong" gem.

Assuming you choose to remove the standard magic effect, you will want to create your own custom effect, by copying the existing effect and removing its script(s) and (perhaps) keyword(s). This should have an ActiveMagicEffect script on it to detect when the affected actor dies. Since ActiveMagicEffect also receives events from the actor, it's a simple matter to write an OnDeath event to detect the victim's death and add a filled soul gem of the appropriate size.

But we don't just want to put the gems in the player's inventory. We want to stuff them into a bag of holding. So you create a cell with a container (e.g. a chest), as sarahm suggests in a comment, set it not to respawn, and put your soul gems there. When you need to open the bag of holding, you can activate the container or just use Papyrus to move items between it and open inventory. The latter may be preferable if you want to prevent the player from putting random objects into the bag.

It would be nice to also have the soul trap special effect play when the victim dies, but I'm not entirely sure how to do this.

|improve this answer|||||
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.