MV Help with the HUD Maker Engine

I'm currently working with RPG Maker MV and with the HUD maker engine. I'm working on a battle system with 4 of the
party members on each 4 of the corners of the battle screen.

1711983689909.png

NOTE: Don't mid the horrific ball enemies, they are just for testing purposes

But the problem is i want you to be able to know which player/party member is currently inputting a choice, and since i don't know javascript at all. I wonder if there can be a condition where if the party member is currently inputting AND int the party too, then i can show a border indicating who's turn it is.

The condition i wrote for this:

$gameParty.members()[in this case 2].isInputting()

But the problem with this, is that when party member 2 or any other member is NOT in the party it comes up with an error message saying this:

1711984107818.png


Iv'e looked everywhere for a way to fix this but i couldn't so for the first time in my life, mainly because i'm new, iv'e finally decided to ask the RPG Maker forums for plugin/javascript advice. All i want is an explanation on what i did wrong or simply just a script saying that if aa party member is inputting and in the party, if that would work.
Maybe this will work out for you
JavaScript:
$gameParty.members()[2] && $gameParty.members()[2].isInputting()


The only way you'd get $gameParty.members()[2] to not be in the party is if you only have one or two party members-nyan.

If you have chunks where that's the case, @TobyYasha has you covered all comfy-like! 👋

(I'm gonna hide from the scary faces now...)
to make sure the actor/gameParty member is in battle, use this scriptcall
$gameActors.actor(ID).isBattleMember()

this makes sure it exist before execute the battle.
The Scriptcalls i used for the SRD HudMaker
Spoiler: Script info for SRD HUDs
Actor current HP:
Code:
$gameActors.actor(1).hp

Actor Max HP:
Code:
$gameActors.actor(1).mhp

Actor current MP:
Code:
$gameActors.actor(1).mp

Actor Max MP:
Code:
$gameActors.actor(1).mmp

Actor current TP:
Code:
$gameActors.actor (1).tp

Actor current LV:
Code:
$gameActors.actor(1).level

Actor Name:
Code:
$gameActors.actor(1).name()

Actor Total current EXP:
Code:
$gameActors.actor(1).currentExp()

Actor current LV EXP:
Code:
Math.abs($gameActors.actor(1).expForLevel($gameActors.actor(1).level) - $gameActors.actor(1).currentExp())

Actor Max EXP of current LV:
Code:
Math.abs($gameActors.actor(1).nextRequiredExp()) + Math.abs($gameActors.actor(1).expForLevel($gameActors.actor(1).level) - $gameActors.actor(1).currentExp())

Actor EXP to Next LV (=> Actor Max EXP of current LV - Actor current LV EXP):
Code:
Math.abs($gameActors.actor(1).nextRequiredExp()) + Math.abs($gameActors.actor(1).expForLevel($gameActors.actor(1).level) - $gameActors.actor(1).currentExp()) - Math.abs($gameActors.actor(1).expForLevel($gameActors.actor(1).level) - $gameActors.actor(1).currentExp())

Needed in Text HUD in order to use script code where X is:
Code:
${X}

Script code to put in "Condition" :
For switches:

Code:
 $gameSwitches.value(x) == true
For variables:
Code:
 $gameVariables.value(x) == n


Script code for Variable (this one is Variable "50" )
Code:
$gameVariables.value(50)

you saied you got not much JS knowledge, so i copied all the scripts that i used in the past into the spoiler above^^
sidenote:
i didnt used gameparty members, most of them are made for the game actor with ID1, but by changing the number "1" you can also adress these to any other game actor by their actor id


(i stored these aswell in my signature spoiler^^)

Original thread: https://forums.rpgmakerweb.com/threads/help-with-the-hud-maker-engine.167378/