MZ Display battle log messages in solid windows.

layoutexample01.png


Above is an example I threw together in Paint. You know how during battle, when you use a Skill it'll display with a dim background behind it? Well... I want that dim background to be replaced by a solid window. Or to be more specific, I want any Battle Log messages that I choose to display (controlled by the VisuStella Battle Core plugin, which your plugin would need to be compatible with) to show up in solid windows like the example above, rather than the dim background that usually shows up.

I guess the only special function I might need is to make sure that skill names display in their own individual box, separate from other battle log messages, like the image above. That's about it.

One last thing: Since I plan to release my game as with "pay what you want with the option of free" model, I suppose that counts as a commercial project, so you have to be okay with me using it in a commercial project. Hope that's not a problem!

I'd really appreciate the help! I feel like I've ALMOST got things looking the way that I want them to, and this would be a big step forward!
Hi there!
Try adding this as a plugin:

JavaScript:
/*:
@target MZ
@plugindesc
@author
@url

@help

*/

{

const Alias = {}

Alias.Window_BattleLog_initialize = Window_BattleLog.prototype.initialize
Window_BattleLog.prototype.initialize = function(rect) {
    Alias.Window_BattleLog_initialize.call(this, rect)
    this.opacity = 255
}

}
Hi there!
Try adding this as a plugin:

JavaScript:
/*:
@target MZ
@plugindesc
@author
@url

@help

*/

{

const Alias = {}

Alias.Window_BattleLog_initialize = Window_BattleLog.prototype.initialize
Window_BattleLog.prototype.initialize = function(rect) {
    Alias.Window_BattleLog_initialize.call(this, rect)
    this.opacity = 255
}

}

battlelogfail.png


That just causes this to happen. It's there all the time.
I don't know for sure, but I guess that the default code just put its opacity at 0 to "hide it".
Meaning that is always being shown, but it clears the text between logs.

I believe the thing to do now is to properly open/close the window when it has a log to show.
Not with time for this right now, maybe next week I can take a look if you found anything to help.

But I believe maybe someone from the Japanese community already did this.
I don't know for sure, but I guess that the default code just put its opacity at 0 to "hide it".
Meaning that is always being shown, but it clears the text between logs.

I believe the thing to do now is to properly open/close the window when it has a log to show.
Not with time for this right now, maybe next week I can take a look if you found anything to help.

But I believe maybe someone from the Japanese community already did this.

I see. Let me know if you get around to it! 🙂

And if you find someone that already made it, please let me know!
You can try something this:
JavaScript:
Window_BattleLog.prototype.drawBackground = function() {
    if (this.numLines() > 0) {
        this.opacity = 255;
        const padding = this.padding + this.itemPadding();
        const ww = this.maxLineWidth() + padding * 2;
        const wx = (Graphics.boxWidth - ww) / 2;
        this.move(wx, this.y, ww, this.fittingHeight(this.numLines()));
    } else {
        this.opacity = 0;
    }
};

Window_BattleLog.prototype.maxLineWidth = function() {
    let width = 0;
    for (const line of this._lines) {
        width = Math.max(width, this.textSizeEx(line).width);
    }
    return width;
};

I made it so that the box changes width based on the width of the text that's inside, but I don't know for sure if I like that or not. If you're not a fan of that, then I can either make it so that you can specify the window size yourself, or I can make it so the window takes up the full width of the screen, and the text is just centered.

This won't put the skill name in a separate window though. This is just for giving your battle log a solid window.
You can try something this:
JavaScript:
Window_BattleLog.prototype.drawBackground = function() {
    if (this.numLines() > 0) {
        this.opacity = 255;
        const padding = this.padding + this.itemPadding();
        const ww = this.maxLineWidth() + padding * 2;
        const wx = (Graphics.boxWidth - ww) / 2;
        this.move(wx, this.y, ww, this.fittingHeight(this.numLines()));
    } else {
        this.opacity = 0;
    }
};

Window_BattleLog.prototype.maxLineWidth = function() {
    let width = 0;
    for (const line of this._lines) {
        width = Math.max(width, this.textSizeEx(line).width);
    }
    return width;
};

I made it so that the box changes width based on the width of the text that's inside, but I don't know for sure if I like that or not. If you're not a fan of that, then I can either make it so that you can specify the window size yourself, or I can make it so the window takes up the full width of the screen, and the text is just centered.

This won't put the skill name in a separate window though. This is just for giving your battle log a solid window.

Thank you! 😀 That seems to work pretty well, though... do you think this looks okay without it being split into two boxes?

It looks fine when there's no extra message, like so...

meteormessage.png


But when there IS an extra message (which this particular skill needs for how it works):

talkmessage.png


...It looks kind of awkward, no? Or do you think it works like that? I mean, it looks fine, but it's kind of weird when everything else is displayed in a tiny box but that one skill (and other skills that it calls - it's basically a skill that random rolls for a bunch of other skills, so like each "conversation topic" is it's own skill with it's own effect) is an extra large box. Or... do you think it's fine?
Thank you! 😀 That seems to work pretty well, though... do you think this looks okay without it being split into two boxes?

It looks fine when there's no extra message, like so...

View attachment 236540

But when there IS an extra message (which this particular skill needs for how it works):

View attachment 236541

...It looks kind of awkward, no? Or do you think it works like that? I mean, it looks fine, but it's kind of weird when everything else is displayed in a tiny box but that one skill (and other skills that it calls - it's basically a skill that random rolls for a bunch of other skills, so like each "conversation topic" is it's own skill with it's own effect) is an extra large box. Or... do you think it's fine?
I'm about as artistic as a sack of potatoes, so you should probably take my design advice with a grain of salt, but personally, I think it would probably look weirder if it were split into two boxes. In any case, sorry to be blunt, but splitting it into two boxes seems like it could be a pain in the butt, especially while maintaining compatibility with Battle Core, so I don't really want to go that far.
I'm about as artistic as a sack of potatoes, so you should probably take my design advice with a grain of salt, but personally, I think it would probably look weirder if it were split into two boxes. In any case, sorry to be blunt, but splitting it into two boxes seems like it could be a pain in the butt, especially while maintaining compatibility with Battle Core, so I don't really want to go that far.

I gotcha. So you think it looks better this way anyway, right?

You were saying before about letting me specify the window size rather than it just being the size of the text, right? Could you add that functionality? That way I can have the window size be consistent since, as I said, some skills will display additional text below the skill name.
Here, go ahead and use this instead. I've turned it into a proper plugin with options that you can set.

If you set Auto Window Width to "true" and Minimum Window Width to "0", then it will behave the way that it currently is. If you set a value for Minimum Window Width, then the window will not shrink any smaller than whatever value you set. You can use JavaScript in that parameter, or you can just type a number.

You can use both Auto Window Width and a Minimum Window Width together. When you do that, it will make the window grow if necessary, but it won't ever shrink below the minimum.

Make sure to remove the old version of the plugin before you use this one.
Here, go ahead and use this instead. I've turned it into a proper plugin with options that you can set.

If you set Auto Window Width to "true" and Minimum Window Width to "0", then it will behave the way that it currently is. If you set a value for Minimum Window Width, then the window will not shrink any smaller than whatever value you set. You can use JavaScript in that parameter, or you can just type a number.

You can use both Auto Window Width and a Minimum Window Width together. When you do that, it will make the window grow if necessary, but it won't ever shrink below the minimum.

Make sure to remove the old version of the plugin before you use this one.

Seems to work perfectly! Thank you so much! 😀
Here, go ahead and use this instead. I've turned it into a proper plugin with options that you can set.

If you set Auto Window Width to "true" and Minimum Window Width to "0", then it will behave the way that it currently is. If you set a value for Minimum Window Width, then the window will not shrink any smaller than whatever value you set. You can use JavaScript in that parameter, or you can just type a number.

You can use both Auto Window Width and a Minimum Window Width together. When you do that, it will make the window grow if necessary, but it won't ever shrink below the minimum.

Make sure to remove the old version of the plugin before you use this one.
Hello there! Ive bin looking all around for a plugin like this and ive found one but that one dosnt seem to be available anymore, Now i see this one is for MZ but is it possible to have it for MV?
Hello there! Ive bin looking all around for a plugin like this and ive found one but that one dosnt seem to be available anymore, Now i see this one is for MZ but is it possible to have it for MV?
Luckily, I actually did port this one to MV once upon a time. You can grab it here.
Luckily, I actually did port this one to MV once upon a time. You can grab it here.
Thank you so much!!! God bless you omg
Art_SolidBattleLog seems to always be creating a new empty row as the last when using MPP_SmoothBattleLog (MZ) :0
Can it be fixed?

As you can see, there are 4 rows, one empty. I have placed Art_SolidBattleLog before MPP_SmoothBattleLog in the plugin list (I also have tried the other way around) and I have no empty messages in the Terms database.

(I don't know if this could be considered a necropost, but there is no release thread of this plugin.)
1000224238.png


Update: I patched it!

const wh = this.fittingHeight(this.numLines());
To this:
const wh = this.fittingHeight(this.numLines()-1);
Here, go ahead and use this instead. I've turned it into a proper plugin with options that you can set.

If you set Auto Window Width to "true" and Minimum Window Width to "0", then it will behave the way that it currently is. If you set a value for Minimum Window Width, then the window will not shrink any smaller than whatever value you set. You can use JavaScript in that parameter, or you can just type a number.

You can use both Auto Window Width and a Minimum Window Width together. When you do that, it will make the window grow if necessary, but it won't ever shrink below the minimum.

Make sure to remove the old version of the plugin before you use this one.
I just want to thank you for this plugin, seriously

Original thread: https://forums.rpgmakerweb.com/threads/display-battle-log-messages-in-solid-windows.150046/