MV How to find which actor's turn it currently is

However, those brackets quite literally do nothing at all. 5 and (5) are 100% equivalent in every way.

Now, I'm not sure whether I'm missing something here, or everyone else is missing something here. Why are all the code samples comparing the actor ID to a constant? Doesn't it make more sense to do something else with the actor ID? Or even don't bother with the actor ID and just get the actor and grab some data from it?

JavaScript:
let whichPictureId = 1; // Change this value if needed.
if(BattleManager.actor() && BattleManager.actor().isInputting()) {
  let actorData = BattleManager.actor().actor(); // Yes, you need actor() twice.
  let facePic = actorData.meta.battleFacePic;
  let origin = 0, x = 0, y = 0, scaleX = 1, scaleY = 1, opacity = 255, blendMode = 0; // Change these values
  $gameScreen.showPicture(whichPictureId, facePic, origin, x, y, scaleX, scaleY, opacity, blendMode);
} else {
  $gameScreen.erasePicture(whichPictureId);
}

Then you can place a <battleFacePic:SomePictureName> note tag in the actor's note box and it should theoretically all work. The only complication would be where that code is placed. I think it might have to be in a parallel common event? Those do run in battle, right? Maybe it also works in a troop event bound to a switch that is always on. Presumably, it would also work if you aliased BattleManager.update in a plugin and put the code there.

Not sure if i did this incorrectly, but i attached screenshots below.
I added the note tag to the actor, and tried it with a common event, i also removed the other party members to see if the test image would show up, and unfortunately it didn't show up on screen, but the battle paused for a slight moment before the battle commands appeared, like something else was running in during it.

1750099245955.png
1750099456432.png


I didn't see the picture with the common event, so i don't think they run during battle, tried an new common event that just messages text on screen linked to the switch i used above before the battle started- and the message didn't appear until post battle.

Tried to use the troop event as well, but wasn't able to get it to work.
1750099920513.png
Parallel common events don't run in battle (without that japanese plugins). You can't to my knowledge do this with troop events either. OP said they were using Hudmaker. Of course if you make a completely new plugin/function to run the code, that's an option too.
Yes, so when it's blank or has true it works perfectly, at the moment i have the element set to text that just says test.
I just set up a project with only hudmaker and supertools and it works just fine with the following condition
Code:
BattleManager.actor() && BattleManager.actor().isInputting() && BattleManager.actor().actorId() === 2
where it only shows up if the actor with Id #2 is inputting

are you using any battle system plugins? Cause if you are, it might be changing how battler actionStates works. I know isInputting() basically doesnt function in Yanfly's STB system because of what it does. although, i thought the box only turns green if the condition is recognized to be true...
I just set up a project with only hudmaker and supertools and it works just fine with the following condition
Code:
BattleManager.actor() && BattleManager.actor().isInputting() && BattleManager.actor().actorId() === 2
where it only shows up if the actor with Id #2 is inputting

are you using any battle system plugins? Cause if you are, it might be changing how battler actionStates works. I know isInputting() basically doesnt function in Yanfly's STB system because of what it does. although, i thought the box only turns green if the condition is recognized to be true...
Yeah 100% mb for not dropping my battle plugins at the start, i'm using Yanfly's Battle Core, and Yanfly's CTB system, Along with 1 element from Olivia's Octobattle pack.

When i try this condition, it works as valid condition, but it returns true for me no matter who is currently inputting.
JavaScript:
if (BattleManager.actor?.().isInputting() && BattleManager.actor().actorId() === x)
The null-chain is only needed for the first one, because if that returns false, it stops checking.

Edit: Disregard, this will work in MZ but not MV. I would still switch the order of the conditions, though.
chaining DOES work in MV as I use it too, but the NWJS must be higher than default.
I use 0.48.4 (base of what MZ comes with) and allows it.

so his is probably 0.29 that doesn't allows it.
Yanfly's CTB
then we can simplify the condition as the battle manager's actor should always be the one whose turn it currently is. try this:
Code:
BattleManager.actor() && BattleManager.actor().actorId() === 2

When i try this condition, it works as valid condition, but it returns true for me no matter who is currently inputting.
im not entirely sure how that works out. Mostly cause if it is true, then the element would be shown, no? I think its returning false because CTB might be doing the same thing STB does that invalidates isInputting(), but itll remain a guess as long as theres no need to find out.
then we can simplify the condition as the battle manager's actor should always be the one whose turn it currently is. try this:
Code:
BattleManager.actor() && BattleManager.actor().actorId() === 2


im not entirely sure how that works out. Mostly cause if it is true, then the element would be shown, no? I think its returning false because CTB might be doing the same thing STB does that invalidates isInputting(), but itll remain a guess as long as theres no need to find out.
NICE! Works perfectly, thank you and thanks everyone that replied in this thread, this was bothering me for a couple days now.

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/how-to-find-which-actors-turn-it-currently-is.178353/