RMMV How do I change the opacity of the battle log window at the start of the battle?

sayne

Villager
Member
Joined
Aug 27, 2021
Messages
16
Reaction score
1
First Language
English
Primarily Uses
RMMV
So I wanted my battle log to look more like a window so I looked around and found a "half solution" I guess which basically makes the window appear once something is written in it by going into the rpg_windows.js file and changing the opacity to 255. What I want is the window to appear immediately. This is for 2 reasons, one would be that it just looks nicer because the window won't just show up out of nowhere and the second is that I have a plugin that modifies some of the skill messages and when those skill messages play out at the beginning of the fight, the window does not appear until one of the attacks that isn't modified is used. Once the window has appeared, the skills that are modified work fine. So is there any way that the opacity can be applied at the very beginning of a battle?

I'm also not exactly sure if I changed the right line to change the opacity but I think I did because it does make the window just not at the beginning.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
3,207
Reaction score
1,897
First Language
English
Primarily Uses
RMMV
I have a plugin that modifies some of the skill messages and when those skill messages play out at the beginning of the fight, the window does not appear until one of the attacks that isn't modified is used.
What plugin is that? Why don't we get that fixed?
 

sayne

Villager
Member
Joined
Aug 27, 2021
Messages
16
Reaction score
1
First Language
English
Primarily Uses
RMMV
What plugin is that? Why don't we get that fixed?
I got the plugin from this forum: https://forums.rpgmakerweb.com/index.php?threads/target-name-in-battle-log.138279/#post-1199938

This is the js I have in my version:
//=============================================================================
// CustomSkillMessages.js
//=============================================================================
/*:
* @target MV
* @plugindesc v0.1
* @Author Kenen @ RPGMakerWeb
* @Help CustomSkillMessages.js
*
* A simple plugin to allow for custom formatting of specific skill messages.
*/
(() => {
// Start plugin
var customText = false;
_alias_Window_BattleLog_displayAction = Window_BattleLog.prototype.displayAction
Window_BattleLog.prototype.displayAction = function(subject, item) {
// Carrying this over from the default function; not sure what it does!
var numMethods = this._methods.length;
// Check if the current action is a skill and if you've configured custom text for it...
if (DataManager.isSkill(item)) this.checkCustomText(subject, item);
if (customText) {
// I don't actually know what this does, but I'll include it to be safe
if (this._methods.length === numMethods) {
this.push('wait');
}
customText = false;
return;
}
// ...Otherwise, use the default editor text
_alias_Window_BattleLog_displayAction.call(this, subject, item)
};
Window_BattleLog.prototype.checkCustomText = function(subject, item) {
// The user's name
var subject = subject.name();
// The target's name
var target = BattleManager._targets[0].name();
// Begin skill config; do not edit above this line
// Start custom messages for skill id 1
if (item.id === 1) {
// This will print as "(User) attacks (target)!"
var message1 = subject + " attacks " + target + "!";
// This will print as "The Slime A is now solely focused on Harold!"
var message2 = false;
CustomText = true;
}
// End custom messages for skill id 1

if (item.id === 15) {
// This will print as "(User) attacks (target)"
var message1 = subject + " attacks " + target + "!";
// This will print as "The Slime A is now solely focused on Harold!"
var message2 = false;
customText = true;
}
// End custom messages for skill id 15

if (item.id === 16) {
// This will print as "(User) attacks (target)"
var message1 = subject + " attacks " + target + "!";
// This will print as "The Slime A is now solely focused on Harold!"
var message2 = false;
customText = true;
}
// End custom messages for skill id 16

if (item.id === 17) {
// This will print as "(User) attacks (target)"
var message1 = subject + " attacks " + target + "!";
// This will print as "The Slime A is now solely focused on Harold!"
var message2 = false;
customText = true;
}
// End custom messages for skill id 17

if (item.id === 21) {
// This will print as "(User) attacks (target)"
var message1 = subject + " attacks " + target + "!";
// This will print as "The Slime A is now solely focused on Harold!"
var message2 = false;
customText = true;
}
// End custom messages for skill id 21

if (item.id === 4) {
var message1 = subject + " caught " + target + " offgaurd!";
var message2 = false;
customText = true;
}
// End custom messages for skill id 4

if (item.id === 7) {
var message1 = subject + " hugs " + target + ".";
var message2 = false;
customText = true;
}
// End custom messages for skill id 7

if (item.id === 9) {
var message1 = subject + " motivates " + target + "!";
var message2 = false;
customText = true;
}
// End custom messages for skill id 9

if (item.id === 12) {
var message1 = subject + " punishes " + target + " for being too rough!";
var message2 = false;
customText = true;
}
// End custom messages for skill id 12

if (item.id === 23) {
var message1 = subject + " was stepped on by " + target + "!";
var message2 = false;
customText = true;
}
// End custom messages for skill id 23

if (item.id === 25) {
var message1 = target + " tries to grab " + subject + " too hard!";
var message2 = false;
customText = true;
}
// End custom messages for skill id 25


// Repeat here for skills as desired, e.g. if (item.id === 12)


// End skill config; do not edit below this line
if (message1) this.push('addText', message1);
if (message2) this.push('addText', message2);
}
// End plugin
})();
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
3,207
Reaction score
1,897
First Language
English
Primarily Uses
RMMV
Whenever you're posting code, you need to put it in code tags - the </> on the top right of the text box. In this case, it looks like it just made the code really hard to read without its indentations, but posting it outside of code tags can actually remove chunks of it because the forum will think they're BB codes.

As far as trying to read through the rest of it...no offense to Kenen, but this is a pretty hack-y solution to the situation :stickytongue:

Some things I see:

1) You have a typo in your block for skill 1, it sets CustomText instead of customText. It looks like that would cause it to display both your custom message as well as the default, though...I'm not sure why it would result in your messages getting delayed.

2) You should make everything after skill 1 be else if so the game doesn't waste its time checking each one when only one can ever happen.

3) Why do you have a bunch of duplicate blocks for different skills that have the same text? Just make the condition use or: if (item.id==1 || item.id==15 || item.id==16) etc.
(I would actually structure this as a switch statement, but that's changing more stuff...and then I'd actually actually pull it out of being hardcoded and into plugin parameters or notetags, but that's changing even more stuff).

But make at least the customText fix and see if that sorts you out.
 

sayne

Villager
Member
Joined
Aug 27, 2021
Messages
16
Reaction score
1
First Language
English
Primarily Uses
RMMV
1) You have a typo in your block for skill 1, it sets CustomText instead of customText. It looks like that would cause it to display both your custom message as well as the default, though...I'm not sure why it would result in your messages getting delayed.
Ok I'm currently dying laughing rn because I fixed the typo and then I realized one of my attacks that made the window appear didn't make it appear anymore and then I thought "what if the C is actually what makes it show up?" So I tried it... and for some reason all of my skills that use it work with the window now. I honestly have no clue how that worked but somehow an error fixed everything.
2) You should make everything after skill 1 be else if so the game doesn't waste its time checking each one when only one can ever happen.
I also added this. Definitely gonna be a big help in the future when I add more skills.
3) Why do you have a bunch of duplicate blocks for different skills that have the same text? Just make the condition use or: if (item.id==1 || item.id==15 || item.id==16) etc.
(I would actually structure this as a switch statement, but that's changing more stuff...and then I'd actually actually pull it out of being hardcoded and into plugin parameters or notetags, but that's changing even more stuff).
I don't know why I didn't think about that. I have multiple ones because I want different actors to perform different animations when they attack so I used one of yanfly's plugins that changed their attack to a different attack skill. But that one step cleaned up so much of the js.

Honestly could not ask for a better response. Thx so much!
 

Latest Threads

Latest Posts

Latest Profile Posts

yRMekcF.gif


Run, <null> run!
(sprite got butchered a bit while making gif file...)
WOOP WOOP!
NEW CHARACTER ALERT!!!
Please, welcome to the stage...
Ramona Albright.png

Ramona Albright! A 20-year old World Key Guardian in training (More about the WKG's soon!), She is very impulsive, which leads us to the problem of the game. OOF. Kinda wanna wait till you know how to use the friggin World Key, huh?!
Bust sketch here!
IMG_20220124_110105.jpg
Little-by-little, keep improving your projects. That's how you finish them! ;)
Now it's official: My first RPG Maker game released on Steam will be released this year! I am so glad for this achievement and I am so happy to see a lot of gamedevs like me here working on what we love!
Mais informações no Post.png
Check out my MZ thread for 2 new waterplant edits and my MZVind water autotiles now without ground/cliffs, so you can put them on your own ground-tiles. Have fun!

Forum statistics

Threads
118,668
Messages
1,117,721
Members
155,774
Latest member
Uperr
Top