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

unintentionally made a track that sounds straight out of Yume Nikki
Revisiting one of my older projects in a long time to work some more on the mechanics. I've been working on- and off-again for about a year now on recreating the Force and Mystic systems from Wild ARMs. And I think I've finally made some good breakthroughs on that!

Still, it is not perfect and I may post my thoughts at a later time to see if there are any other suggestions or alternatives I've missed.
actor name string, why you gotta be case sensitive like that?
Doing RPG Maker News for 26th October 2021

My entire world, full of monsters and treasures, will likely be done by the end of the year. After that it's all NPCs and side quests... then done. I'm never making an open world game again xD

Forum statistics

Threads
116,106
Messages
1,095,848
Members
151,505
Latest member
rensky
Top