Hello. This is my first post on here but I feel like it is necessary for me to write this as this has been an issue I've been trying to solve for the past few days, and, thankfully, succeeded at doing so. For anyone out there still looking for an answer to how to do this in Hud Maker Ultra (Pro), I present you my solution for it:
No matter what your intended use for this is, you need to set up some switches to use in RMMZ. Just pick 4 empty slots and name them accordingly, each one is for a single actor in battle.
Once that is done, open Hud Maker Ultra, select the battle HUD and add an invisible object. I went with a "group" since these don't display anything, and just cram it somewhere where it doesn't overlap with anything. Then within that object you only need to setup the following code:
JavaScript:
// Replace w, x, y, and z with your switch numbers, in order of actor.
// Check if BattleManager isn't empty
if (BattleManager.actor() !== null)
{
// Check 1st switch
if (BattleManager.actor().index() === 0)
{
$gameSwitches.setValue(w, true);
}
else
{
$gameSwitches.setValue(w, false);
}
// Check 2nd switch
if (BattleManager.actor().index() === 1)
{
$gameSwitches.setValue(x, true);
}
else
{
$gameSwitches.setValue(x, false);
}
// Check 3rd switch
if (BattleManager.actor().index() === 2)
{
$gameSwitches.setValue(y, true);
}
else
{
$gameSwitches.setValue(y, false);
}
// Check 4th switch
if (BattleManager.actor().index() === 3)
{
$gameSwitches.setValue(z, true);
}
else
{
$gameSwitches.setValue(z, false);
}
}
else
{
// This resets everything once the turn is over
$gameSwitches.setValue(w, false);
$gameSwitches.setValue(x, false);
$gameSwitches.setValue(y, false);
$gameSwitches.setValue(z, false);
}
Make sure to set it to On Update. Otherwise it will only do it once which, albeit kinda funny, is not what you want.
From here on, whatever effect you want to do can use the 4 switches you established in RMMZ. In my case I wanted the player portraits to raise and lower depending on the switch states. I basically set up 2 animations, one for going up and one for going down. I decided it's more fail proof to tell it directly to lower the portrait once the switch is off, so I used the custom condition of checking a switch which allows me to check if it's on or off.
And there we have it. I know the code is a bit amateurish with all the blatent if and else statements, but it works and that is what matters. This also does not take into account moves being performed, this only does things while you're selecting moves for the actors.
I hope this helps. c: