Provides for basic fantasy RPG genre, such as one with Elves and Dwarves.
This is a library that includes basic fantasy RPG genre elements, including various races, languages, etc. You can use it to base your world off of, or merely as an example.
The fantary library requires the Basic RPG library (and also Basic IF library) to work. You should set the Basic Fantasy library to a higher priority than the Basic RPG library.
01 Books, letters, and signs – cBook and friends
How to easily create books.
Books, letters, and signs - cBook and friends
Circumreality includes a cBook object that makes it easy to create your
own books. To create a book:
-
Create an object as normal.
-
Sub-class it off of cBook.
-
Set pNLPNounName and pNLPParseName if
you wan't to use a more creative name for your object than
just "book".
-
Set pBookCover to the title of the book.
-
Set pBookPages to the text (and/or graphics) to
be displayed on each page.
-
Set pBookLanguage to the language that the book
is written in. This defaults to "common".
That's it.
You may also wish to set the following properties:
-
pBookAutoFirstPage causes the book to automatically
flip back to the first page after awhile. Use this for public
books so players find them at the start page.
-
pBookBindingDepth, pBookBindingRotate, pBookBindingWidth,
pBookLayoutCover, pBookLayoutPageLeft, pBookLayoutPageOffset,
and pBookLayoutPageRight should
be changed if you change the size or shape of
pBookVisualClosed, pBookVisualOpen,
and/or pBookVisualPage.
-
pBookCanTear controls whether a book can be
torn up or not.
-
pBookFont and pBookFontCover change the
font used by the book.
-
pBookFontFaceUnknownLanguage is used to use an
unreadable font (such as "Symbol") when a player character doesn't
understand the language that the book is in.
-
pBookNoCover and pBookNoCoverViewSingly turn
the book into a series of pages.
-
pBookPageLayoutNumberingLeft and
pBookPageLayoutNumberingRight control where the page numbers go.
-
pBookPageLayoutText controls where the text goes on the page.
-
pBookPageOpenTo affects the page that the book is opened to.
This must always be an even number.
-
pBookPagesCutScenes is a list of cut scenes resources for
each page, causing the "reading" of the book to play a cut scene.
-
pBookVisualClosed, pBookVisualOpen, and pBookVisualPage let
your change the color, size, and shape of the book.
You may wish to write your own methods:
-
BookPage() just returns a page from pBookPages by default.
You probably won't have to override this, but you might think of a reason.
-
BookPageEncode() makes it easy to automatically "encode"
a page so that the players have to decipher it. (Aka: a puzzle)
-
BookPageLayout() can be overridden to control the
layout of a specific page.
-
BookPageLayoutNumbering() affects where and how the
page numbering appears.
-
BookPageNextPrevious() is called when the player flips
to the next/previous page. If you wanted to booby-trap your book,
you could have it explore when the right page is flipped to.
-
BookPageRead() is called when a player asks to read
the page. By default this reads a cutscene from pBookPagesCutScenes.
-
BookPages() returns the number of pages in the book.
-
BookPageTouch() is called if a player touches a page
in the book.
-
BookVisualGetNoText() returns the visual of the book
without any text super-imposed on it.
Books are containers, and based off of cContainer. They can't hold
very much in them though, just other pieces of paper.
If an object (piece of paper) is placed in the book, and the
page is flipped (using BookPageNextPrevious()), then the
object will be hidden by setting its pHidden to TRUE. The
object will also have its pSearchBookPage set to the page
where the object was placed.
When a player flips back to that page, the object will be
unhidden, and the player will be notified of the object.
SearchInsideThis() is overridden for books so that a "Search the book"
command won't find anything. Instead, players will have to flip
through individual pages and see if anything falls out.
Letters and bits of paper
You can create letters and bits of paper by:
-
Create an object based on cPaperSheets if you wish
it to be displayed like a book with sheets on the left
and right, but with no cover,
or cPaperSheet to display a single sheet at a time.
-
Fill in properties as per cBook, except don't
worry about the cover.
Signing books (and letters) in cBook
You can allow players (or NPCs) to sign books and letters by:
-
Set pBookSignaturesMax to the maximum number of signatures
allowed in the book. This defaults to 0.
You might also wish to modify the following:
-
You might wish to set pBookSignaturesPerPage and pBookSignaturesLastPage to
control how many signatures are on a page.
-
pBookSignatures can be pre-loaded with signatures.
-
You may wish to set pCanManipulateWhenHeldByOther to TRUE
so that PCs (or NPCs) can see, manipulate, and sign the book even if its
held by another PC (or NPC). This setting is particularly useful for petitions
where a PC can merely show it to another PC and not have to give it.
-
pBookSignaturesNPCs, pBookSignaturesPCs, and pBookSignaturesClass affect
whether players and/or NPCs are allowed to sign the book.
-
pBookDefaultAIShowLike and pBookDefaultAIShowLikeByClass control
how much a NPC must like the PC before they're willing to sign.
-
pBookDefaultAIShowIfSignLike and pBookDefaultAIShowIfNotSignLike control
how much the NPC's opinion of the PC is changed by being asked to sign.
-
pBookDefaultAIShowIfSignSpeak and pBookDefaultAIShowIfNotSignSpeak are
spoken before the NPC signs, or if the NPC decides not to sign.
-
To produce special reactions, write your
own DefaultAIShow() and DefaultAIOffer() methods.
You can create signs by:
-
Create an object based on cSign.
-
Set pBookPages to a list with only one
item (aka: page), the writing on your sign.
-
Fill in other properties as per cBook, except don't
worry about the cover.
Share with your friends: |