- Joined
- Apr 19, 2018
- Messages
- 179
- Reaction score
- 213
- First Language
- English
- Primarily Uses
- RMMV
I’ve got actors who have selectable main classes and subclasses in my project, and I’m trying to figure out how to check an actor’s current subclass so I can use the subclass ID as a condition for various events, evals, etc.
I’ve seen the script call below recommended elsewhere to accomplish this, but every time I use it, I get errors as soon as the script is called:
a.subclass().id === x
Where x is the subclass ID. So for example, I tried something like this with Yanfly’s Auto Passive States plugin:
<Custom Passive Condition>
if (user.subclass().id === 1) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>
The above code (written in the State notebox) caused the game to immediately crash when an actor who had both the passive state and the designated subclass went into battle.
I also get errors when trying to use the code in battle events with this format:
$gameActors.actor(x).subclass().id === y
Where x is the actor ID and y is the subclass ID. The consistent errors lead me to believe there’s something fundamentally wrong with the way I’m using the script call, rather than the specific events or plugins I’m trying to use it with.
Can anyone give me some insight into where I’m going wrong? Thanks!
I’ve seen the script call below recommended elsewhere to accomplish this, but every time I use it, I get errors as soon as the script is called:
a.subclass().id === x
Where x is the subclass ID. So for example, I tried something like this with Yanfly’s Auto Passive States plugin:
<Custom Passive Condition>
if (user.subclass().id === 1) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>
The above code (written in the State notebox) caused the game to immediately crash when an actor who had both the passive state and the designated subclass went into battle.
I also get errors when trying to use the code in battle events with this format:
$gameActors.actor(x).subclass().id === y
Where x is the actor ID and y is the subclass ID. The consistent errors lead me to believe there’s something fundamentally wrong with the way I’m using the script call, rather than the specific events or plugins I’m trying to use it with.
Can anyone give me some insight into where I’m going wrong? Thanks!
