bluebooth

Veteran
Veteran
Joined
Nov 12, 2015
Messages
95
Reaction score
122
First Language
English
Primarily Uses
N/A
Random Dialogue v1.03a
Author: Michael Morris @Blue Booth Studios
Demo thanks to Anthony Xue: http://ancient-architects.com/files/Conversation Demo.zip

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.
  • Random will now avoid consecutive repetition of a given dialogue line, provided more than one random dialogue line is available to choose from.
  • Faceset support!
  • NPCs will not resume movement while a random dialogue line is displayed.
  • Plugin now displays user-friendly error messages for an incorrect number of parameters, misspelling of command, etc.
  • Plugin now supports case insensitive checks (requires rumors.json having all Category and Topic values in lower-case).

Screenshots
None.


How to Use
  • Copy script into your game js/plugins directory.
  • Create a Rumors.json file in your game data directory.
  • Import this script into your project and set all two parameters.
  • Use the Plugin Command to get a random dialogue line output into message box.

Demo
Thanks to Anthony Xue, a demo is available here:
http://ancient-architects.com/files/Conversation Demo.zip

Create a new project, and then extract this archive into that new project.


Script
Code:
//=============================================================================
// Bluebooth Plugins - Random Conversations
// BBS_RandomConversations.js
//=============================================================================

//=============================================================================
 /*:
 * @title Random Conversations Plugin
 * @author Michael Morris (https://www.*******.com/bluebooth)
 * @date Feb 19, 2016
 * @filename BBS_RandomConversations.js
 * If you enjoy/benefit from my work, please support me on *******!
 *
 * https://www.*******.com/bluebooth
 *
 * @plugindesc v1.03a Add random dialogue for a specific topic to your game.
 * This allows you to pick a random (unlocked) rumor to share, pick a hint at random, given
 * general dialogue on a specific point, etc.  There's a lot of exciting things you can
 * do with this!  Original design was merged with elements of Iavra's Achievements
 * file parsing and then new enhancements / reworkings were added on top of that.
 * Special Thanks to Tsukihime for all the help.
 * Special Thanks to Anthony Xue for bug fixes and documentation help.
 * Special Thanks to Iavra, the file parse handling is modified from his own (awesome) Achievements plugin.
 *  You should pick it up, it's really well done.
 *
 * ============================================================================
 * Terms of Use
 * ============================================================================
 *   - Free for use in non-commercial projects with credits
 *   - Contact me for commercial use
 *
 * ============================================================================
 * Parameters
 * ============================================================================
 * @param Configuration File
 * @desc Name of an external configuration file to load at game start. Default: data/Rumors.json
 * @default data/Rumors.json
 *
 * @param Case Insensitive
 * @desc Enable to use case insensitive string comparisons.  You will need to manually
 * convert Rumors.json Categories and Topics values to lower case.
 * @default false
 *
 * @param Debug Mode
 * @desc Enable to activate console variable logging.  Use for debugging odd behaviour.
 * true to enable console variable logging.
 * @default false
 *
 * @help
 * ============================================================================
 * Description
 * ============================================================================
 * Add random dialogue for a specific topic to your game.  This allows you to pick a random (unlocked) rumor to share,
 * pick a hint at random, given general dialogue on a specific point, etc.  There's a lot of exciting things you can
 * do with this!  Original design was merged with elements of Iavra's Achievements file parsing and then new
 * enhancements / reworkings were added on top of that.
 *
 * To add random dialogue to your game, create a txt file in your data directory called rumors.json.  This is
 * a very flexible system that can be used from anything to random dialogue to selecting one random rumor from a series of many,
 * to doing the same for hints, and so on.  To support having multiple topics (each with an item that can be selected at random),
 * these dialogue items are split into both Topics (ie. "The Temple Puzzle") and "Categories" (ie. "Puzzles").  Each dialogue
 * entry consists of multiple properties:
 *
 * id           A unique numeric id, that may not contain commas or whitespaces.
 * topic        Topic name.
 * category        Category name.
 * dialogue        Dialogue box contents associated with this topic.  To add \c[], \v[], \i... or other message shortcuts, you must use two slashes \\ in JSON.  See examples below.
 * available    Eval condition as string.  If true, this dialogue item is available.
 * restriction  Eval condition as string.  If false, this dialogue item is available.  Used to restrict random conversation items
 *                for specific NPCs (ie. "adventurer only", "widow only", etc.)
 *
 * This is a sample file, containing one of each achievement types:
 *
 * [
 *    {
 *         "id":0,
 *         "topic":"SantaCompana",
 *            "category":"Toledo",
 *         "dialogue":"They say the \\c[3]Santa Compana\\c[0] has been spotted near the \\c[3]Old Monastery\\c[0].  I hope it doesn't get any closer to town.",
 *         "available":"$gameSwitches.value(297) === false",
 *         "restriction":"false"
 *    },
 *    {
 *         "id":1,
 *         "topic":"SantaCompana",
 *             "category":"Toledo",
 *         "dialogue":"I haven't heard any news about \\c[3]Santa Compana\\c[0] sightings.  Maybe the reaper has moved on?",
 *         "available":"$gameSwitches.value(297) === true",
 *         "restriction":"false"
 *    },
 *    {
 *         "id":2,
 *         "topic":"Culebre",
 *             "category":"Toledo",
 *         "dialogue":"I don't know how my family is going to stay fed with that damned \\c[3]Culebre\\c[0] at large.",
 *         "available":"$gameSwitches.value(126) === false",
 *         "restriction":"$gameVariables.value(77) === 2"
 *    }
 * ]
 *
 * ============================================================================
 * Plugin Commands
 * ============================================================================
 * Use the following plugin commands to manipulate custom controls.
 *
 * Plugin Commands:
 *
 *     RandomConversation getRandomMsg category topic faceset faceNum        # Get a random dialogue entry with corresponding category, and topic.  Optional faceset and faceNum may be specified.
 *
 * ============================================================================
 * Change Log
 * ============================================================================
 * 1.03a - Fixed short-list bug.
 * 1.03  - Category and Topic search now has added case insensitivity mode for more user-friendly usage.
 * 1.02a - Fixed some typos and bugs courtesy of Steffen (Anthony Xue).  Thanks man!  User friendly check added for # args.
 * 1.02  - Added in lastconv check to avoid repeating random dialogue when other entries can be played instead.
 * 1.01a - Common mispelling now detected to be more dev friendly.
 *         - Finally found out and documented how to add \... codes as in native Messagebox.
 * 1.01  - Faceset and faceNum are now optional parameters.
 * 1.00a - Fixed references to bad element in help.
 * 1.00  - Plugin finished.
 *
 */
//=============================================================================

//=============================================================================
var Imported = Imported || {} ;
var BBS = BBS || {};
Imported.RandomConversations = 1;
BBS.RandomConversations = BBS.RandomConversations || {};

(function() {

    // Stores all rumors.
    var _rumors;
    var curCategory;
    var curTopic;
    var lastConv;
 
    //=============================================================================
    // Parameter Variables
    //=============================================================================
    var parameters = PluginManager.parameters('BBS_RandomConversations');
    var pConfiguration      = String(parameters['Configuration File'] || 'data/Rumors.json');
    var pLowerCaseChecks  = eval(String(parameters['Case Insensitive'] || 'false'));
    var pDebugging          = eval(String(parameters['Debug Mode'] || 'false'));
 
    //=============================================================================
    // Rumor Class
    //=============================================================================
    function Rumor() {
        this.initialize.apply(this, arguments);
    };
 
    Rumor.prototype.initialize = function(data) {
        this._id = Number(data.id);
        this._topic = String(data.topic);
        this._category = String(data.category);
        this._dialogue = String(data.dialogue);
        this._availableStr = String(data.available);
        this._restrictionStr = String(data.restriction);
    };
 
    Rumor.prototype._isUnlocked = function() {
        return eval(this._availableStr);
    };
 
    Rumor.prototype._isRestricted = function() {
        return eval(this._restrictionStr);
    };
 
    Rumor.prototype.isAvailable = function() {
        return (this._isUnlocked() && !this._isRestricted());
    };
 
    Rumor.prototype = Object.create(Rumor.prototype);
    Rumor.prototype.constructor = Rumor;
 
    /**
     * Creates rumors from the given data and loads their current state, afterwards.
     */
    var _create = function(data) {
        var temp = [];
        for(var i = 0, max = data.length; i < max; ++i) {
            entry = data[i];
            temp.push(new Rumor(entry));
        }
  
        _rumors = temp;
        curCategory = '';
        curTopic = '';
        lastConv = -1;
  
        if (pDebugging) {
            console.log(_rumors);
        }
    };
 
    //=============================================================================
    // Game_Interpreter
    //=============================================================================
    var BBS_RC_Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
    Game_Interpreter.prototype.pluginCommand = function(command, args) {
        // User friendly correction
        if (command === 'RandomConversation') {
            console.log("BBS_RandomConversations plugin command not called correctly.  Did you mean RandomConversations?");
        }
  
        if (command === 'RandomConversations')
        {
            switch (args[0]) {
                case 'getRandomMsg':
                    SceneManager._scene.getRandomDialogue(args);
                    break;
            };
        }
        else {
            BBS_RC_Game_Interpreter_pluginCommand.call(this, command, args);
        }
    };
 
    //=============================================================================
    // Game_Temp
    //=============================================================================
 
    /* Tsukihime - Generates a random number from the given interval.
     You can customize the algorithm used to generate a
     random number if needed */
    Game_Temp.prototype._generateRandomValue = function(min, max) {
        if (min === max) {
          return min;
        }
        else {
          // Maybe you can customize this
          return Math.floor(Math.random() * (max - min + 1)) + min
        }
    };
 
    //=============================================================================
    // Scene_Map
    //=============================================================================
    Scene_Map.prototype._createShortlist = function(category, topic) {
        var temp = [];
        this.shortlist = [];
        lastConv = -1;
  
        for (var i = 0; i < _rumors.length; i++)
        {
            if (_rumors[i]._category === category && _rumors[i]._topic === topic)
            {
                if (_rumors[i].isAvailable()) {
                    temp.push(_rumors[i]);
                }
            }
        }
  
        if (temp.length > 1) {
            // Remove last conversation entry, only if there are sufficient entries to remove it.
            for (var j = 0; j < temp.length; j++) {
                if (temp[j]._id != lastConv) {
                    this.shortlist.push(temp[j]);
                }
            }
        }
        else {
            this.shortlist = temp;
        }
  
        // For debugging sake.
        if (this.shortlist.length <= 0) {
            console.log("ERROR: No random conversations options for Category: '" + category + "' ; Topic: '" + topic + "'");
        }

        curCategory = category;
        curTopic = topic;
    };
 
    Scene_Map.prototype.getRandomDialogue = function(args) {
        if (args.length < 2) {
            console.log("ERROR: Too few parameters passed into getRandomMsg(...).  Minimum args: 2.");
        }
  
        var category = String(args[1]);
        var topic = String(args[2]);
  
        // User sanity; remove need for matching capitalization.
        if (pLowerCaseChecks === true) {
            category = category.toLowerCase();
            topic = topic.toLowerCase();
        }
  
        this._createShortlist(category, topic);
        if (this.shortlist.length <= 0) return;
  
        var randomIndex = $gameTemp._generateRandomValue(0, (this.shortlist.length - 1));
  
        $gameMap._interpreter.setWaitMode('message');
  
        if (args.length > 3) {
            var faceFile = String(args[3]);
      
            var faceNum = 0;
            if (args.length > 4) {
                faceNum = Number(args[4]);
            }
      
            $gameMessage.setFaceImage(faceFile, faceNum);
        }
  
        $gameMessage.addText(this.shortlist[randomIndex]._dialogue);
        lastConv = this.shortlist[randomIndex]._id;
    };
 
    //=============================================================================
    // class Scene_Boot
    //=============================================================================
    var BBS_RC_Scene_Boot_create = Scene_Boot.prototype.create;
    Scene_Boot.prototype.create = function() {
        BBS_RC_Scene_Boot_create.call(this);
        this._loadFile(pConfiguration, _create);
    };
 
    Scene_Boot.prototype._loadFile = function(url, callback) {
        var request = new XMLHttpRequest();
        request.open('GET', url);
        request.overrideMimeType('application/json');
        request.onload = function() { callback(JSON.parse(request.responseText)); }
        request.onerror = function() { throw new Error('There was an error loading the file ' + url); }
        request.send();
    };
 
    var BBS_RC_Scene_Boot_isReady = Scene_Boot.prototype.isReady;
    Scene_Boot.prototype.isReady = function() {
        return !!_rumors && BBS_RC_Scene_Boot_isReady.call(this);
    };
  
})(BBS.RandomConversations);
//=============================================================================
// End of File
//=============================================================================

Known Bugs / TODO
Make your suggestions or report bugs here!

Requirements
  1. Yanfly's Message Core plugin - YEP_MessageCore.js. Set the "Word Wrap" plugin parameter to true.

History
v1.03a
- Fixed bug with availability and restriction conditions due to shortlist caching.
v1.03
- Category and Topic search now has added case insensitivity mode for more user-friendly usage.
v1.02a
- Fixed typos and bugs courtesy of Steffen (Anthony Xue). Thanks man! User friendly check added for # args.
v1.02

- Added in lastconv check to avoid repeating random dialogue when other entries can be played instead.
v1.01a
- Finally found out and documented how to add \... codes as in native Messagebox.
- Common misspelling now detected to be more developer friendly.
v1.01
- Faceset and faceNum are now optional parameters.
- Squashed some bugs.
- Fixed the last few documentation errors.
v1.00a
- Fixed documentation errors.
v1.00
- Plugin released.

Suggestions, bug reports, and feature requests are welcomed!


Compatibility Issues
None known. Compatible with Klaus Map Overlays, Terrax Lighting System, and most (if not all) of Yanfly's plugins.

FAQ
Q: The demo won't open, how to open it?
A: Download Winrar and try again.


Credit and Thanks
  • 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.

Author's Notes
Free for non-commercial usage as long as credit is given, contact me for commercial use.
 

Attachments

  • RandomConversations.zip
    5.2 KB · Views: 171
Last edited:

Neo Soul Gamer

Veteran
Veteran
Joined
Aug 10, 2012
Messages
676
Reaction score
441
First Language
English
Primarily Uses
N/A
This is one heck of a plugin. I'm blown away by the flexibility. Thanks a lot for this. I'll definitely be using it.
 

bluebooth

Veteran
Veteran
Joined
Nov 12, 2015
Messages
95
Reaction score
122
First Language
English
Primarily Uses
N/A
This is one heck of a plugin. I'm blown away by the flexibility. Thanks a lot for this. I'll definitely be using it.



Thank you, I'm glad you like it!  I'll be doing some tests as to how it performs with a large Rumors.json file, will make performance tweaks as necessary.  I can't wait to see what you can do with it! :)
 

Wilkituska

Advanced Chicken
Member
Joined
Aug 6, 2014
Messages
18
Reaction score
5
First Language
Spanish
Primarily Uses
This is exactly what I wanted to do for my game, but could'nt figure out exactly how to. Glad you did it, although I think I'm missing something... So, "topic" and "category" are just simple ways to locate appropriate lines to write (for example, "Topic: Greetings" and "Category: Informal"). I get that. But, what is "title"? It is used in the help section of your plugin, but there's no explanation for that function. Or is it?
 

bluebooth

Veteran
Veteran
Joined
Nov 12, 2015
Messages
95
Reaction score
122
First Language
English
Primarily Uses
N/A
This is exactly what I wanted to do for my game, but could'nt figure out exactly how to. Glad you did it, although I think I'm missing something... So, "topic" and "category" are just simple ways to locate appropriate lines to write (for example, "Topic: Greetings" and "Category: Informal"). I get that. But, what is "title"? It is used in the help section of your plugin, but there's no explanation for that function. Or is it?



Thanks Wilkituska!  You're exactly right on the purpose of topic and category.  Title is actually a remnant of a previous design, it shouldn't be there.  I'll correct the plugin help section. :)
 

Wilkituska

Advanced Chicken
Member
Joined
Aug 6, 2014
Messages
18
Reaction score
5
First Language
Spanish
Primarily Uses
Thanks Wilkituska!  You're exactly right on the purpose of topic and category.  Title is actually a remnant of a previous design, it shouldn't be there.  I'll correct the plugin help section. :)

Thats what I thought. Thanks for your answer!
 
Joined
Aug 28, 2014
Messages
38
Reaction score
13
First Language
English
Primarily Uses
N/A
Could you explain how the plugin command works?


My event looked like this:


I copy and pasted the entire code and replaced category and topic with custom ones.


added an empty messagebox with a faceset


added a filled in messagebox with faceset
 

bluebooth

Veteran
Veteran
Joined
Nov 12, 2015
Messages
95
Reaction score
122
First Language
English
Primarily Uses
N/A
Could you explain how the plugin command works?


My event looked like this:


I copy and pasted the entire code and replaced category and topic with custom ones.


added an empty messagebox with a faceset


added a filled in messagebox with faceset



I'm glad you're interested in the plugin!


I'm sorry, but I don't understand what you mean by your event setup.


In your js/plugins directory you should have BBS_RandomConversations.js


In your data directory you should have rumors.json


Make sure to add BBS_RandomConversations to your list of active plugins in plugin manager.


For an event, I literally have only the plugin command call.  If you want to change the way the dialogue box appears, change dialogue settings before the plugin command and revert the changed settings afterwards.  For the plugin parameters relating to facesets:


You'll need to specify the faceset filename first (no extension), and then the index number match the index of the face on the faceset.  Goes from 0 - 7.
 
Joined
Aug 28, 2014
Messages
38
Reaction score
13
First Language
English
Primarily Uses
N/A
I'm glad you're interested in the plugin!


I'm sorry, but I don't understand what you mean by your event setup.


In your js/plugins directory you should have BBS_RandomConversations.js


In your data directory you should have rumors.json


Make sure to add BBS_RandomConversations to your list of active plugins in plugin manager.


For an event, I literally have only the plugin command call.  If you want to change the way the dialogue box appears, change dialogue settings before the plugin command and revert the changed settings afterwards.  For the plugin parameters relating to facesets:


You'll need to specify the faceset filename first (no extension), and then the index number match the index of the face on the faceset.  Goes from 0 - 7.



I did that just the plugin command call but the character did not say anything.

The first one shows the event contents.


 The second one shows what the plugin looks like from the link you provided at the bottom of the post. It's all blank. You may need to update the link.


Screenshot 1.png


Screenshot 2.png
 
Last edited by a moderator:

bluebooth

Veteran
Veteran
Joined
Nov 12, 2015
Messages
95
Reaction score
122
First Language
English
Primarily Uses
N/A
This is such a creative plugin, kudos!



Thank you, Sidbot, I'm really glad you like it!  It's come in so handy for my own project, I felt like it had to be shared.

I did that just the plugin command call but the character did not say anything.

The first one shows the event contents.


 The second one shows what the plugin looks like from the link you provided at the bottom of the post. It's all blank. You may need to update the link.


View attachment 33210


View attachment 33211



The plugin call is in there, I can english, haha.


Alright, here's an example of a full plugin call direct from my own game:


RandomConversations getRandomMsg Toledo Culebre Guards_2 7


Where:


Guards_2 is the full name of the faceset


7 is the index of the face within the faceset.
 
Last edited by a moderator:
Joined
Aug 28, 2014
Messages
38
Reaction score
13
First Language
English
Primarily Uses
N/A
@bluebooth Ahh ok. No prob. I was gonna reply earlier. I was distracted by a new tv show.  Luckily the forums saved it.


There's also an issue with the plugin. It must've have happened when I changing which .json file for the plugin to use for random dialogue.  Could I use any name for the json file as long as it follows the set-up in the help file?



Screenshot link


This only happens when the plugin is active. Turned off all plugins and I still got the error. In a new project it is fine. 


Ok I see. So getRandomDialogue can be replaced with getRandgomMsg? Is there a list of possible alt commands to be placed in the plugin command box? 
 

bluebooth

Veteran
Veteran
Joined
Nov 12, 2015
Messages
95
Reaction score
122
First Language
English
Primarily Uses
N/A
@bluebooth Ahh ok. No prob. I was gonna reply earlier. I was distracted by a new tv show.  Luckily the forums saved it.


There's also an issue with the plugin. It must've have happened when I changing which .json file for the plugin to use for random dialogue.  Could I use any name for the json file as long as it follows the set-up in the help file?



Screenshot link


This only happens when the plugin is active. Turned off all plugins and I still got the error. In a new project it is fine. 


Ok I see. So getRandomDialogue can be replaced with getRandgomMsg? Is there a list of possible alt commands to be placed in the plugin command box? 



Wow.  I am sorry.  It's an artifact from when I was debating on a plugin command name.  It should be getRandomMsg.  That would be part of the problem.


I've made a plugin fix where the faceset and faceNum are now optional parameters.  I'll upload it shortly.


You should be able to use any json file in the data directory, provided it follows the set-up in the help file.  I've found I had issues when I used a long json filename, so I'd keep the name short?


Please try using the new version of the script 1.01, change the plugin command to "getRandomMsg," and try using a shorter json filename.  If that doesn't fix things, I'll help debug this with you in detail. //rmwforums.s3.amazonaws.com/emoticons/default_smile.gif
 
Last edited by a moderator:
Joined
Aug 28, 2014
Messages
38
Reaction score
13
First Language
English
Primarily Uses
N/A
For some reason the syntax error doesn't go away in my last project so im making a fresh new one.


This time it has a lot of the resources stripped out. The same thing occurs. Just the plugin and it uses the template Rumors with SantaCompana and Toledo as the plugin command thing.


Script testing game
 

bluebooth

Veteran
Veteran
Joined
Nov 12, 2015
Messages
95
Reaction score
122
First Language
English
Primarily Uses
N/A
For some reason the syntax error doesn't go away in my last project so im making a fresh new one.


This time it has a lot of the resources stripped out. The same thing occurs. Just the plugin and it uses the template Rumors with SantaCompana and Toledo as the plugin command thing.


Script testing game



Aight, I was able to replicate your issue.  Loading project up as is and attempting to talk to someone caused the syntax error to repeat.  As stated in my plugin description, RandomDialogue requires the use of YEP_MessageCore.  After including YEP_MessageCore, setting word wrap to true, and reorganizing the plugin list such that the order was:


YEP_MessageCore


BBS_RandomConversations


the provided project worked without any further changes. //rmwforums.s3.amazonaws.com/emoticons/default_smile.gif
 
Joined
Aug 28, 2014
Messages
38
Reaction score
13
First Language
English
Primarily Uses
N/A
@bluebooth Ok I'm going to add the YEP Message Core. Last time I did it, it still gave me the error too. I'll try and add the plugin in with the project unopened in MV and... it's still not working. 


The plugins are the same, I set word wrap to true. The girl still isnt saying anything about a Toledo.
 

bluebooth

Veteran
Veteran
Joined
Nov 12, 2015
Messages
95
Reaction score
122
First Language
English
Primarily Uses
N/A
@bluebooth Ok I'm going to add the YEP Message Core. Last time I did it, it still gave me the error too. I'll try and add the plugin in with the project unopened in MV and... it's still not working. 


The plugins are the same, I set word wrap to true. The girl still isnt saying anything about a Toledo.



Oh!  That's right, I made one other change.  In your plugin command call, you currently have SantaCompana as the Category and Toledo as the Topic.  The default Rumors.json has SantaCompana as the Topic, and Toledo as the Category (so flip the two plugin command call arguments).  After that, it should work.
 
Joined
Aug 28, 2014
Messages
38
Reaction score
13
First Language
English
Primarily Uses
N/A
Oh!  That's right, I made one other change.  In your plugin command call, you currently have SantaCompana as the Category and Toledo as the Topic.  The default Rumors.json has SantaCompana as the Topic, and Toledo as the Category (so flip the two plugin command call arguments).  After that, it should work.



*cries a river of happy tears* It works! Yess! Thank you! Ohh... I switched it up.


I'm glad I came to the forums. Last time I made a game for a school project and it too me the whole month to debug and figure out scripts on my own. That was on VX trial. 


Now I can insert a bunch of NPCs with random dialogue.


Another Q:


How does the labels work for restricting which character to say specific dialogue?


Specifically these labels


"available":"true"  


<< this will control when the dialogue appears, correct? 


"restriction":"false"


<<if set to true, what will happen? Also what other "thingies" can go here? Can you put variables or switches as seen the sample .json file/help? 
 

bluebooth

Veteran
Veteran
Joined
Nov 12, 2015
Messages
95
Reaction score
122
First Language
English
Primarily Uses
N/A
*cries a river of happy tears* It works! Yess! Thank you! Ohh... I switched it up.


I'm glad I came to the forums. Last time I made a game for a school project and it too me the whole month to debug and figure out scripts on my own. That was on VX trial. 


Now I can insert a bunch of NPCs with random dialogue.


Another Q:


How does the labels work for restricting which character to say specific dialogue?


Specifically these labels


"available":"true"  


<< this will control when the dialogue appears, correct? 


"restriction":"false"


<<if set to true, what will happen? Also what other "thingies" can go here? Can you put variables or switches as seen the sample .json file/help? 



Excellent!  I'm glad we got it working.  You're very welcome. //rmwforums.s3.amazonaws.com/emoticons/default_smile.gif


I know what you mean, it's been a pleasure being on these forums.  Yanfly, Tsukihime, Iavra and others are really making this an amazing community.  These scripts I'm putting together now are happening in a fraction of the time they used to using RMXP.


"Available" is used to determine and track when a given dialogue should be considered enabled under most normal usage.  For example, if you had a dialogue about the mine exploding, "Available" would be used to check that the mine had been exploded.


"Restriction" on the other hand, is used to track when a given dialogue should be considered disabled under any other usage.  For example, if you had a dialogue about the mine exploding, but the given character shouldn't say that dialogue, you would use "restriction" to make sure that dialogue is excluded.


You can definitely use variables or switches as seen in the sample .json file/help!  In fact, the two were set up specifically to take advantage of that.  This way, if you were trying to find a lost boy, the dialogue could update before and after said boy is found with no additional work on your part.  From a technical standpoint however, you should be able to put anything in "available" and "restriction" that JavaScript can evaluate to true or false.


To help simplify things; a given dialogue will be included if the Topic and Category match, "available" evaluates to true and "restriction" evaluates to false.
 
Last edited by a moderator:

Veralisa

Villager
Member
Joined
Feb 22, 2016
Messages
16
Reaction score
8
First Language
English
Primarily Uses
 This is pretty cool, can't wait to try it out!


Just wanted to drop a comment that I was banging my head against the wall for a while trying to get the plugin to work. I used the plugin command indicated in the help file (RandomConversation getRandomMsg category topic faceset faceNum) and couldn't get it running forever, but then I realized your example posted in this thread is "RandomConversations getRandomMsg category topic faceset faceNum". Added the 's' to the command and it works like a charm now! Don't know if it's a typo or what, but I thought I'd just point it out in case it helps someone.


Thanks for this great plugin!


Edit: Quick question/request, is it possible to break the text into different windows? Like if I want to control the 'page breaks' for my long gossips, if that makes sense! 
 
Last edited by a moderator:

Latest Threads

Latest Profile Posts

Heading to Orlando in six days! It'll be my first time going to Disney's Typhoon Lagoon. And then my dad will pick what we do for Father's Day!
With this, I'm gonna have a good night sleep
Damn. We’ve gotten so close to 0 reports, 0 approvals a few times over the past couple weeks. Does it matter? No. Is it realistic. No? Do I rely on your reports and want everyone to keep posting. Yes. Do I 100% games? …sigh… Yes.

Ah yes, all three of my moods all at once.

Forum statistics

Threads
131,757
Messages
1,223,028
Members
173,521
Latest member
MaverickZero
Top