Way to get party member class & insert into text display?

I have been experimenting with some things I found in the MZ Script Call List, but I can't seem to figure out how to get a specific party member's class and then display that class name in a text box.

So I want to be able to get the class name of any party member at a specific point in time and then display that class name in the game via the text command.

Is there a way to do this that I am just missing or not understanding?

Thanks!
$gameActors.actor(1).currentClass().name - get class name of actor 1

Control Variable event set to this script call and in text box use tag \v[1]
2022-04-16 23_50_27-Event Commands.png
Or, by position in the party (index 0 = leader):

$gameParty.members()[0].currentClass().name
I.e.
  • $gameParty.members()[0] - get the first member of the party (index 0);
  • .currentClass() - get the database record for their current class;
  • .name - get the name of that class.
For information on database structures, e.g. the name property of classes, you can check out the Database sheet of this reference:
This reference is more focused on information rather than examples/context.
Thank you both, @Soulrender and @caethyril!

I tried both of those in different ways, but I was missing the ".name" at the end. This is an example of what I found in the reference I was using for the Script Call:

$gameParty.members()[n].currentClass()

For some reason, it is missing the ".name" at the end. Or maybe I was supposed to know to add that and I didn't!

Thanks again!
@kvngreeley: yep, that gets all the data for the class, as defined on the Classes tab of the database. name is just one part of that data; id is another part; etc. I'll look into adding some more specific examples for things like that, thanks for the feedback! 👋
@kvngreeley: yep, that gets all the data for the class, as defined on the Classes tab of the database. name is just one part of that data; id is another part; etc. I'll look into adding some more specific examples for things like that, thanks for the feedback! 👋
Thank you for that added information! Every little hint helps new people like me.

That spreadsheet is rather daunting, but it is slowly making a bit more sense and is an awesome resource!

EDIT: I tried both options for the Actor and the Party Member and they both worked perfectly. Thanks again!
Great! Yes, that sheet is more technical. Happy scripting!

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/way-to-get-party-member-class-insert-into-text-display.146827/