Skyrim

File information

Last updated

Original upload

Created by

Plymster

Uploaded by

plymster

Virus scan

Safe to use

Tags for this mod

About this mod

Script and meshes to support a single object working bookshelf. No more fiddling with complicated book markers, click triggers, etc. (Does not work with other bookshelf mods)

Requirements
Permissions and credits
Have you ever wanted to build a library for a player home, but got tired of fiddling with the in-game bookshelf system?  Have you ever wanted to move a bookshelf 1 unit forward, and then went cross-eyed after moving all the book markers, click triggers, etc?  Have you ever wanted a bookshelf system that allowed you to just fill up a full bookshelf, instead of each individual shelf?

Did you ever want to be able to display your potions, or staves, or beverages, or your GlenMoril witch heads?

Then this mod is for you.

This mod requires that you are generally familiar with modding, and have SKSE installed.


To Use This Mod

Either load the SOBookshelves.esp file when you are creating your mod and copy the desired bookshelf containers to your mod (by changing the names and clicking "yes" when it throws the "create a new form" warning) or duplicate the desired bookshelf containers.  The bookshelves are all listed under "WorldObjects/Containers" and start with "ply".  (Samples are located in the "aaaBookshelves" cell)


You can do the same with the "plyBookshelfTrigger" activator, if you want to also attach triggers to your bookshelves.


Alternatively, you can just create a new bookshelf container from scratch:

1. Create a new Container

2. Name it/modify it however you like

3. Use one of the meshes included in this mod


4. Add the "plyBookshelves2" script

5. Close your container, then re-open the container to edit the script settings


6. In the "BookTrackerRA" ObjectReference array, add the appropriate number of empty references (listed in the property comment).  The new values should all say "None" (ie: just click the add button and don't do anything else to each record).

7. For the "ItemType" property, enter the appropriate number for the type of items you are placing (for example: enter 2 if you plan to store staves in this container).  The default is "0" for books.  Hovering over the ItemType property reveals the different possible values.

8. Leave the "TriggerRef" property blank unless you are adding a Trigger to this object.


Regarding Triggers
Spoiler:  
Show

Each time a bookshelf container is opened, the Single Object Bookshelf script checks each of the external book meshes placed on the shelf mesh.  If any have moved more than 25 units from its original position, then it removes them from the container's object list.

Since it takes the bookshelf a short time (less than a second for a bookshelf with very few bookslots) to verify which book meshes are on its shelf mesh, it is possible for players to exploit the bookshelves by removing each book (or potion, or whatever) from the exterior (ie: clicking the mesh and taking the book), and then opening the bookshelf and quickly hitting "R" to Take All.  This allows the player to quickly double his supply of books/potions/staves/witch heads/whatever it contains.

To prevent this exploit, the standard bookshelves use a "trigger" to constantly monitor the contents of the bookshelf mesh area.  Every time a book leaves that space, it tells the bookshelf container to delete the book from its list.

Single Object Bookshelves now allow you to create and set a trigger for your bookshelves, using the "TriggerRef" property and the "plyBookshelfTrigger" activator.

* Note that you don't HAVE to create triggers for your bookshelves if you don't want to.  If you're making a mod for other people to enjoy, you probably should create a trigger for each bookshelf.

* Note that using triggers will break the ability to effectively move the bookshelf with Jaxonz (or Cobb's) Positioner.  I'm afraid I can't think of any way around this.

There is a sample "CommonBookshelf1" with trigger in the center of the aaaBookshelves cell, if you want to examine how a triggered bookshelf looks when properly set up.


To create a Bookshelf Trigger from scratch:


1. Create a new activator

2. Enter a unique ID and give it a name

3. Add the "plybookshelvestrigger" script to the activator


To add a Bookshelf Trigger to a bookshelf


1. Select your bookshelf Reference (ie: the bookshelf object in the render window). Make sure that you can markers are enabled by toggling "M".

2. Click the "Create Trigger" button (the cube with a "T" in it at the top of the Creation Kit menu)

3. Select "plyBookshelfTrigger" (or whatever you have named your Bookshelf Trigger in the Select Form dialogue box. You can use the "Filter" text box to search for it if you like.

4. You'll see an orange box appear around your bookshelf mesh. Right click this orange box to edit it.
4a. On the Primative tab, for the "Collision Layer" select "L_TRIGGER"
4b. On the Scripts tab, open the properties of the "plybookshelvestrigger" script and select the bookshelf mesh you want to attach this trigger to. (Use the "M" button to toggle the marker so you can select the underlying bookshelf mesh)

5. Edit the bookshelf Reference and on the scripts tab, change the "TriggerRef" property to point to the Trigger you just created for the bookshelf.



... And MORE:  Witch Head Basket, Stave Holders, Potion Shelves, and Drink Shelves!



FAQ
Why do I need your meshes?
Spoiler:  
Show
These meshes have been edited to contain nodes for each book marker.  When the bookshelf is activated for the first time, the markers are populated.


My books are upside down and backwards.  What gives?
Spoiler:  
Show
The bookshelf mesh works like a weapon rack (ie: the nodes can have unexpected behavior if they are placed at certain rotations).  The Bookshelf automatically checks this and shifts its angle slightly the first time it's loaded.  When testing your bookshelves, plan on starting in a separate cell and then entering the cell you've placed the bookshelves in.


Does this work with Unlimited Bookshelves (or any other bookshelf-related mod?)
Spoiler:  
Show
No.  Those all rely on the vanilla scripts.


When are you going to make a version that works with Unlimited Bookshelves (or other bookshelf-related mods)?
Spoiler:  
Show
Never... probably.


How many books does each bookshelf hold?
Spoiler:  
Show
That depends on the mesh used:
  • CommonDesk1 = 27
  • CommonShelf1 (and open) = 20
  • CommonShelf2 = 40
  • CommonShelf3 = 60
  • CommonShelfNarrow1 = 13
  • CommonShelfNarrow3 (and thin) = 40
  • DarkElfShelf1 = 20
  • DarkElfShelf2 = 40
  • DarkElfShelf3 = 60
  • DarkElfShelfNarrow1 = 13
  • DwemerShelf2 = 24
  • DwemerShelf3 = 36
  • DwemerShelfNarrow3 = 15
  • dweStaffHolder.nif = 6
  • glazedStaffHolder.nif = 6
  • GlenmorilHeadBasket.nif = 5
  • NobleLectern = 12
  • NobleShelf2 = 26
  • NobleShelf3 = 39
  • NobleShelf4 (and open) = 52
  • NobleWallShelf = 15
  • NobleWallShelfWide= 21
  • UCFConsole1 = 14
  • UCFConsole4 = 56
  • UCFShelf2 = 28
  • UCFShelf3 = 42
  • UCFShelf4 = 56
  • UpperShelf1 = 20
  • UpperShelf3 = 60



How do I know what mesh looks like what bookshelf?
Spoiler:  
Show
[/color]The naming convention for the meshes is (generally):
<style><item><number of shelves><variant type>_bs

So if you want a common bookshelf that's 3 shelves tall and a bit thin, it's called "CommonShelfNarrow3Thin_bs".
A standard 4 shelf Noble bookshelf is "NobleShelf4_bs".
A Lectern in the Noble style is "NobleLectern01_bs" (yeah, I screwed up the naming convention a bit here.  You get what you pay for.  ;-) )


The Open bookshelf meshes have an arrow associated with them.  What does that mean?
Spoiler:  
Show
The arrow points to the direction that you want the books' spines facing.  I did this because I got tired of guessing which way to place them.


Why did you turn the wall shelves upside down?
Spoiler:  
Show
I couldn't think of a good mesh for bookends, and this seemed easier.


OMG! This is AMAZING!  How did you do it so I can steal it and charge money for it!?!
Spoiler:  
Show
Er... please don't do that.  But if you want to know how the script works, I've included the source file with it.


How do you set the bookshelves so that they support non-book items
Spoiler:  
Show
As of version 1.04, there's a new ItemType property for the script that you can set the types of objects allowed. Currently the different Item Types are:
  • Books (0, the default)
  • Any (1 - I don't recommend this unless you've got a custom mesh you want to use)
  • Staves (2 - havok is disabled, meaning they won't move once placed)
  • Potions (3 - havok is disabled)
  • Glenmoril Witch Heads (4 - havok is disabled)
  • Drinks (5 - havok is disabled)



What if I want to move this bookshelf with Jaxonz Positioner?
Spoiler:  
Show
As of version 1.02, you can reset the bookshelf by striking it (this will remove the placed books and markers, though the books will remain in the container), then you can move the bookshelf wherever, and the next time you activate it, the markers will reload themselves. You'll have to add or remove a book for the shelves to repopulate.

Note that this functionality doesn't work if you have added a trigger to the bookshelf

Much thanks to TheBlackKnight3000 for this suggestion!



Updates

Version 1.01 - Now includes Dwemer shelves. (Note - The dwemer shelves are 20% taller than standard meshes to be able to hold big books.)

Version 1.02 - The script now includes support for Jaxonz Positioner and non-book items (if you build a mesh that you want to use to store other items, like a potion shelf or a platter that holds food).  Much thanks to TheBlackKnight3000 for his helpful suggestions and code snippets.

Version 1.03 - Added 5 modified meshes from Upper Class Furniture Pack V2.0 (by icecreamassassin and Monk_ide) with permission from icecreamassassin.  The rest of the meshes from this mod are quite nice - check them out if you haven't already.

Version 1.04 - Added Stave Holders, Witch Head Basket, and Potion Shelves and Drink Shelves, and the ability to add Bookshelf Triggers.

Version 1.05 - Fixed a minor timing bug when using the Bookshelf Triggers, that would sometimes (depending on the timing of the mesh placement) delete books accidentally.  This will only affect you if you are using the Bookshelf Trigger option.