Random Dialogue Plugin

Random Dialogue v1.03a
Author: Michael Morris @Blue Booth Studios
Engine: RPGMaker MV
Language: JavaScript
Links: RPGMakerWeb Plugin Release Post
MV Plugins Entry

Introduction
Sometimes you just need NPCs to say random stuff. Not completely random, per say, but for example, let’s say you have an NPC who shares rumors with the player. As long as said rumor is unlocked, you don’t care which rumor the NPC cares to share. Likewise, you may have a series of lines kids can say “you look funny!”, “Mister, where do babies come from?” or something else inane. You might even have the kids say smart things. But again, you simply care that one intelligent option is chosen, not which specific line activates. While you can do all of this manually using conditional branches… you can also use this script and not have that nasty conditional mess to check every time something goes wonky. This script takes care of all the issues above for you, so you can spend less time checking random kid 36b says the right thing. In fact, this can even be used to improve world immersion, as your NPCs will now say different, but appropriate things!

Features
  • Select a dialogue line at random from a series of dialogue lines. This has many uses, but for example, allows you to easily replicate Fi’s “rumors” system from Skyward Sword.
  • Dialogue lines can be limited based on real-time conditions – for example, “I know where the cave is” will only show if a game switch is active, which indicates the player has heard about the cave.
  • Dialogue lines separated into categories and topics. This means you can have rumors, game tips, and a whole bunch of other stuff in rumors.json, and select “rumors” to only choose from rumor dialogue lines.
  • Random dialogue lines use the message box without additional modification, so any changes to the message box you make before calling the Plugin Command (position, windowskin, etc.) will carry over to affect the appearance of the dialogue lines.
  • Dialogue lines can be restricted by a further condition – “available” is intended to track when a line is unlocked (for example, if the player kills a bandit, dialogue about that bandit being dangerous won’t show). “restriction” is intended to further restrict dialogue lines to be appropriate to a speaker. For example, you can use a game variable with a manually tracked index (ie. Widow = 1, Guard = 2, Veteran = 3), so that an NPC will not say a random line that would be out of character.
  • Faceset support!
  • NPCs will not resume movement while a random dialogue line is displayed.

Screenshots
No screenshots provided – this script doesn’t produce visible effects by itself.

How to Use
  1. Download or copy script into your game js/plugins directory.
  2. Download Rumors.json into your game data directory.
  3. Import script into your project.
  4. Call script plugin commands within your own events or plugins.

Requirements
  1. Use with Yanfly’s Message Core plugin to resolve word wrapping!

Files
Script: BBS_RandomDialogue.js
JSON Data: Rumors.json

Credit and Thanks
  • Micheal Morris @Blue Booth Studios
  • Micheal Morris @Blue Booth Studios
  • Credit to Tsukihime for continuing to be so helpful!
  • Special Thanks to Anthony Xue for bug fixes and documentation help.
  • Iavra for the JSON handling code, based on that from achievements.js.

Known Bugs
  • None known.

Terms of Use
Commercial:
Contact us

Free:
Free for non-commercial usage of script as long as credit is given.

Please contact us for details.

Leave a comment