One Line Battle Message Plugin

Lion Blade Soler

Autistic Artist
Veteran
Joined
Mar 15, 2012
Messages
85
Reaction score
76
First Language
Portuguese
Primarily Uses
RMMV
Remember the SimpleMsgSideView plugin that programmed the Battle Log Window for RPG Maker MV to display the battle log/message as a single line message but only for the side-view battle? The OneLineBattleMessage plugin is similar to that plugin, but unlike the other plugin, the OneLineBattleMessage will work with the front-view battle and the side-view battle. Here are the screenshots of the plugin in action during the front-view battle:

OneLineBattleMessageSample_01.png OneLineBattleMessageSample_02.png

Now, here are the screenshots of the plugin in action during the side-view battle:

OneLineBattleMessageSample_03.png OneLineBattleMessageSample_04.png

The plugin will also let you change the message speed (from 0 to 30) as well as change the window skin image (which should be in the same graphic format as the Window image file unless you choose to have no window displayed behind the text). For the load window skin function, I created that type of function that's exclusive to the plugin. I personally don't think that there's any risk of having a complete override to the loadWindowskin function for this plugin, but just to be on the safe as you never know if someone will create a plugin that may rely on the window properties from the Battle Log Window, I decided to create a function that's not a complete override to the loadWindowskin function as a precaution against any potential conflict with other plugins. Here's the screenshot of the plugin:

OneLineBattleMessagePuglin.png

The plugin is copyleft and open-source, so there's no need for you to give me credit for the plugin and you are free to modify the plugin if you wish to do so. Here's the code for the plugin:

JavaScript:
//=============================================================================
// OneLineBattleMessage.js
//=============================================================================

/*:
 * @target MZ
 * @plugindesc Displays battle log as a one-line battle message.
 * @author N/A (open-source, copyleft)
 *
 * @help OneLineBattleMessage.js
 *
 * This plugin displays the battle log as a one-line battle message at the
 * top window.  You can change the window for the battle message.
 *
 * This plugin does not provide plugin commands.
 *
 * @param windowName
 * @type string
 * @default Window
 * @text Window
 * @desc Filename of the window for the battle message
 *
 * @param messageSpeed
 * @type number
 * @min 0
 * @max 30
 * @default 16
 * @text Message Speed
 * @desc Message Speed value (0 - 30)
 */

(() => {
    //-----------------------------------------------------------------------------
    // PluginManager
    //
    
    const pluginName = "OneLineBattleMessage";
    const parameters = PluginManager.parameters(pluginName);
    const windowName = String(parameters['windowName'] || '');
    const messageSpeed = Number(parameters['messageSpeed'] || 16);
    
    //-----------------------------------------------------------------------------
    // Window_BattleLog
    //
    // The window for displaying battle progress. No frame is displayed, but it is
    // handled as a window for convenience.
    
    Window_BattleLog.prototype.initialize = function(rect) {
        Window_Base.prototype.initialize.call(this, rect);
        this.openness = 0;
        this.opacity = 255;
        this._lines = [];
        this._methods = [];
        this._waitCount = 0;
        this._waitMode = "";
        this._baseLineStack = [];
        this._spriteset = null;
        this.refresh();
    };
    
    Window_BattleLog.prototype.loadBattleLogWindowskin = function() {
        this.windowskin = ImageManager.loadSystem(windowName);
    };
    
    Window_BattleLog.prototype.messageSpeed = function() {
        return messageSpeed;
    };
    
    Window_BattleLog.prototype.clear = function() {
        this.openness = 0;
        this._lines = [];
        this._baseLineStack = [];
        this.refresh();
    };
    
    Window_BattleLog.prototype.addText = function(text) {
        if (text) {
            this.openness = 255;
            this._lines.push(text);
            this.refresh();
            this.wait();
        }
    };
    
    Window_BattleLog.prototype.refresh = function() {
        this.contents.clear();
        this.loadBattleLogWindowskin();
        for (let i = 0; i < this._lines.length; i++) {
            this.drawLineText(i);
        }
    };
    
    Window_BattleLog.prototype.drawLineText = function(index) {
        const rect = new Rectangle(0, 0, this.innerWidth, this.innerHeight);
        this.contents.clearRect(rect.x, rect.y, rect.width, rect.height);
        this.drawText(this._lines[index], rect.x, rect.y, rect.width, "center");
    };
    
    //-----------------------------------------------------------------------------
    // Scene_Battle
    //
    // The scene class of the battle screen.
    
    Scene_Battle.prototype.logWindowRect = function() {
        const wx = 0;
        const wy = 0;
        const ww = Graphics.boxWidth;
        const wh = this.calcWindowHeight(1, false);
        return new Rectangle(wx, wy, ww, wh);
    };
})();

In addition to the code, I'll be attaching the OneLineBattleMessage plugin to this post. If I notice that there's any mistake or error in the plugin that I may have overlooked, then I'll update the code and upload the plugin attachment with the fix(es).
 

Attachments

Marillmau5

Veteran
Veteran
Joined
May 8, 2014
Messages
90
Reaction score
9
First Language
English
A very underrated plugin! :2k31:
 
Last edited:

Lion Blade Soler

Autistic Artist
Veteran
Joined
Mar 15, 2012
Messages
85
Reaction score
76
First Language
Portuguese
Primarily Uses
RMMV
A very underrated plugin! :2k31:
Thank you :)! I'm actually planning to do an update for the plugin that will allow everyone to use a different font exclusively for the one line battle message window. Once it's done, I'll post the update as well as update the title of the post to indicate that the plugin has been updated.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Finished my Sprite for Koro :D
Evil7 added!


I did a bit of a remake on one of the maps, also I made a particle for jumping into the portal, and one for traveling through the portal. I'll probably add more sparkles later to embellish it. :LZSwink:
Polished the animation and added details :kaojoy:
Ami
What do you think about the Wood Bridge inside of Volcano?

Forum statistics

Threads
105,687
Messages
1,015,551
Members
137,363
Latest member
Slew
Top