Jump to content

BookTxtAPI - Write In Books, Read the Output! [Experimental/Modders Resource] 1.1


2 Screenshots

About This File

BookTxtAPI::Read,Write,Books
 
WHAT IS THIS FOR?
BookTxtAPI, quite simply, allows the user (or modder) to write into books, and for modders to receive the written content and do something with it. 
 
REQUIRES
SKSE.
 
DEVELOPMENT CONSIDERATIONS

 

 

  • This is an experimental plugin. To our understanding, it is stable and robust. However, you should be prepared for unexpected behavior and even a rare crash.
  • There is no defined character limit. The user can type until the SKSE plugin runs out of memory, which probably wouldn't even stand a chance of happening until 10,000+ characters.
  •  When more then one page of content is entered, each character returns it back to the first page. This makes multi-page entry technically possible, but impractical.  

 

INTEGRATION

 

1) Attach the included script BookTxtAPI.pex to books you would like to use for text entry. Notes are supported as well. Input is sent to the ModEvent (step 3) when the book is closed. Book Input support all alphanumeric characters (A-Z,0-9) and some special characters (!,@,#,$,%,&,*,(,),:,',-,_) plus comma.

 

2) Set the properties for BookTxtAPI.pex. These properties change the book's behavior:

DisableResetOnClose_ThisBook
Set to TRUE if you would like to retain the written content after the book is closed.
EnablePickUp_ThisBook
(EXPERIMENTAL) Allows book to be picked up. You cannot write into books within your inventory.
SkipIntroPage_ThisBook
Skip the intro (creation kit default) text and load right into any custom text.
DisableUserWrite_ThisBook
Disables user's ability to write in the book. Used if you would like to dynamically create books but not allow theuser to write in them (ex, wanted posters)

3) (OPTIONAL) Set the book's text via script:


Book Text can either be entered in papyrus prior to opening the book, or by the user. In a script that will fire before the book is opened, write:

;PROPERTIES
BookTxtAPI Property API Auto

;CODE
Function FiresBeforeBookOpened()
API.SetTextByObjectReference("Hello, World")
EndFunction

Set the property BookTxtAPI to the ObjectReference of the book you would like to modify.

 

4) Catch events by using our ModEvents:

 

 Registration:  ; on each game load
 RegisterForModEvent("BookTxtAPI_TextEntered", "BookResult") ; catch book text
 Event:
 Event BookResult(Form sender,string BookText) ; catch book text
;form sender is what sent the event
;booktext is the user input from the time the book was opened until it was closed and reset.
 EndEvent 

 

USAGE TERMS

 

ANY AND ALL SOFTWARE USING THIS API MUST REQUIRE THIS PLUGIN TO BE DOWNLOADED INDEPENDENTLY FROM THIS DOWNLOAD PAGE. THE SOFTWARE MAY NOT BE INCLUDED IN A MOD PACKAGE AND DISTRIBUTED INDEPENDENTLY.

 

This software is licensed to you Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International.
- You may not modify (fork) the code. 
- You may only use the work in a non-commercial manner, with attribution.
- Commercial uses of the work (paid mods) will be considered if we are notified and give prior approval with mutually agreed upon terms.
- We will not charge for the usage of this content, if the user is not profiting upon the distribution of this content, at any time.


What's New in Version 1.1

Released

- Script Properties for controlling book functions

- Set the book text in a remote script via call


Other Files from SewerRats


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use