Random Dialogue Plugin

Random Dialogue v1.03a
Author: Michael Morris @Blue Booth Studios
Engine: RPGMaker MV
Language: JavaScript
Links: RPGMakerWeb Plugin Release PostMV Plugins EntryIntroduction
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