Tutorial Bookshelves

From the CreationKit Wiki
Revision as of 01:50, 11 February 2012 by imported>EpsilonNaught (→‎Making A Bookshelf)
Jump to navigation Jump to search
200px Alert image.png TAKE NOTICE!

This article has been flagged as incomplete or inaccurate. Take any information here with a grain of salt.

Help out! If you have the knowledge needed, please edit this article so we can remove the Incomplete flag.


Bookshelves

There are many bookshelves littered about Skyrim. Bookshelves provide players with a convenient and aesthetically pleasing way to store books. This tutorial covers the creation of a bookcase.

The Pieces

A bookshelf contains five main non-physics components:

  • A visual static object that the books will rest on
  • A container for each shelf
  • A marker for each book on the shelf
  • A click trigger for the player to use it
  • A trigger that allows the books to spawn

Making A Bookshelf

1. Start out by opening the desired world space.

2. Pick a bookshelf model and place it in the area to work with. An easy one to start with is "CommonShelf01" under Static>CLUTTER.

3. Find the marker for a book called "DefaultBookShelfBookMarker" under Items>Book>DummyItems. Be careful not to select "DummyBook." Place it vertically and rotate it so it would be able to rest on the shelf. Press F to easily rest it on the surface of the shelf. Once you placed it correctly, press Ctrl+D in order to duplicate it. Drag the duplicated marker and repeat as many times as necessary. For this shelf, 18 books should fit perfectly.

4. Now, the books need a place to "be stored." Find the "PlayerBookShelfContainer" under WorldObjects>Container>Markers. Drag it into the render window and place it somewhere near the bookshelf.

5. In order for the books to "be stored" by the newly placed container, they need to be referenced to it. So right-click on the container and select Edit. Under the Linked Ref tab, should appear a blank list. Right click inside the white-space and select New. This will bring up the Choose Reference window. If your camera is focused on the shelf, using the "Select Reference in Render Window" button will make things easy. A target will show up as the cursor, and hover over the first book marker on the shelf. The target should turn white. Double-click the book marker and it will fill out the Cell, and Ref fields automatically. For the keyword, scroll down (or hit B) and select "BookShelfBook01". Hit Okay and repeat the process until you have all 18 books referenced.

  • Note: Each time, change the keyword to the number of the book respectively. e.g 01,02,03,04,...,16,17,18.

Here is an example below:

  • Keyword..............| .....Reference........ | ......ID
  • BookShelfBook01 | DefaultBookMarker | 00000001
  • BookShelfBook02 | DefaultBookMarker | 00000002
  • BookShelfBook03 | DefaultBookMarker | 00000003
  • BookShelfBook04 | DefaultBookMarker | 00000004

Adding the triggers

We now have a working bookcase, but we don't have a way for the player to use it. We need two triggers to do this, to create a trigger press the T at the top of the screen then click where you want it to be placed. The first is a click trigger. The other is a generic trigger that updates the container when a book is taken off the shelf. The editor comes with these, and the scripts are already attached.

Drag a PlayerBookShelfTrigger (under Activators) into your cell, expand and move it until it encases all of your books. This is the item that tests if books are taken from the bookshelf and updates the PlayerBookShelfContainer, it requires a link to the container (NONE as keyword) and for the PlayerBookShelfContainer to link to it with "BookShelfTrigger01" as the keyword. Now when a book is taken through the shelf and not the container the book will also be taken out of the container, as long as that book is inside the PlayerBookShelfTrigger.

Now drag a PlayerBookShelfClickTrigger into your cell. Edit it and go to the linked refs tab. The only ref we need to add here is our container. The keyword is, as you may guess, BookShelfContainer. Inside the primitive tab player activation needs to be ticked. This Trigger makes the bookshelf container assessable by a different location.

Containment of books

The player needs some way to prevent the books from falling out of the book case and preventing the "PlayerBookShelfTrigger" from not working. This is done by placing a 3d container (C in cube at top) and placing it in front of the bookshelf. The Container needs to have its Collision layer set to L_UNIDENTIFIED as this layer allows the user to still grab the books but doesn't allow the books to escape. The container needs to be placed in front of all the books and not leave a gap for the books to fall out of.

Almost complete

This is as far as I've gotten. This setup gives you a shelf where you can place and grab books from via your inventory. However, there is no physics going on here, so the books can't be dragged around. You're also going to need to place collision geometry to prevent the books from falling through the bookcase.

Someone else will clean the rest of this up.