Mkol103

Warper
Member
Joined
Dec 29, 2017
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hey there. I've been working on a game that uses a job and subjob system using the class change core and the subclass core. I've almost finished implementing it, but there's still a hangup that's been causing some issues: I can only get passives to apply to a primary job. Right now, passives are autostates and I've been trying to use this code snippet to get it to work only either the job or subjob has 10 or more jp:
Code:
<Custom Passive Condition>
if (user.currentClass().id == 1) {
  if (user.jp() >= 10) {
    condition = true;
  } else {
    condition = false;
  }
} else if (user.subclass() != null) {
  if (user.subclass().id == 1) {
    if (user.subclass().jp >= 10) {
      condition = true;
    } else {
      condition = false;
    }
  } else {
    condition = false;
  }
} else {
  condition = false;
}
</Custom Passive Condition>

However, it seems that subclasses don't have jp values assigned to them from what I can tell. I ran a little experiment, and an NPC can tell me the id and name of my subclass, but I get error screens when I try to have it tell me its jp. So, I guess what I'm looking for is either a way to display jp values for subjobs OR another way to check whether a passive should be applied

(P.S. I would have it check for the corresponding skill, but the way I have it for learning skills is that jobs learn all their skills at level 1, but they're only visible once a JP threshold is met by using the skills core, so checking to see if they have a skill would always return true, even if the skill wasn't visible. Can you check for skill visibility?)

Any help would be appreciated.
 

Mkol103

Warper
Member
Joined
Dec 29, 2017
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hey there. I've been working on a game that uses a job and subjob system using the class change core and the subclass core. I've almost finished implementing it, but there's still a hangup that's been causing some issues: I can only get passives to apply to a primary job. Right now, passives are autostates and I've been trying to use this code snippet to get it to work only either the job or subjob has 10 or more jp:
Code:
<Custom Passive Condition>
if (user.currentClass().id == 1) {
  if (user.jp() >= 10) {
    condition = true;
  } else {
    condition = false;
  }
} else if (user.subclass() != null) {
  if (user.subclass().id == 1) {
    if (user.subclass().jp >= 10) {
      condition = true;
    } else {
      condition = false;
    }
  } else {
    condition = false;
  }
} else {
  condition = false;
}
</Custom Passive Condition>

However, it seems that subclasses don't have jp values assigned to them from what I can tell. I ran a little experiment, and an NPC can tell me the id and name of my subclass, but I get error screens when I try to have it tell me its jp. So, I guess what I'm looking for is either a way to display jp values for subjobs OR another way to check whether a passive should be applied

(P.S. I would have it check for the corresponding skill, but the way I have it for learning skills is that jobs learn all their skills at level 1, but they're only visible once a JP threshold is met by using the skills core, so checking to see if they have a skill would always return true, even if the skill wasn't visible. Can you check for skill visibility?)

Any help would be appreciated.

Hey, I'm a dummy, I figured it out. When the parenthesis after jp is blank, it defaults to your current job. If you include a number, that number is the class it draws from. Here's my new code, if you're interested.
Code:
<Custom Passive Condition>
if (user.currentClass().id == 1) {
    if (user.jp() >= 10) {
        condition = true;
    } else {
        condition = false;
    }
} else if (user.subclass() != null) {
    if (user.subclass().id == 1) {
        if (user.jp(user.subclass().id) >= 10) {
            condition = true;
        } else {
            condition = false;
        }
    } else {
        condition = false;
    }
} else {
    condition = false;
}
 </Custom Passive Condition>
 

Lear

Veteran
Veteran
Joined
Aug 12, 2012
Messages
59
Reaction score
11
Primarily Uses
Kind of off thread topic, but you could cut the code lines down by half if you condense the code like this:


Code:
<Custom Passive Condition>
if (user.currentClass().id == 1) && (user.jp() >= 10) {
  condition = true;
} else {
  condition = false;
}
if (user.subclass() != null) && (user.subclass().id == 1) && (user.subclass().id >= 10) {
  condition = true;
} else {
  condition = false;
}
 </Custom Passive Condition>
 

Latest Threads

Latest Profile Posts

$Syringer.png
toying with a brand new monster design
Another doodle! Green-haired girl has no name yet, so, any suggestions?
She is about the same age as Nikki, and she is the last one of her clan, known for their innate skills in manipulating both ice and fire. She is a bit stubborn, as well as having a soft spot for kids.
Mystery messages from my AI assistant. :kaojoy:
1632842960834.png
Made some updates to a previous project I was working on. Trying to mimic the 16 bit Squaresoft aesthetic.

Forum statistics

Threads
115,434
Messages
1,089,892
Members
150,203
Latest member
mead80
Top