HUD Maker turn icon

Hi guys

I've been using SRD's HUD Maker for MZ and its been great. There's just one drawback in that it's hard to tell whose turn it is.

I was hoping to set up either perhaps a little arrow pointing to the character portrait of whose turn it is, or maybe a text box showing their names. But I can't find a way to make it detect which actor's turn it is. I've done some digging around and found this:

But it doesn't seem to do anything, and I wonder if I have it set up wrong. I've currently got four switches set up, Actor 1, Actor 2, Actor 3, Actor 4, with id numbers 95, 96, 97, 98.
It's in a blank group object on the battle hud, not parented to anything or have any children. I've attached the code as it currently is.

Then to test it out, I've got a square set up on the battle hud that should only appear when Actor 1 switch is on. The square isn't parented or has any children either. Nothing happens, the square doesn't show up at all.

What am i missing here? I know I've almost certainly not done something, but I'm not sure what it is. I've been trying to interpret the instructions, but I'm quite new to javascript. The original thread is over a year old now, so I can't really ask there.
As was pointed out in that thread, the elaborate code with setting switches serves no real purpose.

There's some better code earlier in that thread, and there are probably half a dozen threads with this question that should come right up - exactly how you want to do it depends on how you're trying to display your information.

The condition in post 2 of that thread is looking at the party index, where the actor is in the party formation.

It's more common to have a condition tied to the actor ID,
Code:
BattleManager.actor() && BattleManager.actor().actorId() == 4
is true if actor ID 4 is the inputting actor.
As was pointed out in that thread, the elaborate code with setting switches serves no real purpose.

There's some better code earlier in that thread, and there are probably half a dozen threads with this question that should come right up - exactly how you want to do it depends on how you're trying to display your information.

The condition in post 2 of that thread is looking at the party index, where the actor is in the party formation.

It's more common to have a condition tied to the actor ID,
Code:
BattleManager.actor() && BattleManager.actor().actorId() == 4
is true if actor ID 4 is the inputting actor.
Oh yeah, I saw that one and gave that a go. It didn't do anything, but the guy said he made it for MV so I figured that was the reason. I'm away from my PC at the moment, but would you just paste that directly into the display conditions as is, or do you need to make any additions?
Just to be clear, when you say Actor ID 4, do you mean number 4 in the database or whoever is currently in the fourth slot in the party?
actorID refer to the Actors database

$gameParty.members()[4] refer to the 5th member in the party (if available).
so there is a difference 🙂
would you just paste that directly into the display conditions as is, or do you need to make any additions?
I don't know, I don't own HUD Maker for MZ - you would have to refer to the documentation. I seem to recall seeing someplace that you have to put the code in some kind of braces with a symbol or something, but the plugin should tell you how to use it.

Just to be clear, when you say Actor ID 4, do you mean number 4 in the database or whoever is currently in the fourth slot in the party?
The ID for anything is its number as shown in the database. That's why, in my previous post, I said the actor ID was different from its position in the party formation.

The condition in post 2 of that thread is looking at the party index, where the actor is in the party formation.

It's more common to have a condition tied to the actor ID

From the MZ instructions:

1727964474948.png


$gameParty.members[4] refer to the 5th member in the party
You're missing parentheses there.
Code:
$gameParty.members()[4]

Edit:
Apparently HUD Maker MZ wants a return statement in the code condition.

So if you wanted a HUD element to appear when actor ID 3 is taking their turn, you'd put
Code:
return BattleManager.actor() && BattleManager.actor().actorId() == 3
You're missing parentheses there.
I notice, corrected it, but had to go, so my mistake there though.
thanks for the correction anyway, I should double check to make sure its correct 🙂

Original thread: https://forums.rpgmakerweb.com/threads/hud-maker-turn-icon.172312/