Checking Party Stats

Hello! I'd like the commands for finding the names of the actors in party position 2, 3, 4, and 5, as well as the HP and MP of actors in those positions as well.

It must look like this: ${$gameActors.actor(3).name()} (Wrong function, but you get the idea)

Not like this: \p[2] (Does what I want, but not in the correct format for Hud Maker)
You can get an array of Actor objects from the party using this function.

Then you can select whichever actor you want (which is in order of their party position) and get their name with this function.

It would be best to experiment with this first in the Javascript Console so you can visually see what's going on vs. trying to guess&check in your HUD.
Try

${$gameParty.members()[1].name} for the actor in position 2.
${$gameParty.members()[2].name}

does this
oYozJMD.png

@Shaz
It's a function/method --> You call functions with parentheses, like this:
Code:
myObject.myFunction()
As opposed to a property, which is accessed without parentheses.
Code:
myObject.myProperty
${$gameParty.members()[2].name()}
That worked for names @Shaz, thanks a bunch!

How do you coorelate those to HP and MP? 🙂

I tried this:

${$gameParty.members()[4].hp()}

And it yelled at me
If you get error messages, please tell us what they are. Otherwise we're only guessing.

try hp instead of hp()
CVAx6Xm.png

It just says "error", it doesn't explain the error
hp, mp, tp, atk, def, etc. are all "getters", so they are accessed without parentheses similar to properties (as Shaz said).

As I said earlier, it would probably help you to experiment in the Javascript console (press F8 during playtest to open it) rather than guess&check in your HUD, you can get immediate feedback on whether something works or not and it will tell you more useful error messages.
V6kLwli.png


This error message came from this gauge:


${$gameParty.members()[0].hp}

${$gameParty.members()[0].mhp}

Doing ${$gameParty.members()[0].hp()} and ${$gameParty.members()[0].mhp()} does not change the error message, either.
Get rid of the ${...} part, thus:

$gameParty.members()[0].hp
@Aesica

That worked perfectly! Thank you so much, guys.

Original thread: https://forums.rpgmakerweb.com/threads/checking-party-stats.102571/