Author: Pheonix KageDesu
RPG Maker Versions: MZ, MV
URL: https://kdworkshop.net/simple-lorebook
Simple Lorebook is a data-driven lore / codex menu.
- Lore entries are configured in plugin parameters (Lore Database).
- Each entry can have multiple text variants, images, an optional SE audio, and unlock conditions.
- In RPG Maker MZ you can control entries via Plugin Commands.
- In RPG Maker MV/MZ you can control entries via global API script calls.
- Installation: Download the plugin and place it in your RPG Maker project's
js/pluginsfolder. - Activation: Open the Plugin Manager in RPG Maker and activate the Simple Lorebook plugin.
- Configuration: Customize the plugin parameters to suit your game's needs.
Notes:
- Make sure your project also contains the plugin resource folders:
data\PKD_SimpleLorebookimg\PKD_SimpleLorebook
- If you use the default UI, these folders contain the NUI layout/config and images.
Lore entries are configured in the plugin parameter Lore Database (loreDatabase).
Each element is a LoreEntry structure:
- Title Text (
titleText): entry title shown in the list. - Text Variants (
textVariants): an array of texts (each is a Note field).- The plugin uses an internal current text index to choose which variant to show.
- Tip: you can store multiple versions (e.g. short/long, before/after some plot point).
- Image Set (
imageSet): images for this entry.- Cover Image (
cover): file fromimg/pictures. - Illustration Image (
illustration): file fromimg/pictures. - Note: the current implementation uses only
coverandillustration.
- Cover Image (
- Audio File Name (
audioFileName): optional SE file fromaudio/se. - Unlock Conditions (
unlockConditions): array of conditions that must be met. - Require All Conditions (
requireAllConditions):true: all conditions must be met.false: any one condition is enough.
Unlock conditions (structure LoreCondition):
- Type (
type):variable/switch/item - Variable: set
variableIdandexpectedValue(condition is met when variable value is>= expectedValue). - Switch: set
switchId(condition is met when switch is ON). - Item: set
itemId(condition is met when the party has the item).
If unlockConditions is empty, the entry is considered unlockable immediately.
You have multiple ways to open the lorebook:
- Main Menu option (MZ/MV)
- Enable Add Lorebook To Main Menu (
isAddLorebookMenuOption). - Set Lorebook Menu Option Title (
lorebookMenuOptionTitle).
- Enable Add Lorebook To Main Menu (
- Plugin Command (MZ only):
OpenLorebook - Script Call (MZ and MV):
OpenLorebook()
All commands use Lore Entry Index (entryIndex) as a 1-based index (1 = first entry in the database).
- Open Lorebook
- Command:
OpenLorebook
- Command:
- Change Lore Entry Text Index
- Command:
ChangeLoreEntryTextIndex - Args:
entryIndex(number, min 1)newTextIndex(number, min 1)
- Command:
- Set New Audio For Lore Entry
- Command:
SetNewAudioForLoreEntry - Args:
entryIndex(number, min 1)seFilename(file fromaudio/se)
- Command:
- Set New Cover Image For Lore Entry
- Command:
SetNewCoverImageForLoreEntry - Args:
entryIndex(number, min 1)imageFilename(file fromimg/pictures)
- Command:
- Set New Illustration Image For Lore Entry
- Command:
SetNewIllustrationImageForLoreEntry - Args:
entryIndex(number, min 1)imageFilename(file fromimg/pictures)
- Command:
- Set Entry Hidden State
- Command:
SetEntryHiddenState - Args:
entryIndex(number, min 1)hidden(boolean):true= hide,false= show
- Command:
The plugin exposes global functions on window, so you can call them from Script events.
Entry indexing:
entryIndexis 1-based (same as plugin commands).newTextIndexis 1-based (same as plugin commands).
Available calls:
OpenLorebook()ChangeLoreEntryTextIndex(entryIndex, newTextIndex)SetNewAudioForLoreEntry(entryIndex, seFilename)SetNewCoverImageForLoreEntry(entryIndex, imageFilename)SetNewIllustrationImageForLoreEntry(entryIndex, imageFilename)SetEntryHiddenState(entryIndex, hidden)
These calls modify the entry state (text variant / images / audio / hidden flag) at runtime.
Examples:
// Change the text variant of the first lore entry to the second variant
ChangeLoreEntryTextIndex(1, 2);
// Set a new cover image for the third lore entry
SetNewCoverImageForLoreEntry(3, "new_cover_image");
// Hide the fifth lore entry
SetEntryHiddenState(5, true);- Lore Database (
loreDatabase): array of LoreEntry structures. - Open Lorebook SE (
openLorebookSE): SE played when opening the lorebook (file fromaudio/se). - Lore Audio Play Delay (
loreAudioPlayDelay): delay (seconds) before playing entry audio. Default0.5. - Show Locked Entries (
showLockedEntries): show locked entries in the list. Defaulttrue. - Sort By Unlock Order (
isSortByUnlockOrder): keep entries sorted by the order they were unlocked. Defaulttrue. - Input Mode Type (
inputModeType):0= Show Entries On Hover1= Activate Each Entry
- Description Text Format Settings (
descriptionTextFormatSettings): rich text styling settings.fontFace(string, empty = default)fontSize(number)textColor(HEX)outlineColor(HEX)lineHeight(-1 = default)padding(-1 = default)
- Add Lorebook To Main Menu (
isAddLorebookMenuOption): adds a menu command. Defaulttrue. - Lorebook Menu Option Title (
lorebookMenuOptionTitle): title for the menu command. DefaultLorebook.
-
Plugin based on NUI system, which allows for easy customization of the lorebook menu.
-
You can customize the appearance of the lorebook menu by modifying the
.jsonfiles in thedata\PKD_SimpleLorebookfolder. -
All the images used in the lorebook menu are stored in the
img\PKD_SimpleLorebookfolder. You can replace these images with your own to change the look of the lorebook.
-
The plugin comes with two ready-made configurations for different resolutions. For default one (816x624) and any bigger and special for 720p only.
-
Check folders
data\PKD_SimpleLorebook\For720pOnlyanddata\PKD_SimpleLorebook\ForDeafult816x624andAnyfor the configurations. -
To use a configuration, simply copy the contents of the desired configuration folder into your project's
data\PKD_SimpleLorebookfolder, replacing any existing files.