MV Check which actor is currently selected\has a turn in battle?

Is it possible to check this via script call? How?
BattleManager.actor()
My bad, it's for MZ: I've tried this already but it doesn't seem to work
:
◆Control Variables:#0001 = BattleManager.actor()
◆Text:None, None, Window, Bottom
: :\V[1]

I'm getting zero in and outside battle
That's because you're setting a variable to an entire actor. Then you're trying to display an entire actor in a text window and that doesn't mean anything.

What about the actor are you trying to reference? Their ID? Name? Class?

This page shows you how to access any of that - look under Methods.

I'm getting zero in and outside battle
BattleManager methods don't exist outside of battle - this is specifically answering your question which actor has a turn in battle.
◆Control Variables:#0001 = BattleManager.actor().index(1)
◆Control Variables:#0002 = BattleManager.actor().name()
◆Control Variables:#0003 = BattleManager.actor().actorId()
◆Text:None, None, Window, Bottom
: :\V[1] \V[2] \V[3]

Getting zeroes
Can you please explain what you're trying to do. I might be missing something, but I can't think of a way for a common event to be running while an actor is taking their turn. If you have a common event attached to an item or skill, that runs after that item is resolved, so it's no longer an actor's turn. If you have it in a troop event, it's either at the beginning of a turn when no one is active, or triggered by things that would, again, be after your turn is done.

This script call is used by plugins that are running during battle, such as HUDMaker.

If you describe what you're trying to achieve, we might be able to help you.
I see. That was the issue. Then I'll have to use a parallel common event for that.
As mentioned, BattleManager.actor() is for the input phase.

For the turn phase (i.e. performing actions) try BattleManager._subject instead.
I'm using BARREY Common Events in Battle plugin and it works fine which mean there's gotta be smth wrong with these script calls:
All of them give me "0" no matter what

1636122534298.png
*BUMP

@KotoYama, please do not bump your topic unless it has been 24 hours later since your last post. You can review our forum rules here. Thank you.

There are many people here from different time zones offering answers in their free time.

BattleManager._subject is a value, not a function. Try these instead:
  • BattleManager._subject.index()
  • BattleManager._subject.name()
  • BattleManager._subject.isActor() ? BattleManager._subject.actorId() : 0
  • BattleManager._subject
Thx, I figured it out:

BattleManager.actor().actorId()
BattleManager.actor().name()

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/check-which-actor-is-currently-selected-has-a-turn-in-battle.141186/