BookLib - KVonGit/quest5-stuff GitHub Wiki
The library:
Once the library is included, you will see a new tab on objects:
You can select a "Book" type or a "Page" type.
Simply select "Book" from the dropdown.
The object will be made openable/closable, and the READ verb will be added to it.
You can go to the object's "Container" tab to make things happen after opening or closing the book (or to lock it).
When creating a "Page" object, I highly recommend naming the object "Page 1" (using the appropriate page number).
Go to the "Book Options" tab, and select "Page" from the dropdown.
Now you will see this screen:
Fill in the page's text in the field.
If the page has a next page in the same book, you can check the box and select the object:
The object will have READ and TURN verbs automatically added.
The look
attribute on the object will be set to a script which runs the object's read
script, whichprints the text in the field on the object's "Book Options" tab, then adds a "Next Page" link if the next page is set up.
Changing the look
script (or changing it to plain text) shouldn't hurt anything. I left it like it is so author's could easily customize that if they wished to do so.
To add a page, just move the object to the book object, and to remove a page, remove it from the book object.
The code:
<!--Saved by Quest 5.7.6606.27193-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="BookLib.aslx" />
<game name="BookLib Tester">
<gameid>b7403834-cb15-41c2-ab17-97571afb3aac</gameid>
<version>0.0.1</version>
<firstpublished>2018</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="book">
<inherit name="editor_object" />
<inherit name="booktype" />
<object name="Page 1">
<inherit name="editor_object" />
<inherit name="pagetype" />
<hasnextpage />
<pagetext><![CDATA[This is the first page of the book!<br/>]]></pagetext>
<nextpage type="object">Page 2</nextpage>
</object>
<object name="Page 2">
<inherit name="editor_object" />
<inherit name="pagetype" />
<pagetext><![CDATA[This is the second page of the book!<br/>]]></pagetext>
</object>
</object>
</object>
</asl>