I wasn't able to find anything about this while searching, but I was wondering what would be the best way to add a state to an actor when this actor changes their class or subclass to a specific job.
I already have these tags which I am using to customize equipment options,
(user.currentClass().id == x)
&
user.subclass() !== null && user.subclass().id == x)
and I know how to run the script I need once I get to that point, but I can't think of anyway to check if a class/subclass is changed or to perform an action in response to a class/subclass change. Preferably this could be done without a parallel process but I will take what I can get, as long as it can be applied to all my generic actors equally.
I do know I can use a passive state applied to all my actors, and have this passive state only be active when said actor is x class/subclass, however I only want the action to be performed in response to the class change itself, rather than something that is always applied while the actor is said class.
www.yanfly.moe
www.yanfly.moe
Maybe something like this that runs at game start or game load,
then a passive state applied to all actors with a condition like so:
and duplicate the state for subclasses as well.
I think this will work, if I am remembering correctly I can use custom apply effect combined with a custom passive condition, to only run the code when the passive condition applies the state, yea?
Might there be a better way though?
I already have these tags which I am using to customize equipment options,
(user.currentClass().id == x)
&
user.subclass() !== null && user.subclass().id == x)
and I know how to run the script I need once I get to that point, but I can't think of anyway to check if a class/subclass is changed or to perform an action in response to a class/subclass change. Preferably this could be done without a parallel process but I will take what I can get, as long as it can be applied to all my generic actors equally.
I do know I can use a passive state applied to all my actors, and have this passive state only be active when said actor is x class/subclass, however I only want the action to be performed in response to the class change itself, rather than something that is always applied while the actor is said class.
Class Change Core (YEP) - Yanfly.moe Wiki
Subclass (YEP) - Yanfly.moe Wiki
Maybe something like this that runs at game start or game load,
Code:
var currentClass = user.currentClass().id;
if (user.subclass() !== null) {
var currentSubclass = user.subclass().id
};
then a passive state applied to all actors with a condition like so:
Code:
<Custom Passive Condition>
if (user.currentClass().id == var currentClass) {
condition = false;
} else if (user.currentClass().id == 1) {
condition = true;
} else if (user.currentClass().id == 2) {
condition = true;
etc
} else {
condition = false;
}
</Custom Passive Condition>
<Custom Apply Effect>
if (user.currentClass().id == 1) {
-equip slot changing code goes here-
}
else if (user.currentClass().id == 2) {
-equip slot changing code goes here-
}
etc
;
</Custom Apply Effect>
and duplicate the state for subclasses as well.
I think this will work, if I am remembering correctly I can use custom apply effect combined with a custom passive condition, to only run the code when the passive condition applies the state, yea?
Might there be a better way though?