MZ Script Call to Return VisuStella Traits Sets?

Hey folks!
How can I return a specific let's say 'Gender', 'Race' or 'Alignment' from VisuStella ElementStatus Core?

- My goal:

Code:
if (VisuStella_Gender = 'Male') {
Thanks, my lord!;
}

if (VisuStella_Gender = 'Female') {
Thanks, ma'am!;
}
else {
won't joke here! lol;
}


Thanks!
Easiest way to pull out the code would be to put a console.log() command where you are planning to do the comparison. The catch finding that place.

So the question is, what exactly are you looking to do this for?
You can return a specific trait like this:
JavaScript:
character.traitSet(key).Name
character would be the actor/enemy that you want to check, and key would be a string representing the trait that you want to check. So if you want to do something based on Actor 1's gender, you could do it like this:

JavaScript:
if ($gameActors.actor(1).traitSet("Gender").Name == "Female") {
    // Do female stuff
} else if ($gameActors.actor(1).traitSet("Gender").Name == "Male") {
    // Do male stuff
} else {
    // Do other stuff
}
(Note that you need two equal signs to do a Boolean comparison)

Here are all the possible keys:
Code:
"Element"
"SubElement"
"Gender"
"Race"
"Nature"
"Alignment"
"Blessing"
"Curse"
"Zodiac"
"Variant"
Easiest way to pull out the code would be to put a console.log() command where you are planning to do the comparison. The catch finding that place.

So the question is, what exactly are you looking to do this for?
I am trying to use those values inside of some formulas and stuff. I wish I wouldn't need to set variables for that, that's why I asked that question. Thanks though, the solution below has worked!

You can return a specific trait like this:
JavaScript:
character.traitSet(key).Name
character would be the actor/enemy that you want to check, and key would be a string representing the trait that you want to check. So if you want to do something based on Actor 1's gender, you could do it like this:

JavaScript:
if ($gameActors.actor(1).traitSet("Gender").Name == "Female") {
    // Do female stuff
} else if ($gameActors.actor(1).traitSet("Gender").Name == "Male") {
    // Do male stuff
} else {
    // Do other stuff
}
(Note that you need two equal signs to do a Boolean comparison)

Here are all the possible keys:
Code:
"Element"
"SubElement"
"Gender"
"Race"
"Nature"
"Alignment"
"Blessing"
"Curse"
"Zodiac"
"Variant"
Lovely!

That is the function indeed.
I was looking for it (traitSet(key).Name). Now I can play around.
It works 🙂
Thanks for your help!
Appreciate it.

Original thread: https://forums.rpgmakerweb.com/threads/script-call-to-return-visustella-traits-sets.151361/