EISLibrarium 1.02 [Updated]

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
515
Reaction score
676
First Language
English
Primarily Uses
RMMV
Intro:


This is a plugin that allows you to create books that the player can read in game via events, or common events.


It brings up a book scene, which lets you go through a book page by page.


Changelog:

  • KRBook.js replaced by EISLibrarium.js
  • Add multiple language support
  • Fix issues with searching
  • Add support for languages without spaces (Japanese, etc).




The new plugin has the same features, plus more, to support devs in creating an interesting game.


Version: 1.02


Script Files:


View attachment KRBook.js (Old Version)


View attachment EISLibrarium.js (New Version)


JSON File Template (Download this if you want a file to start from.)


Librarium.json (Right Click "raw" then save link as to download.)


Website


For the most recent version, check out the website post here : http://endlessillusoft.com/eis-librarium/

Companion Tool: http://endlessillusoft.com/eis-librarium-writer/


Features:

  • Displaying books in game

  • Unlimited amount of books

  • Unlimited amount of pages

  • JSON file type

  • Can call via events or common events

  • Works with Yanfly's Message Core


New Features

  • Automatic word wrapping (brings the new word to the second line, instead of cutting off part of the word)

  • Supports text codes

  • Background image for the book scene

  • Show book text in the message window

  • Grab book text content to store in a variable




Instructions:

  1. Install the script with the same name: KRBook.js or EISLibrarium.js.

  2. If you want to show one of your books, call it by title using the KR.Helpers.startBookScene(title) script function.

    • Your title should be in quotes, and it is not case sensitive.


  3. Create a .json file with the file name that you want to use.

    • Create the necessary .json structure shown in the feature example window, or copy and paste the code snippet as a starting point.

      Need to maintain the structure of the file, or else it won't work correctly.



  4. Yanfly's Message Core Specific (Not Required For Librarium):

    • Type <wordwrap> at the beginning of your 'pageText' to enable word wrapping.

    • Type <br> or <linebreak> to insert a linebreak in the 'pageText'.


  5. Have fun!




Script Calls (Librarium)


/*
//=============================================================================
// Script Calls
//=============================================================================
*
* SceneManager.startBookScene(title)
* This script call will open the book scene, so that players can view a book
* of your choice. You need to pass the title of your book in quotes.
* Example:
* SceneManager.startBookScene("lilia");
* Titles are not case sensitive.
*
* Librarium.getBookContents(title);
* This script call will return the book contents, which you can store in a
* variable for example.
* Example:
* Librarium.getBookContents("lilia");
*
* Librarium.showInMessageWindow(title)
* Shows the book contents in the message window used for showText commands.
* The text doesn't have word wrapping like the scene, so you'll need a plugin
* that supports word wrapping. (Yanfly)
* Example:
* Librarium.showInMessageWindow("lilia");
*/



Code:
//Single Book Item -- Can copy and paste this to the end of the list in the book file after adding a , to the last entry
{
    "title": "Empty Book",
    "pages": [
      {
        "pageNumber": 1,
        "pageText": "This is the first page."
      },
      {
        "pageNumber": 2, 
        "pageText": "This is page 2 of the book"
      }
    ]
  }
//Book File Setup -- Save this to JSON file in your data folder with the specified file name you declare in the plugin.
[
  {
    "title": "A Testing Guide",
    "pages": [
      {
        "pageNumber": 1,
        "pageText": "This is the first page."
      },
      {
        "pageNumber": 2, 
        "pageText": "This is page 2 of the book"
      }
    ]
  },
  {
    "title": "Lilia",
    "pages": [
      {
        "pageNumber": 1,
        "pageText": "Lilia was a made from the town of Chrystal."
      },
      {
        "pageNumber": 2,
        "pageText": "This is page 2 of the book. This is a very long string of text however, so hello there!"
      },
      {
        "pageNumber": 3,
        "pageText": "Chrystal is a village of extreme wonder, \\I[33] and it was treated as such by many. One had to be careful how they treated the villages there; it was certaintly not easy to get along."
      }
    ]
  }
]

Setup Example Windows:



































































In-game Examples:


Librarium Scene






































































Credits:


Free for both commercial and non-commercial use.Credit with the name Kino.


Thanks:Thank you to anyone who decides to use this script; I appreciate it!


If there are any bugs/issue, please contact me via message on the forums. I want to try and make the script as extensible/flexible as possible, so if you have an ideas also


please message me.
 
Last edited:

JohnnyR

Dungeon Master
Restaff
Joined
Mar 27, 2013
Messages
275
Reaction score
135
First Language
English
Primarily Uses
RMMV
Hey, I tried using your plugin but I keep getting an "Unexpected Identifier" error every time I try to open a book in-game.


I've looked into it and apparently it's not a compatibility issue, since I tried it on a new project just to be sure. Maybe it could be something related to the latest version of MV itself, dunno...


Any ideas?
 

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
515
Reaction score
676
First Language
English
Primarily Uses
RMMV
If you could  provide a screenshot of the development tools  (F8) after the error shows up, and a picture of your JSON file. I may be able  to see what's wrong.
 

JohnnyR

Dungeon Master
Restaff
Joined
Mar 27, 2013
Messages
275
Reaction score
135
First Language
English
Primarily Uses
RMMV
Sure.




Just some info:


The scripts that also show in the SyntaxError have nothing to do with this bug. I tested this myself by removing each one of them, and yet, nothing changed.
 

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
515
Reaction score
676
First Language
English
Primarily Uses
RMMV
Thanks, If you could give me a screenshot of the Book plug-in. that would be very helpful because then I could see if it's a problem with the file itself. I don't see any issues in the developer tools so it's probably with the syntax in the book.json in itself or rather in the file used to generate your books so a screenshot would be required it should be a JSON file.
 

JohnnyR

Dungeon Master
Restaff
Joined
Mar 27, 2013
Messages
275
Reaction score
135
First Language
English
Primarily Uses
RMMV
Hey, Kino.


Sorry for such a late reply.


I've had quite a busy month, so I totally forgot about this, sorry.


Anyway, I've attached a file with both versions of the Book.json and the KRBook.js files that I'm using, hope it helps.

View attachment KR Plugin.rar
 

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
515
Reaction score
676
First Language
English
Primarily Uses
RMMV
Lol, no worries. Glad to hear back from you. In fact, I'll be updating this plugin to make it a lot better hopefully.


@JohnnyR


This is what I got from trying it on my end.





So, there's no issue with the JSON file. Just to make sure is the Book.json in your data folder in mv?


I also included a file to the version of KRBook that I currently have.

View attachment KRBook.js
 
Last edited by a moderator:

JohnnyR

Dungeon Master
Restaff
Joined
Mar 27, 2013
Messages
275
Reaction score
135
First Language
English
Primarily Uses
RMMV
I'll be updating this plugin to make it a lot better hopefully.


Just to make sure is the Book.json in your data folder in mv?


I also included a file to the version of KRBook that I currently have.


View attachment 49422


Glad to hear that!


Yes, I have the file in the data folder.


Also, I tested the file you provided above but I still got the same error message. I believe it is some kind of compatibility error with another script, but the problem is, those scripts in the dev tools I talked about earlier really weren't the problem, and since those were the closest thing I had to a clue, right now I have no idea of what could be causing this bug. And since I have far too many scripts running together, examining each one of them may take some time.


So, I'll try to find the conflicting script again, but if you have any ideas, just tell me. :D


Edit: Whatever problem I had earlier, it was fixed by the new version of the script!  :thumbsup-left: :rhappy:
 
Last edited by a moderator:

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
515
Reaction score
676
First Language
English
Primarily Uses
RMMV
This script is going places.  :rwink:
Will be coming up with a better way to allow users to enter text for books without all the hassle of typing it all on one line.
 

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
38
First Language
German
Primarily Uses
I always get an error.


"undefined is not a function"


In a new projekt the same error.


Here is the error screen

Unbenannt2.PNG
 

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
515
Reaction score
676
First Language
English
Primarily Uses
RMMV
@styx92Let's see if I can help you, can you show me the JSON file that you have and are using?
 
Last edited by a moderator:

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
515
Reaction score
676
First Language
English
Primarily Uses
RMMV
You're having the issue because you have two different things going on in the file.


You're going to want to delete everything before book file  setup. The stuff above it is an example of a single book that could be in the list.


@styx92 Or you can use this file here :



Librarium.json (Right Click "raw" then save link as to download)
 
Last edited by a moderator:

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
38
First Language
German
Primarily Uses
Hmm i have the same error, than before.


Mabye i used the script calls wrong?

Unbenannt3.PNG
 

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
515
Reaction score
676
First Language
English
Primarily Uses
RMMV
@styx92


Same error when starting up? And Nope, those are definitely the right script calls.


Try changing the pageText in the file. Some of them refer to ones from my Rem Text Script.



And that JSON file is the exact same one I have. Did you change the name of the plugin perhaps?
Can you show me the console window again? That would be helpful.
 

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
38
First Language
German
Primarily Uses

And the Librarium.json is in projekt/data folder.


The Librarium data is from your post.


Mabye you can upload a demo, then i can look how it works ;_;
 

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
38
First Language
German
Primarily Uses
@Kino I found some bugs in your plugin.
First one is if i give the books a title like "brief" and another book begins with the same word like "Brief 2" than your plugin catchs always the last book and show this. Like the picture. The plugin always shows "Brief aus Reynolds Haus" and not "Brief".
I use SceneManager.startBookScene("Brief"); and SceneManager.startBookScene("Brief aus Reynolds Haus"); and it always shows Brief aus Reynolds Haus.
I hope you know what i mean :D


Also the plugin dont show up '.......' or '( )' and some other standard symbols. And if i dont set a dot at the end of a sentence it dont show the last word(s). The red shows multible dots and the green shows what happens, if i dont set a dot at the end.

Here:

 

Attachments

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
515
Reaction score
676
First Language
English
Primarily Uses
RMMV
Thanks for the input @styx92
The searching isn't super smart, so I'll update it and displaying the text is kind of an issue right now; I'll rewrite it within the next 2 weeks.
Again, thanks for the input.
 

styx92

Veteran
Veteran
Joined
Jan 7, 2016
Messages
310
Reaction score
38
First Language
German
Primarily Uses
Cool!
I cant wait for it :)
 

Kino

EIS Game Dev
Veteran
Joined
Nov 27, 2015
Messages
515
Reaction score
676
First Language
English
Primarily Uses
RMMV
Hey @styx92 I just wanted to provide a short status update. I fixed the issue with the searching, but the sentences will require a bit more time. (Need to think of a better way to process sentences and line breaks / word wrapping).


Updated : http://endlessillusoft.com/eis-librarium/
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

In today's seminar:
Presenter: In the past, there was a saying, "One who has tuberculosis is doomed for life." But now-
Everyone: *starts coughing in unision*
Gosh... Today seems too much like a good day to do nothing....

I need to keep myself focused...! :kaoback:
javascript'ing essentials.

So, what can I do solve this problem, guys? The plugin is MOG_Weather and I have several Yanfly plugins too.

Forum statistics

Threads
93,696
Messages
914,700
Members
123,294
Latest member
xav1t0
Top