Jump to content

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


Recommended Posts

Posted
View 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.



View File

 

Posted
8 hours ago, bermik said:

Hello!
I am a very stupid person and I did not understand: is it a mod or not? Can this be used in the game? How to do it?

It's a modder's resource, which means it does nothing on it's own, however integration is very easy if you know how to do anything in the creation kit. Just install the SKSE plugin and the script, create a new ESP in the CK, and insert a book anywhere in the world. Attach the script included in this file to it, and you will be able to try this out.

Posted
5 hours ago, BigOnes69 said:

So at some point could there be fixed script and an area for response. Then that area of response could be used for the outcome in a mod. ?????

That can already be done, essentially. Just set the "intro text" in the book's CK info to your fixed script, and keep all of the script properties at the default. Intro will show until user starts typing, ModEvent will output everything that was typed.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...