MV Battle log check script call / [.isOpenAndActive()] alternatives for the battle log window? [Solved]

I'm using SRD Hud Maker for adding menu backgrounds for the various windows in the battle screen.

Giving you an idea of what I wanted to:

The image is a simple transparent margin, simple check for the window with SceneManager._scene.[Add a window here].isOpenAndActive() and the image appears if ‘true’ and doesn't if ‘false’, pretty simple, looks like this. (this image is just an example).

Wish.png


My problem arises with the battle log, sadly this script call doesn't work, what I mean specifically is that the code never interprets any moment as ‘true’, therefore the image not showing up, the specific script call that I used here was "BattleManager._logWindow.isOpenAndActive()".

How.png


I really don't know much javascript except for the little bits and pieces that I picket up while developing this game, so at this point i didn't know what to do.

I also tried "SceneManager._scene._logWindow.isOpenAndActive()" which also didn't work (I think "logwindow" isn't even a function of "scenemanager").

I figured that I wouldn't be able to meathead my head through this problem, but I also couldn't find any info that helps in my google searches, so now I'm hoping someone would give me a nudge in the right direction.
by "it doesn't work" do you mean that the image you want tied to the battle log either appears constantly or doesn't appear at all?

A suggestion would be to try using "isBusy" instead of "isOpenAndActive", maybe that would work for you.
You may also get more and better help if you take a moment to format your posts. Seeing one block of text with no sentences will cause some people to not bother trying to read it.
You may also get more and better help if you take a moment to format your posts. Seeing one block of text with no sentences will cause some people to not bother trying to read it.
Oh absolutely lol, that first post was a mess, I edited it to be a little more clear in what I wanted to do, thanks
by "it doesn't work" do you mean that the image you want tied to the battle log either appears constantly or doesn't appear at all?

A suggestion would be to try using "isBusy" instead of "isOpenAndActive", maybe that would work for you.
Thank you, sadly it doesn't work "fully", what I mean is that the image flickers really awkwardly, but I think this is probably a good nudge in the right direction.

2024-10-0511-26-21-ezgif.com-resize.gif


Others things I have tried since the first post:

BattleManager._logWindow.createContents()

I thought that maybe the flickering originated from the moments of the battle log updating o creating itself, so maybe by combining (using ||) "isBusy()" with other function could make it work, sadly, with "createContents()" the flickering problem didn't stop.
BattleManager._logWindow.update

Completely different problem, as the battle log updates itself every frame the image now never disappeared lol.

start / startPartyCommandSelection / startActorCommandSelection

Searching around, I found someone in these forums that mentions a way to make the battle log closer to a normal window by adding "._logWindow.hide()" to: Scene_Battle.prototype.start / Scene_Battle.prototype.startPartyCommandSelection /
Scene_Battle.prototype.startActorCommandSelection.

I was not planning on touching rpg_scenes.js, but I thought that maybe with those same functions I could somewhat control the battlelog window, sadly, even with the modification (already changed back rpg_scenes.js to its default state) I cannot use these calls, with the original Scene_Battle calls only giving me an error (undefined function) and using BattleManager giving the same problem of never giving a ‘true’ state (able to use both calls because both are _logWindow calls).

Question

Now what I think could work would be ."isAnyInputWindowActive()" by "emulating" the moments where the battle log is active, AKA, not the command selections, that is if it works the way I think it works, sadly I couldn't find any info about this function, so if someone would help me to explain where and how to call it, it would help a ton, thanks
I think if you want something, you need to if dmg is dealing/dealt,
to open, else close.

as the battle log has a window, you could also manipulate it into a plugin
rather than using SRD_HUDMaker for it so it function better.

but that is more personal reference, as its ideal to make huds, it also
depends, what exactly you want to show in the battle log.

just default message or different one?
and how are those set?
For the Mods, please mark the thread as closed, thanks!
as the battle log has a window, you could also manipulate it into a plugin
rather than using SRD_HUDMaker for it so it function better.

but that is more personal reference, as its ideal to make huds, it also
depends, what exactly you want to show in the battle log.
Thank you! In the end, I had to lmao.

Doing this type of editing with just script calls and SRD Hud Maker ended up being extremely unreliable, from crashes to problems that others users also found and couldn't figure out, really, I basically just gave up trying to wrestle with the battle log.

For the people that are trying to do something similar to me and to those that don't really understand much about coding and Javascript, here goes a quick rundown of what I did, maybe i'll be useful to someone,
(I still heavily recommend that anyone research on their own (even more as something that I mention later on is not really reliable in most cases).

1) Turning the battle log into a pseudo-window:
This is done with some opacity, width/height and positioning editing in rpg_windows and a little rpg_scenes editing, SRD STE allows for opacity and width/height editing but for the rest creating a plugin is probably for the best.

In my case, I made 2 plugins, one for each JS edits I needed.

For the rpg_scenes plugin, just add some functions that hides and shows the log in certain scenarios (shoutout to this person) (we'll come back to this again later).

For positioning, SRD STE is extremely unreliable, so creating a plugin is also recommended, everything else window related you can edit it there o you can just straight up edit with your new plugin, researching a little bit about windows would be helpful but for what I'm trying to do here:

Window_BattleLog.prototype.initialize = function() {
Window_Selectable.prototype.initialize.call(this, [X], [Y], width, height);
};

As a bonus, I recommend looking into the Graphical Design Mode plugin by Triacontane, better for window position editing than SRD STE.

2) Windows skin editing:
I already had a custom windows skin, but as they were 2 different styles for inside and outside of battle, I needed a change to adapt the now window-style battle log, there are multiple ways to aboard this problem, the Graphical Design Mode plugin that I mentioned earlier allows for custom skins for each window, there's also multiple plugins that allow multiple styles of skin windows, I recommend looking into the options and see which fit your project style.


3) The problems (the hacky part lol, read with caution and a sea level metric ton of salt):
The post that I linked for the rpg_scenes plugin part mentions that the battle log appears at the start with the "enemy emerges" message, this occurs even if you disable it (with yep battlecore in my case) flashing right at the start for 1-2 frames, something similar occurs with the results/victory aftermath screen, so, for my game, the way I decided to handle this was by masking the windows.

The message windows (the one with the enemy emerges text) with the same size and position covers the battle log, presenting both as if they were just a singular window.

Although untested (for now), this same principle should be able to be used for other scenarios like the victory aftermath or defeat. (in my case, I used the Yep victory aftermath plugin + its DisableVictoryAftermath command)

As for why this happens, I barely understand the mechanism of the Scene_Battle and the log, but I believe it's the moment of the battle log handling the turn 0, as it's necessary for the flow and logic of the battle, it cannot be skipped.

I believe it's possible to handle all this with more dignity, but I would need more knowledge of javascript and the code of the engine, and that's something that I do not have at the moment.

Or maybe it's something simple that I just couldn't figure out.

If you happen to know to figure something about this, try making your own thread, as it would be interesting to see and understand, thanks.

Original thread: https://forums.rpgmakerweb.com/threads/battle-log-check-script-call-isopenandactive-alternatives-for-the-battle-log-window-solved.172379/