Skyrim
0 of 0

File information

Last updated

Original upload

Created by

SlappyBags420

Uploaded by

SlappyBags420

Virus scan

Safe to use

Tags for this mod

About this mod

Allows automatic storage and placement of necklaces, amulets, circlets, and rings in 4 variaties of display cases: large angled, large flat, small angled, small flat

Requirements
Permissions and credits
This is a mod that turns Display Cases into Jewelry Cases that automatically arranges necklaces, amulets, circlets, and rings.  It was a mod started by fg109.  The idea was fantastic, but the scripts did not work.  All the math functions fg109 wrote for placing and all of the logic for how to place them was perfect.  Those parts were not changed other than variable names and some debug lines.  He included the following in his description: "I'm not going to provide any support or updates. Use it at your own risk. Anyone who wants to use/modify this is free to do so."  So I did do.

Installation
============
The mod is really just 3 scripts and knowing how to set them up.  But to make things easy, I've made a small cell with a test room.  Add SKKCell to your \Data directory.  Add the .pex files to \Data\scripts.  Put the .psc files in \Data\scripts\Source.  Load up SkyRim.  Go to the console from anywhere (I go straight from the Continue/New/Load menu).  Type 'coc SKKCell'.  The room has one of each type of the 4 cases.  The cases are obvious, the triggers are inside the case under the glass, and the containers are the mini chests next to each case.  There is a regular chest in the room also with 4 necklaces and 10 rings for testing.

The best way to install these cases in your own mod is to load SKKCell.esp as a plugfile in the CReation Kit, then just copy/paste them into your own cells.  Select all 3 when you copy and the new script property references will point to each other already.  I've also named the items in a convenient way, so that when you do copy/paste them they will be easy to find and keep organized in the CellObjectView window.


How To Store Jewelry
====================

The mod works for 4 types of display cases.  Large angled and large flat cases store up to 4 necklaces, amulets, and circlets.  Small angled and small flat cases store up to 10 rings.  Each case works in 3 parts: the display case, a trigger inside the case, and a container.  Instead of using LinkedRefs and then casting the ref to one of the other scripts, I just add the script types as properties and set them in the Creation Kit.  Either way you have to add something via the editor, this saves code.  The TriggerScript and the ContainerScript have a proerty to the DisplayScript, which has prerties of the other 2, as well as a variable called DCType (Display Case Type).  This tells the case what items to accept and how to place them.

To store items, activate the Display Case in sneak mode.  This opens the container and moves all the items in the case, if any, into the container (they will disappear from the case).  Add/remove items as usual .  The container will only accept the item type it will display.  Close the container.  The container then drops them to the ground and then poisitions them into the same cell the case is in, but it uses the cases's location and some predefined offsets to place them inside the case under the glass.  So they are only stored in the chest temporarily and are placed in the world to be saved as any other object.  I've not had the duplication problems of some of the bookshelf mods I have used.

Activating the case while not in sneak mode opens/closes it as normal.  But if you pick up any of the items, this activates the trigger inside the case.  That item is then removed from the items list.  When you close the case, it will rearrange the items based on the new item count.

**************
**  ISSUES  **
**************
I put those "Is3dLoaded" checks which helped some of the timing issues.  But I read, and experienced why, you're supposed to put bail out checks after so many iterations to prevent infinite loop.  I didn't do that.  That hasn't been a problem, but it's still more robust code.  Problem is, it is so far into the process I don't know how bail and still recover the item.

I encountered some problems with certain items.  Almost every item when added to the container would show up in the OnItemAdded event as having a BaseItem but no ObjectReference.  I had The Gauldur Amulet, and when I put it in, the debug showed that had an ObjectReference.  But when I went to go reclaim it out of the chest using DropObject, it was returning back an object called "defaultBlockFollowerActivation", and would lock up the placement scripts, and cause the Gauldur Amulet (or any jewelry having this issue) to be lost.  I cloned a new one using console commands and that one worked like the others.  No clue what the defaultBlock thingy is, or how to detect it, or how to resolve it, or how it got on my amulet.



Please feel free to toy with the scripts.  Thanks again to fg109 for starting this.  I think I made some progress.