Adding A Custom Book Title To The Game

From SimsWiki
Jump to: navigation, search

How To Add A Custom Book To The Sims 3


What you will need...

* S3pe
* Notepad++ [Optional]

Step 1 - Extracting The Files

a.) Open up S3PE and go to file then open.

b.) Select the GameplayData.package usually located in Program Files\Electronic Arts\The Sims 3\Game\Bin\Gameplay

c.) You'll most likely get the following error...


The selected file could not be opened read-write.
C:\Program Files (x86)\Electronic Arts\The Sims 3\Game\Bin\Gameplay\GameplayData.package
Access to the path 'C:\Program Files (x86)\Electronic Arts\The Sims 3\Game\Bin\Gameplay\GameplayData.package' is denied.

Retry as read-only?


d.) Choose retry and the file will open.

e.) In the name box put Books and set the resource type as 0x0333406c. Check the checkbox next to each.

f.) Hit set and then check filter active.

g.) Your search results will contain a couple dozen xml files. The one you want is called oddly enough Books.

h.) Right click on the Books.xml and choose export to file. Remember where you save it. You'll be needing it in the next part of the tutorial.

i.) Uncheck the filter active checkbox or simply close and reopen S3pe.

Step 2 - Building The Package

a.) Click on file and then new to make a new package in S3pe.

b.) Click on resource and then import choosing from file as your choice and picking the Books.xml you just exported.

c.) Check the use resource name checkbox on import. This will save you alot of trouble later on when you need to update the resource which EA seems to add a new Jimmy Sprocket book every expansion pack.

d.) You should now have two files in your package. Books.xml and a Key file with no name. Go ahead and save your package.

Step 3 - Adding Your Book To The Xml

a.) Highlight your Books.xml and you can see the contents of it on the right. You can't edit the contents there it's just a preview. But first we're going to set up S3PE in order to use Notepad++ instead of Notepad for our editing needs.

b.) Go to settings - external programs. Check the checkbox next to use an external text editor. Click browse and navigate to where you installed Notepad++ and choose the Notepad++.exe. In the helpers section check the checkbox next to Notepad and choose disabled. You may have to restart S3PE in order for these changes to take effect. If you're comfortable enough using Notepad then you don't need to bother with this step. I find Notepad++ better due to the numbered lines and the formating it does on xml files but feel free to use whatever you like. I'll be including line numbers and the corrisponding text in this tutorial for those using Notepad.

c.) Right click on your Books.xml and choose text editor.

d.) Your Books.xml should now be open in the text editor of your choice. Let's take a look at how EA defines the books.

<BookGeneral>
<Title>OpenSeason-TheStoryOfGrantRodiek</Title>
<Author>WaylonWilsonoff</Author>
<Genre>Autobiography</Genre>
<Length>546</Length>
<Value>25</Value>
<GeometryState>BookLargeThick</GeometryState>
<MaterialState>bookBiography</MaterialState>
</BookGeneral>

<BookGeneral></BookGeneral> ~ Everything between these two tags defines a single book.
<Title></Title> ~ This defines the title of your book. You would enter the text in here without spaces or puncuation ie MyBook instead of My Book. A word of advice try to avoid using long book names simply because what's written here can be changed in the final part of the tutorial. So instead of for instance HarryPotterandtheSorcerersStone use HarryPotter1 or HarryPotterBook1 the text in the game can still display the proper book title because that's done via the STBL which we will be writing later on.
<Author></Author> ~ This defines the author of your book same as the title no spaces or puncuation. Ie JKRowling.
<Genre></Genre> ~ This defines the genre of the book. For example Childrens.

Valid Genres

Autobiography
Fantasy
Childrens
Mystery
Trashy
Drama
SciFi
Fiction
PoliticalMemoir Humor
Historical
Romance
Satire
NonFiction
Vaudeville
Biography
None

<Length></Length> ~ This defines the length of your book. The longer it is the longer it takes Sims to read it.
<Value></Value> ~ How much it costs to buy your book.
<GeometryState></GeometryState> ~ This defines the mesh the book will use in the game.

Valid Geometry States

BookLargeThick
BookLargeThin
BookMediumThick
BookMediumThin
BookSmallThin

<MaterialState></MaterialState> ~ This is the texture your book uses in game. While it may be possible to add your own custom book textures it's not covered in this tutorial since I don't know how to do it just yet.

Valid Material States

bookFiction
bookNonFiction
bookRomance
bookDrama
bookSciFi
bookFantasy
bookHumor
bookMystery
bookHistorical
bookChildrens
bookGeneric3
bookGeneric2
bookGeneric1
bookMasterpiece_SkLvl1
bookMasterpiece_SkLvl2
bookMasterpiece_SkLvl3
bookBiography

There's also alot more material states like the toddler and fishing books, recipes, music, etc. You can find these by searching thru the <MaterialState> tags. There's also a few other pieces of code like <NotInBookStore></NotInBookStore>,<AllowedWorldTypes></AllowedWorldTypes> and <AllowedWorlds></AllowedWorlds> These are bit more advanced and not really necessary for this tutorial.

e.) Now we're going to highlight lines 17 thru 25 in Notepad++ this would be the part below for those with older versions of the game and those using plain Notepad.

<BookGeneral> <Title>OpenSeason-TheStoryOfGrantRodiek</Title>
<Author>WaylonWilsonoff</Author>
<Genre>Autobiography</Genre>
<Length>546</Length>
<Value>25</Value>
<GeometryState>BookLargeThick</GeometryState>
<MaterialState>bookBiography</MaterialState>
</BookGeneral>


Or you can use the following code which is what I'm going to do. If you want to use another book as template for your book that's fine either way works.

<BookGeneral>
<Title></Title>
<Author></Author>
<Genre></Genre>
<Length></Length>
<Value></Value>
<GeometryState></GeometryState>
<MaterialState></MaterialState>
</BookGeneral>

We're going to paste that after line 2385 if you have everything up until Showtime install. This would be after the last book general for older versions of the game or using Notepad right before the first <BookToddler>. For showtime it's after this...

<BookGeneral>
<Title>PerformanceArtistCareerOpportunityBook</Title>
<Author>RyanGrant</Author>
<Genre>Biography</Genre>
<Length>325</Length>
<Value>2495</Value>
<NotInBookStore>True</NotInBookStore>
<GeometryState>BookMediumThin</GeometryState>
<MaterialState>bookScience</MaterialState>
</BookGeneral>

and before this...

<BookToddler>
<Title>Test</Title>
<Author>Author</Author>
<Kind>None</Kind>
<Length>180</Length>
<Value>100</Value>
<PagesMinNorm>0.045</PagesMinNorm>
<PagesMinBW>0.0675</PagesMinBW>
<NotInBookStore>False</NotInBookStore>
<GeometryState>BookLargeThick</GeometryState>
<MaterialState>bookToddlerFunny</MaterialState>
<AllowedWorldTypes>Base,Downtown</AllowedWorldTypes>
<AllowedWorlds></AllowedWorlds>
</BookToddler>


f.) So we would put our cursor on the line </BookGeneral> for the book prior to the start of the <BookToddler> section and hit enter. Now that we have a new line we paste the book or code we copied earlier.

<BookGeneral>
<Title></Title>
<Author></Author>
<Genre></Genre>
<Length></Length>
<Value></Value>
<GeometryState></GeometryState>
<MaterialState></MaterialState>
</BookGeneral>


g.) Now we're going to fill out the information for our book.

<BookGeneral>
<Title>HarryPotterBook1</Title>
<Author>JKRowling</Author>
<Genre>Childrens</Genre>
<Length>320</Length>
<Value>25</Value>
<GeometryState>BookMediumThick</GeometryState>
<MaterialState>bookChildrens</MaterialState>
</BookGeneral>


h.) Close Notepad++ and it should ask you if you want to save your file. Choose yes. S3PE will give you a pop up telling you the resource has been updated. Choose to commit changes and you'll now see one of your Books.xmls has been crossed out and new one has appeared. Save your package now and the deleted resource will go away.

Step 4 - Writing The STBL

a.) If you were to go and try and buy your book in the game right now it would show up in the bookstore as Gameplay/Excel/Books/BookGeneral:HarryPotterBook1 with an author of Gameplay/Excel/Books/BookGeneral:JKRowling or it would show up as a blank in newer versions of the game. If you get blank and need to know the text for your book I recommend Twallan's Untranslated Key but since I already know the key for this I'll tell you how to fix it.

b.) Go to resource - add in S3PE set the type to STBL 0x220557DA the group to 0x00000000 skip over the instance for now and put something like MyCustomBooks.STBL as the resource name then hit FNV64 for your instance to be generated. DO NOT HIT OK. You need to change the first two values of your instance to make the language of your game.

These are the numbers for different languages:

English = 00
Chinese = 01
Taiwanese = 02
Czech = 03
Danish = 04
Dutch = 05
Finnish = 06
French = 07
German = 08
Greek = 09
Hungarian = 0A
Italian = 0B
Japanese = 0C
Korean = 0D
Norwegian = 0E
Polish = 0F
PortugueseStandard = 10
PortugueseBrazillian = 11
Russian = 12
SpanishStandard = 13
SpanishMexican = 14
Swedish = 15
Thai = 16

So my instance of 0x86462F352BF0A669 would become 0x00462F352BF0A669. Once you've done that hit OK. Then save your package.

c.) Now we're going to fix our STBL so the game will display our correct book title instead of Gameplay/Excel/Books/BookGeneral:HarryPotterBook1. Right click on your STBL and choose edit STBL to bring up the STBL Resource Editor.

d.) Now you'll see a box with Add, Change, Delete at the bottom of the editor. Nothing on the left or right of the screen. Paste Gameplay/Excel/Books/BookGeneral:HarryPotterBook1 into that box or whatever your book is named in the xml. It most usually is always Gameplay/Excel/Books/BookGeneral:BOOKNAME or Gameplay/Excel/Books/BookGeneral:AUTHORNAME replacing the capped text with the name from your xml.

e.) You'll see the Add button has now lit up. Hit it.

f.) Now your string Gameplay/Excel/Books/BookGeneral:HarryPotterBook1 has been converted into a hash 0x3017BAB4435796C0 which now replaces it. 0x3017BAB4435796C0 is the hashed version of Gameplay/Excel/Books/BookGeneral:HarryPotterBook1

g.) Now put your cursor in the window on the right side of the screen next to your hash on the left side. This is where you would put the text you want to appear in the game instead of Gameplay/Excel/Books/BookGeneral:HarryPotterBook1 in my case Harry Potter and the Sorcerer's Stone if you click on your hash again it should now say 0x3017BAB4435796C0: Harry Potter and the Sorcerer's Stone now repeat the above steps for your Gameplay/Excel/Books/BookGeneral:JKRowling string. Then once again in the right put the text you wish to put in the game. In my case J.K. Rowling.

h.) Save the STBL, commit the changes and save the package.

i.) Now put your package in your mods/packages folder if you haven't already and go test in game. If you've done everything right there should be your new book in the bookstore when you buy books and it should be using your new text instead of the Gameplay/Excel/Books/BookGeneral:BOOKNAME and Gameplay/Excel/Books/BookGeneral:AUTHORNAME.

j.) Did it work? Give yourself a pat on the back.

If you had any trouble with the tutorial or have questions feel free to ask them here

Thanks to Inge, Peter, Echo, and everyone who helped with the original discovery of how to add new books . Sorry, it took me so long to redo this tutorial after the original was lost.

ThomasRiordan

Personal tools
Namespaces

Variants
Actions
Navigation
game select
Toolbox