MV SRD's Battle GUI Core: Getting current actor window help

Hey all,

As the title says, I'm using SRD's Battle GUI Core and I've been trying to get the actor command window to appear above the an actor's status window when it's their turn to input their command.

I'm needing to reference the actor window. I've tried BattleManager._actorWindow, BattleManager._actorWindow.x, BattleManager._actorWindow.width, BattleManager._actorWindow.actor(), and all other variations, including those for the y value. I've also looked into the code to extract from there, but so far I haven't been successful.

I realize that it has to be the current active actor's input turn, and it has to be over their particular window, but getting that info has eluded me.

Any help would be wonderfully appreciated! Thanks!
Can you describe what you mean by "an actor's status window"? Perhaps take a screenshot and indicate what you mean?

That's not something that exists in the default battle UI (and a cursory glance at the SRD plugin didn't show it as something added).
Can you describe what you mean by "an actor's status window"? Perhaps take a screenshot and indicate what you mean?

That's not something that exists in the default battle UI (and a cursory glance at the SRD plugin didn't show it as something added).
Understood! I updated my previous post to link to his website where the script is found, as well.

But here's the screenshot. Currently, I've just been testing things out, so I have the y value of the command window set to a number (it's height is also too much, but I can figure how to adjust that myself I'm sure).

SRD's plugin enables actor's to have their own battle status windows, essentially, except they're called "actorWindow" from what I can tell. The plugin supports checking properties, etc. for a bunch of things.

So I'd like to be able to have, when it's their turn, the actor command window to sit just above the actor's window, which also doubles as a secondary indicator of who's turn it is.

EDIT: Also, my apologies, but I use his Battle Status Customizer as well. I don't think it matters for this, since it's the GUI Core that dictates the window locations, but still! Just in case it helps.
That's all really weird. The BattleManager doesn't have anything to do with your user interface. It manages...the battle. The actions, etc.

Anything visual in RPG Maker is always a part of a scene. I don't really see the point of SRD creating shortcuts to the windows inside of the BattleManager.

Anyway.

I still don't see any new "actorWindow" added by this plugin. There's a reference to one, but it's just renamed from the actorListWindow...for some reason...so that's the window that lists all the actor's names.

Is that window you're talking about where you select what the actor is going to do on their turn? If so, that's still the regular actorCommandWindow, it's just using icons instead of the words.
That's all really weird. The BattleManager doesn't have anything to do with your user interface. It manages...the battle. The actions, etc.

Anything visual in RPG Maker is always a part of a scene. I don't really see the point of SRD creating shortcuts to the windows inside of the BattleManager.

Anyway.

I still don't see any new "actorWindow" added by this plugin. There's a reference to one, but it's just renamed from the actorListWindow...for some reason...so that's the window that lists all the actor's names.

Is that window you're talking about where you select what the actor is going to do on their turn? If so, that's still the regular actorCommandWindow, it's just using icons instead of the words.
Hmmm ok. In the customizable parameters, adjusting the Actor Window settings affects their windows. At least the placement. But maybe it's the status window, though from my assumption, the status window was the container for the actor windows. I was trying Battle Manager stuff out based on other things I came across, so if that's ineffective, at least now I know haha.

I'll look into it more later when I can and post my findings here.
But maybe it's the status window
That's...not what I said.

I was trying Battle Manager stuff out based on other things I came across, so if that's ineffective, at least now I know
Again, that's not what I said. SRD created references to all of this stuff within the BattleManager, per the documentation - I just have no idea why. It's a very weird plugin.
That's...not what I said.


Again, that's not what I said. SRD created references to all of this stuff within the BattleManager, per the documentation - I just have no idea why. It's a very weird plugin.
He seems to have had an interesting way to write his plugins from other things I've read, haha.

To be honest, I'm not sure what the _actorWindow is within his plugin. My assumption was it was the individual actor status windows. But now I'm wondering if it's not and it's perhaps a like an actor list window, which I don't see anyway, which is fine.

From doing more digging and testing, it looks to be the _statusWindow, which does make sense. I think I got confused with a few things. Getting the current inputting actor's status window is the what I'm trying to get.

BattleManager.battleScene._statusWindow.index() does SOMETHING at least. Since it returns 0, 1, and 2 for me (3 party members), it shuffles the actor command window over by a pixel for its relative actor. I'm needing help on figuring out how to get the location of the actor's status window now.
I don't understand what's going on in this thread, to be honest 😛

Did you miss the entire second half of my post #4?

I still don't see any new "actorWindow" added by this plugin. There's a reference to one, but it's just renamed from the actorListWindow...for some reason...so that's the window that lists all the actor's names.

Is that window you're talking about where you select what the actor is going to do on their turn? If so, that's still the regular actorCommandWindow, it's just using icons instead of the words.

You keep talking about some actor status window and I've told you there's no such thing. There's only The Status Window which contains all of the displayed information for all the party members.

1717516354166.png


Anyway, perhaps someone else will understand better what you're trying to do. Good luck.
Sheesh. Yeah, I'm reading too fast and have been trying get my thoughts out and incidentally overlooking your questions. My apologies.

I still don't see any new "actorWindow" added by this plugin. There's a reference to one, but it's just renamed from the actorListWindow...for some reason...so that's the window that lists all the actor's names.

Ok that makes sense. If that's all it is, just a list with the actors names, then that's not what I should be referencing. The connection I made from _actorWindow to the individual status windows came from SRD's Battle Status Customizer because there are parameters I can adjust called Actor Window that affect the positioning of the individual status windows.

Clipboard_06-04-2024_01.jpg
But by looking at it, it can't be _actorWindow but _statusWindow. At least from what I can tell.

Is that window you're talking about where you select what the actor is going to do on their turn? If so, that's still the regular actorCommandWindow, it's just using icons instead of the words.

Yes, the window I'd like to move is the actorCommandWindow. I'm using icons instead of text for the command choices. I'd like it to move the actorCommandWindow above the current actor who's turn it is to input their command. In my screen shot, each actor has their own little 'status card' on the bottom there.

Since SRD cut up the usual battle status window into individual ones, per actor, from what I can see in the script, I'm not sure how to reference it properly.

Sorry about being all over the place. In my self-inflicted hurry I read and responded too quickly without ingesting your replies!

Hopefully this response makes more sense. If there's more information needed that I missed, let me know!
Since SRD cut up the usual battle status window into individual ones, per actor
But that's not done in this plugin.

The Battle Status Customizer does that, and stores the individual windows in an array, SceneManager._scene._statusWindows. So the first party member would be SceneManager._scene._statusWindows[0], etc.
Ok, cool.

If I'm looking in the direction you're pointing in, it's not BattleManager that I need but SceneManager.

So then, SceneManager._scene._statusWindows[0].x aligns it perfectly with the first actor's status window, as it should, since his index is 0. So that's great.

All I need then is to replace 0 with whatever specifies the index current inputting actor's status window.

I've tried a few things instead of 0 that I can gleam from the script as trial and error, though so far they all end up unable to read property x of undefined or don't work in other ways.

Getting so close!
The index of the window is the same as the actor's index in the party.

Code:
SceneManager._scene._statusWindows[BattleManager.actor().index()]
should give you the status window of the current actor.
Nice! Ok, cool!

I might have attempted something similar earlier, but it errored out on me. That's why I'm here on the forums; to get assistance with things I can't figure out, haha.

So I tried that out; just as SceneManager._scene._statusWindows[BattleManager.actor().index()] and also as SceneManager._scene._statusWindows[BattleManager.actor().index()].x . It does give me the error "TypeError: Cannot read property 'index' of null", however. So then that means that 'index' isn't returning anything, from my understanding. Like there's nothing about index there at all? I've attached the screen shots here.

It's highlighting this._goalX = eval(_.actorCommandX); as where the discrepency is, which I don't fully understand, since goalX should equal the x value of the status window for the current actor, according to SceneManager._scene._statusWindows[BattleManager.actor().index()].x. So that's got me scratching my head now.

Still trying things out in the mean time.

Sorry for double posting.

For anyone who wants to reply, I've tried a large variation of things since yesterday, but clearly I'm missing the logic.

With that, using SceneManager._scene._statusWindows[], perhaps I need to get the index of the window of the current actor, since filling the brackets with either 0, 1, or 2 all place the actor command window above their respective status window (I've doing a 3-person party). I need to get the index number for either the actor whose turn it is, or the index of their status window?

I've tried SceneManager._scene._statusWindows[this._index].x which is relative to the commands within the command window, it seems. The command window starts over the first actor's status window. If I move the cursor to the second command, the command window actually pops over to the second status window in the party. So SOMETHING works, which is great.

With that, I tried SceneManager._scene._statusWindows[this._statusWindow._index].x, but it can't read property x of undefined. So that's not the right bit of script to use. I know there's an order to these things, but I haven't found it.

Any and all help is still very appreciated.
Sorry for double posting.
That's what the Edit button is for.

"TypeError: Cannot read property 'index' of null", however. So then that means that 'index' isn't returning anything, from my understanding.
No. It's saying there's no actor, because you're saying actor().index() - the index of the actor, and it's coming back as index of null.

Like there's nothing about index there at all?
...yes? There is? It's the last thing inside the brackets.

Any and all help is still very appreciated.
The window is obviously getting created when there is no inputting actor (like at the beginning of the battle scene), so trying to reference the current actor will error out.

But you can supply a default value if there's no inputting actor, for example:
Code:
BattleManager.actor() ? SceneManager._scene._statusWindows[BattleManager.actor().index()].x : 0
That's what the Edit button is for.


No. It's saying there's no actor, because you're saying actor().index() - the index of the actor, and it's coming back as index of null.


...yes? There is? It's the last thing inside the brackets.


The window is obviously getting created when there is no inputting actor (like at the beginning of the battle scene), so trying to reference the current actor will error out.

But you can supply a default value if there's no inputting actor, for example:
Code:
BattleManager.actor() ? SceneManager._scene._statusWindows[BattleManager.actor().index()].x : 0

Heck yeah. That did it.

Good grief, there was more involved to this than I had anticipated. Googling was only a little helpful, perhaps largely because I wasn't sure what exactly to look up besides "rmmv get index of current battler actor", and then just digging around and trying things out to the best of my comprehension.

Makes sense that the index wouldn't be populated immediately when it's first created. Man, all those logic steps into making a thing function is wild.

Thanks for the help @ATT_Turan ! Talking me though those points helps me understand the way it works better as well, which is always valued.

Original thread: https://forums.rpgmakerweb.com/threads/srds-battle-gui-core-getting-current-actor-window-help.169230/