Difference between revisions of "Tutorial Bookshelves"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>EpsilonNaught
imported>JaferSmash
Line 31: Line 31:


==Adding the triggers==
==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. The first is a click trigger. The other is a generic trigger than probably initializes the books when the player enters an area (I'm not sure). Luckily, the editor comes with these, and the scripts are already attached, so we don't have to do that much!
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. 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. My bookshelf has one, but it doesn't link to anything, so I'm not sure if you even need it.
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 PlayerBookShlfTrigger.


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.
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.


==Almost complete==
==Almost complete==

Revision as of 01:29, 11 February 2012

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 our Bookshelf

For the sake of simplicity, we will only make one shelf, and it will only contain 4 books.

First, pick a bookshelf model from the object list and place it somewhere in your area. This has nothing to do with the bookshelf, and in fact, you can even make book "piles" built vertically if you want.

Next, we need a container to store our books. Under "Containers" in the object list, drag the "PlayerBookShelfContainer" into your area. It doesn't matter where you put it, but I would put them somewhere near your bookshelf.

Placing the "Books"

Now the tedious part: Each shelf needs a bunch of markers. Each marker represents the location where a particular book will spawn when placed on the shelf. I find it easy to copy an entire bookshelf from another area (like Vlindrel Hall) so I don't have to manually align each marker, but since our shelf will be simple, we can do that. Drag "DefaultBookShelfBookMarker" from the object list (use the filter, I don't know where it is) and position it in place of where you want one of the books to spawn. Let's say this gets the ref 00000001. Place three more book markers, and let's say they get refs 00000002, 00000003, and 00000004.

Now we need to attach our markers to the container we made. To do this, right click on the container in either the render window or in the cell view and click "edit." Scroll to the "Linked ref" section and make a new ref. For the Cell ref, select the current cell. For the Ref, select the first marker you made (with ref 00000001) For the keyword, select BookShelfBook01. This sets up a single book to be placed. Do this again for each book marker you've made, so we should have a ref list that looks like:

  • 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. 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 PlayerBookShlfTrigger.

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.

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.