#=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=# Book/Library Scene# Author: ForeverZer0# Version: 1.2# Date: 9.1.2010#=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=## Version History:# v. 1.0 9.1.2010# - Original version# v. 1.1 9.3.2010# - Added option for full-screen text# - Made the page number window slightly wider# v. 1.2 9.25.2010# - Added option to simply call scene with the book ID argument and have# that book already displayed.## Introduction:# Calls a scene that will allow player to read through books that they have# collected. ## Features:# - Easy to configure, text is read from an external text document# - Text will automatically fit itself into the proper size for the window# width and pages, regardless of font or font size.# # Instructions:# 1. Fill in the configuration below.# 2. Create a new folder within the "Data" folder, and name it "Books".# 3. Within this folder, create simple text documents (.txt).# 4. Name them EXACTLY as you did for its respective title (below).# 5. Turn word-wrap OFF.# 6. Create as large as document as you would like, but only break to a new# line in between paragraphs, not when the text reaches the edge of the# window. Every time a new line is started, it guarantees that the current# line will start on a new line in the scene, regardless of the font size.## Use the following Script Calls:# Books.unlock(BOOK_ID) # - Unlocks the book with BOOK_ID# $scene = Scene_Book.new # - Calls the Book scene.# $scene = Scene_Book.new(BOOK_ID)# - Calls the book scene. The book with BOOK_ID will already be displayed.# This will also disable the book list feature. The book does not have# to be unlocked to call this way.## Credits/Thanks:# ForeverZer0, for the script# Blizzard, for the "slice_text" method#=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

RETURN_SCENE = Scene_Map # Class of the scene that the game return to after you exit the book scene. SORT_BY_ID = true # If true, the books will be listed in order of their Book ID, else they will # be listed in the order they were aquired. PAGE_TURN_SE = ['046-Book01', 80, 100] # Set to the name of the SE that will be played when a player turns a page. # Set to nil to disable this feature. [FILENAME, VOLUME, PITCH] FULLSCREEN_TEXT = false # If true, the text window will extend over the book list and take up the # entire screen (minus the header).

def self.title(book_id) # Here is where you define the labels used for the books. The titles will # be used as the filename to be loaded as well. # when BOOK_ID then 'TITLE' return case book_id when 0 then 'Genesis' when 1 then 'Exodus' when 2 then 'Leviticus' when 3 then 'Numbers' when 4 then 'Deuteronomy' end end

def self.unlock(book_id) # Adds the Book ID to the array. unless $game_system.books.include?(book_id) $game_system.books.push(book_id) # Sorts the array by the Book IDs if so configured. if SORT_BY_ID $game_system.books.sort! end end end

Oh my god this is fantastic! <3 No mess, no hassle, so easy to use! Best of no NO ANNOYING FORMATTING OF THE TEXT FILES! <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3 <3

One little little extra request? An added option to select a book to read, with out the little side menu? Like find a book, pick it up and you read, with just the title, pages, and the text? Then can have it as it currently is as a list to go back to reread past books you already found.

Oh and.. is the text size thing really part of it? I made the mistake of going SIZE 6 and like holy molly that's tinny, and changing all the game text. It was very much so silly XD

As for the text size thing, that was just to show how the page will format to whatever the font and size are. I wouldn't use size 6 either. This will make it so that the text always is formatted correctly, even if the player has control of the font and font size. The only drawback is that the text cannot be pre-formatted and stored, which causes that half a second of lag when you first select a book and it needs to open the text document, etc.

Logged

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

A bit off topic, but Zer0, you should make all the list of scripts in your signature actual links to said scripts.Dats convenient.I think all scripters should have that! (cept maybe Blizzard, cuz he's got...a LOT.)

Logged

A bright light can either illuminate or blind, but how will you know which until you open your eyes?

Like to be able to read a book with out going through the list. Like going to a library, picking a book and instantly going to the book text and reading. Then (for me anyway) the list could be of books you've already read to reread again... or not use the list scene at all and go back to each book in game to reread it.

Hey, this is a really epic script!But, I was wondering if there was something in the script I could edit to make a picture display at the bottom of the page, that varies from each book, any ideas?It should be simple I think

Hey FZ0, Can I make a small added request with this? I'd like to be able to change the font color of the text as well as the font used. I tried it myself, but each time I try it throws back an error. Rather with@text_window.font.color@self.contents.font.colorsame with font type.yet@text_window.windowskinworked just fine to change the window skin O.o;;;

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.

they are all topics that don't have the template applied I take it? because I couldn't find these topics.

Zer0, I'm sorry were gonna hijack your thread and discuses moderation of the RGSS section now

« Last Edit: December 05, 2010, 12:47:09 PM by Ryex »

Logged

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.