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 Posts

Latest Profile Posts

2021 has been the runner-up for the worst year of my life. 2015 may take that title, but '21 is pushing it. Excuses really don't justify how much of a jerk I've been this year to a lot of people.

I'm sorry. I don't intend to be a jerk forever, but I'd rather back up my intent with actions, not words.
"Another hundred habaneros... a teaspoon of tumeric... and a heaping helping of nitroglycerin!" The kitten in a chef's hat laughed maniacally as the pot he was stirring promptly exploded.
Woot got a promotion and a pay rise ᕙ( • ‿ • )ᕗ now I'm set.
does anyone feel like explaining to me the difference between simulation and emulation? you have my full permission to be as pedantic as you want.

Forum statistics

Threads
116,010
Messages
1,094,899
Members
151,324
Latest member
DavidUchina
Top