Thursday, February 23, 2012

Tutorial: Creating a new book


Object: Create a new book and implement it ingame

Difficulty: Easy

Time Needed: Less than 5 minutes + writing the content

Things you will need:


  • Creation Kit. The Creation Kit is the modding tool for Skyrim and can be downloaded for free on Steam.
  • Some skills in writing, preferably =D


Creating the new book

1. Open the Creation Kit and load Skyrim.esm.
2. In the Object Window, go to Items>Book and choose a book with a look you like. You can preview the book by right-clicking on its line and clicking on preview. A window will pop up with a small viewport in which you can move the book up and down to view both sides. You could also right-click in the list>New to create a new book but is much easier to edit an already existing book.
Also do not duplicate items! This is a very messy option, just forget about it.

3. Once you've selected the book you like, just double click on it or right-click>Edit. A window will pop up in which you can control what's going to be in your book, what is its title, if it can teach spells or skills, how much it costs... This is quite easy to edit. Still the first thing you should edit is the ID of the book (in red below) to make sure you won't edit an original book by mistake.
I advice you to insert a code in the name so you can find it easily with the filter, like here "EBMTelvanniSweets" where "EBM" stands for "ExtendedBooks Mod" of course.
When you have changed the ID and click OK a window will prompt. Click OK and your new book can be found in the Object Windows.

We'll come back to text formating later, for now let's keep on going.

4. Now you can save your mod and test it. Testing is 50% of game development and you should do it often to be able to know when it started to bug in case it happens.
Don't forget to activate your mod in the Date files option before starting to play.
To access your book though it wasn't placed in the world of Skyrim you can either load any save or go to the test cell by opening the console. To open the console press the key that is just under the ESC key top left of your keyboard. For some it might be the tilde key, for other it can be the ¬ key, depends on keyboard. Just press keys until a grey layer appears down the screen, type coc QASmoke and press enter.

5. When the level is loaded open the console again and type Help "Name of your book" 4 to obtain its ID. Of course type the name of your book between the brackets.
When you have the ID, type player.additem 0200d67 1 (but replace 0200d67 by the ID you get). This will add the book to your inventory so you can read it and enjoy!

If the book appears correctly then you can place it in the world, add it to level lists etc.


Formating the text

To have your text nicely formated in your book, with the title on a first page, well centered, and the content coming on the next page, nicely as well, you have to use various tags that are quite similar to HTML formating. If you haven't any basic skills in web formating don't worry, it's really, really simple!

1. There is one first thing you should remember before starting to add any text in the input field:
Pay a great attention to apostrophs and brackets, it may sound stupid but the font used ingame is very strict on characters. Thus your apostrophs and brackets should be the default ones you get with US/UK qwerty keyboards. In fact avoid any special character in general and anything generated by alt-codes, no thin spaces or such formating.
  • ['] and not [] (the second one has a slight curve)
  • [" "] and not [“ ”] (the second ones are slightly curved as well)
  • [...] and not [] (the second one is only one character composed with the alt+0133 code in spite of 3 dots)
2. The following tags are the most useful ones that you likely will use in most of your books:
  • [pagebreak] is obviously a page break. It should stand on an empty line, you can't put it at the end or beginning of a paragraph.
  • <p align="center"> centers your text. It isn't really necessary to close the tag with a </p> but you can do it if you want. You can use other alignment values that are "left", "right" and "justify" as it seems, according to the CK wiki, that the "chaotic evil" alignment wasn't implemented.NOTE that this tag changes the paragraph! Paragraphs are seperated by the equivalent of skipping 3 lines. Just so you know.
3. The following tags will help you change the appearance of the text itself.
  • <b></b> bolds the text placed between these tags.
  • <i></i> italicizes the text placed between these tags.
  • <font color="#FFFFFF"></color> changes the color of the font. Replace #FFFFFF by the hexadecimal value of the color of your choice. You can obtain this value on a web color index or in a CG software such as Photoshop in the color box.
  • <font size="20"></font> changes the point size of the font. We haven't figured out yet if 20 is the default size but it seems credible.
  • <font face='$HandwrittenFont'></font> changes the font (in handwritten font here). by default the font used is the one seen in the books so you should use this tag only if you want to switch to another font. The available fonts and their tags can be seen below.

$SkyrimBooks (or  $PrintedFont ) - $HandwrittenBold (or  $HandwrittenFont )
 $DaedricFont $DragonFont (Upper case only)
$DwemerFont - $FalmerFont (Upper case only) 


4. The following tag allows you to insert images in your book.
  • <img src='img://Textures/Interface/Books/Illuminated_Letters/A_letter.png'> inserts an illuminated letter's picture. You may need to insert size values in the tag after the path to the image. Just add  height='40' width='40' and replace the numbers by the right values. You can replace the A in A_letter.png by any other letter to get the one you want. If you insert this tag within a paragraph the text around should wrap around it. Click here more a tutorial teaching how to add your own images to a book.

Feedback:


If you have any comments/questions, or would like to request a tutorial, then please feel free to leave a comment. I will answer your question as quick as I can. If you request a tutorial, I'll let you know when/if you should expect your request to be fulfilled.

20 comments:

  1. What is the code to obtain the player's name?
    And the code that would show the current bounty?
    I'd like to make a mod with wanted posters

    ReplyDelete
    Replies
    1. There is page on the official Creation Wiki that explains how to replace text: http://www.creationkit.com/Text_Replacement

      Note: For Messages and Books, the base objects must be associated with a specific quest in order to use text replacement.

      Delete
    2. Thanks but I've been there and i can"t make anything out of it :(
      Could you please post how i should get those informations?

      Delete
    3. I found in the CK, where the player name goes in the Dark Brotherhood letter of assassination. Hope that it works :)

      Delete
  2. Could you tell us how to place the books in the world? Trying to make a mod where you're following a paper trail that will lead to a new artifact. But I have no clue how to place said books in the world in the places I intend to lead to.

    Every tutorial I look up just shows how to make the objects, nothing on placing them in the world.

    ReplyDelete
    Replies
    1. To place the books in the world you simply have to drag them from the Object window (the one listing all the objects where you created the books) and drop them in the Render window, where you want to put them in your level. A cell must be loaded of course: to load a cell you just have to select it and double click it, in Cell list (the left column) on the Cell View window. When your cell is loaded and you have drag-n'dropped your book in the Render window, you can place it, using the mouse buttons and X/Z keys.
      You can find more information on how to navigate in cells and place objects on this page: http://www.creationkit.com/Bethesda_Tutorial_Creation_Kit_Interface

      Also note that you can only drag-n'drop one book at a time, from the Object window to the Render window. However it is possible to copy/paste/duplicate the objects you manipulate in the Render view to quickly increase the number of a same reference.

      Delete
  3. Can you determine how many skill points the book adds

    ReplyDelete
    Replies
    1. I'm not skilled in scripting enough to do that but if you can find the script that adds the extra point to the skill, I assume it's possible. You can also surely create a whole new script to add any extra points to any skill at once without using the interface. In any way you'll need to do some scripting.
      I wish to dabble into this kind of scripting in way to add quest objectives and new spells to books but this won't be before EBMv2 is released. I would suggest you however to take a look over books like Lost Legends to see how it adds quest objectives and see if you can replace by adding skill points instead.

      Delete
  4. Alright, I'm going mad now. I'm following the markup script as specified, but I cannot change the in-game font in any way in my books. No bold, no italics, no colours or sizes. The only markup that's working for me is the page breaks and alignments. I'm out of ideas now, can anyone help?

    ReplyDelete
    Replies
    1. Hi!
      If the tags appear in your book, it would mean that they contain a typo. If they don't appear it means that they are written correctly, but that a previous one might be broken or not closed. I have also noticed that if you try to add several tags to a same content (ie: have a bold italic blue big title) they might cancel each other. I wouldn't say this feature is buggy because it seems pretty consistent in what it does or doesn't do, but it is certainly capricious.
      I would suggest you to make some tests in a test book, by writing text samples like "This text should be bolded", "this text should be italicized", "this text should be blue", etc, and putting the appropriate tags. Keep the "this text should be italicized, blue and big" for the end, and see what works and what doesn't.
      I hope this helps you!

      Delete
    2. Thanks for the reply man. I tried the test book. basically, if I just have <.b.>THIS TEXT IS BOLD it should show up in bold yes? I had one inside a set of <.p.> tags and one outside, and I still can't get certain tags to work. The Img and Font tags worked flawlessly, but the directly text-editing tags haven't. (had to put dots in the tags so they'd go through here)

      Delete
    3. It should, yes. Now, it's also possible that the difference isn't very visible. You could possibly search for the QA test book ingame, with the help command in the console, to see how bold and italicized texts look. I sadly don't have screenshots for this and no real time to make tests right now.

      Delete
  5. Is there a way to make the book a regular object? I.e how would I have it show up on random bookshelves with random merchants or as random drops?

    ReplyDelete
    Replies
    1. To have it show in containers (chests, merchant inventories, etc...) you must add the book to leveled lists. Note that it might be better to make custom lists to avoid conflicts with other mods that would be modifying the same lists.
      Here is a tutorial about adding items to leveled lists: http://tesmods.blogspot.be/2012/04/tutorial-leveled-lists-part-1-adding.html

      To have the books randomly appear on tables or shelves you would need to make a completely different manipulation that I've never tried myself. I think DarkFox127 made a Youtube tutorial about leveled items, I don't know if it would work for books but you can always check out his channel, there are very awesome tutorials there.

      Delete
  6. Used your post to add a little note to my MOD, thanks it is a great tutorial.

    ReplyDelete
  7. When I preview the book, it doesn't show up. The model box is blank, what should I do?

    ReplyDelete
    Replies
    1. That must be because the path to the nif file is missing, which happens if you try to edit it without selecting a new model. It's actually very annoying to fix because, since you can't browse the bsa in which the model is stored, you need to type (or copy paste) the path to the model, ie: clutter\books\mybook.nif

      So, double click on your book to edit it and check the World Art field (on the left part of the window, above the Inventory Art drop-down menu). You can locate it on this screenshot:
      http://2.bp.blogspot.com/-DOt1bb8v16I/T0Z0B2o1MJI/AAAAAAAAAQQ/FKn2zgTKVnA/s1600/CKaddingBook04.jpg
      Notice how there is a path that is specified there. If your field is blank, then you should open a book with the same appearance as yours, select the path and press ctrl+C. Do NOT click on the edit button!
      Then return to your book with missing model, and this time you can click on Edit. You might have another window pop up in which you have to click on Edit one more time (I don't remember perfectly). Click Edit all the way until you have a Windows Explorer browsing window. There you just have to paste the path, click ok, and it should solve it all.

      Delete
  8. How do you create a book that teaches multiple skills just like the Oghma Infinnium?

    ReplyDelete
    Replies
    1. This would probably take more scripting. Maybe take a look at the Oghma's script and see if there's something you can tweak or reuse :)

      Delete