Class Specifics

Last Updated: 2011.12.23
Download Link
Github Link

This script allows for certain classes to be primary-only or sublcass-only. In addition to that, subclasses can require certain classes to be primary classes in order to be applied.

Insert these tags inside of a class’s notebox:

<primary only>

Makes this class equippable only if it’s the primary class.

<subclass only>

Makes this class equippable only if it’s the subclass class.

<subclass to: x>
<subclass to: x, x>

This makes the class subclass only and only equippable if the primary class is one of the listed x classes.

And that’s all, folks!

58 comments on “Class Specifics

  1. I’m curious, do primary classes appear in the subclass list and vice versa? If they don’t cross lists, you could do some interesting things with this; setting the primary classes up like classes (Warrior, Rogue) and then setting the subclasses up like magic types (Fire, Water) or something similar. Also Yanfly, I’ve come to the conclusion that you must be the first of our benevolent mechanical overlords because no human can write scripts this fast.

  2. Is there no way to make certain actors limited to classes (so that some actors can have many classes, and others cannot), and is there a way to make actors start with a subclass, and start with other classes being at certain levels (since I know that the Primary class they begin with is at their initial level)?

    • I’m pretty sure you can use in the characters notebox to set each character certain classes they have available where X is the class number. That allows you to limit certain characters from certain classes(first question). doing that with subclasses works too(second question) but I don’t think there’s anything on STARTING with classes at certain levels.

  3. Methinks that the two above posters are making things too complicated for their games. Simplicity is where it’s at, guys.

  4. I was wondering.
    Could you add something to this script like when a class have on
    then it should not be showen in the subclass selection.
    or when a class have on then it should not be showen in thee primary selection. Would bee great to have this option.
    Greatings.
    and thanks.

    • ops
      I was wondering.
      Could you add something to this script like when a class have primary on
      then it should not be showen in the subclass selection.
      or when a class have subclass on then it should not be showen in thee primary selection. Would bee great to have this option.
      The >< sign removed the word in it XD

  5. some addition for your class system class specific.
    many user have problem when they subclass only class. the class cannot gain exp.
    this can be the fix. add this in new script below yea class specific. hope that helps:

    module ESTRIOLE
    SUB_EXP_RATE = 0.50 # exp rate. 0.50 means half exp rate for subclass
    end

    class Game_Actor < Game_Battler
    def subclass_add_exp(class_id,value)
    if class_id == 0

    else
    expvalue = value * ESTRIOLE::SUB_EXP_RATE
    expvalue.to_i
    sub_lv = class_level(class_id).to_i
    cur_lv_exp = $data_classes[class_id].exp_for_level(sub_lv)
    @exp[class_id] = cur_lv_exp + expvalue
    end
    end

    def gain_exp(exp)
    testexp = (exp * final_exp_rate).to_i
    change_exp(self.exp + (exp * final_exp_rate).to_i, true)
    subclass_add_exp(@subclass_id,testexp)
    end

    end

  6. #==============================================================================
    # ** ESTRIOLE – YEA ADDON – SUBCLASS GAIN EXP AND LEARN SKILL
    #——————————————————————————
    # Author : ESTRIOLE
    #
    # Version History:
    # v 1.00 – 2012.06.21 > First relase
    #——————————————————————————
    # This script is addon to YEA class system. Subclass equiped will gain
    # full or some exp.
    #——————————————————————————
    # Compatibility
    # 1) Requires the script YEA – Class System
    # 2) Add this in vocab module
    #
    # LevelUpSub = “%s’s Subclass now reached %s %s!”
    #——————————————————————————
    # Instructions:
    # To instal the script, open you script editor and paste this script on
    # a new section on bellow the Materials section. This script must also
    # be bellow the script YEA – Class System then add this in vocab module
    #
    # LevelUpSub = “%s’s Subclass now reached %s %s!”
    #
    # about this… i have try to use ESTRIOLE::VOCAB:: LevelUpSub but somehow
    # it always return unknown methods >.<
    #
    # PS : sorry if the code is not too clean. if anyone can arrange them feel free
    # to do that
    #
    #——————————————————————————

    module ESTRIOLE
    SUB_EXP_RATE = 0.50 # exp rate. 0,50 means half exp rate for subclass
    primary_flag = 0
    end

    class Game_Actor < Game_Battler
    # new method to add exp to subclass
    def subclass_add_exp(class_id,value)
    if @subclass_id == 0
    # do nothing
    else
    expvalue = value * ESTRIOLE::SUB_EXP_RATE
    expvalue.to_i
    sub_lv = class_level(class_id).to_i
    first_level = sub_lv
    cur_lv_exp = $data_classes[class_id].exp_for_level(sub_lv)
    @exp[class_id] = cur_lv_exp + expvalue
    last_level = sub_lv
    last_skills = skills
    #learn skill if sub level can learn it
    self.subclass.learnings.each do |learning|
    learn_skill(learning.skill_id) if learning.level last_level
    end
    end
    # new method subclass -> to get data classes of subclass
    def subclass
    init_subclass if @subclass_id.nil?
    $data_classes[@subclass_id]
    end

    # new method to display level up when subclass level
    def display_level_up_sub(new_skills)
    level_sub = class_level(@subclass_id).to_i
    $game_message.new_page
    $game_message.add(sprintf(Vocab::LevelUpSub, @name, Vocab::level ,level_sub))
    new_skills.each do |skill|
    $game_message.add(sprintf(Vocab::ObtainSkill, skill.name))
    end
    end

    # override method change_exp so can add exp to subclass too
    def change_exp(exp, show)
    testexp = exp – self.exp
    @exp[@class_id] = [exp, 0].max
    last_level = @level
    last_skills = skills
    level_up while !max_level? && self.exp >= next_level_exp
    level_down while self.exp last_level
    refresh
    subclass_add_exp(@subclass_id, testexp)
    end
    end

    • Estriole,
      I have installed this script.
      I am having trouble making it work. will this script work even if you have a primary job equipped? or sub only? I’m looking to have primary class gain 100%exp while sub class to gain 50%exp.

      • this will work either way. if you only equip primary class. it do nothing. and if you equip primary class + subclass it will add 50% of exp to subclass while primary still gain 100%. btw what trouble you encounter. can you be more spesific? and does the trouble occurs with fresh project with this and yanfly class script or compatibility with other script?

      • perhaps your problem is this:
        #2) Add this in vocab module
        #
        # LevelUpSub = “%s’s Subclass now reached %s %s!”

    • Ur Script is Missing a third “end”, copying it gave me Errors, so i added one “end” more, anyway cant get any xp on my Subclass. :(.

    • Okay, this script to level subclasses is exactly what I want, since I’m having a lot of subclass only classes. Unfortunately, when I apply this script, I get this error:

      “Script ‘Subclass Gain EXP’ line 84: SyntaxError occurred.

      unexpected $end, expecting keyword_end”

      What happened, and what do I do to fix it? I have very little knowledge of coding, sadly…

      • Estriole’s script is missing a third end in the last part of the script. Drop in a third end and you should be good to go. The error is simply complaining that it can’t find one.Hiobs had the same problem.

    • Encountering a problem when adding

      LevelUpSub = “%s’s Subclass now reached %s %s!”

      to the vocab_module and the error reads,
      “Unexpected tCONSTANT, expecting keyword_do_or ‘[ or ]’
      LevelUpSub = “%s’s Subclass now reached %s %s!”

      Any clue what I am doing wrong?

  7. I was wondering about what the second and third person said also… Is there a way to do this? because I’m trying to make it so my 2 main characters have a ‘profession’ as their first class but I don’t want any other actors to get this class. Also, I want certain actors to have certain classes for now until they unlock the next class( meaning if I have a priest in the party, I dont want my Archer to beable to switch without learning/unlocking the class)

  8. When I try test playing after loading some of your scripts into my game, I get the follow message:

    Script ‘Ace Class System’ line 214: NoMethodError occured.

    undefined method `[]’ for nil:NilClass

    Anyone know what this means or how to fix it?

  9. I’m having minor trouble with this script. Despite making two classes primary only with the script, I play test it and find I can still equip both “primary-only” classes in the sub class slot.

    Also, when replacing “x” in the tags, am I supposed to place the number or the name of the class where X is? I’m somewhat confused since neither option seems to do what I want it to do… namely specifying what classes begin as unlocked for certain actors in regards to the overall class system.

    • Okay, ignore these issues. I must’ve copy/pasted the script wrong, its working now, and I figured out what needed to be done with regards to answering what replaces “x” in the tags.

      However, the issue that brought that question up in the first place is still bothering me. Even if they’re not supposed to have it as specified by tags, all of my characters can use the first class in the database.

    • I have the problem with primary only classes being able to be selected as subclasses and vice versa. And I dont think I pasted anything wrong. :/
      Any ideas on how you fixed it?

  10. First, thank you, Erics and Nidking, for answering my questions. Unfortunately, now I’ve come across the issue of not knowing how to activate the subclass exp gain script as per the instructions. I swear, as soon as this is answered, I’m done asking questions.

    But yes, simply put, I have no idea how to follow this part of the instructions

    “# 2) Add this in vocab module
    #
    # LevelUpSub = “%s’s Subclass now reached %s %s!””

    Can someone tell me where? or better yet, put a pic of where up?

    • I can’t give screenshots right now, but I can help you. On the scripts page, right at the very top, you have the modules section. Click on ‘vocab’ and go down to line 41. You will see a command called levelup = “something blabla.” Do not delete that. create a new line below and type in Levelupsub “%s’ such and such” as Estriole says. That bit is very important- copying the line will break the script.

      By the end, you should have levelupsub on line 42, below levelup. Play and all should work.

      • … okay now I’m just confused as all hell. With the more detailed written instructions, I added the new line properly, but the script isn’t working, my subclasses still aren’t recieving any EXP. I thought I might’ve somehow screwed up the subclass EXP script itself, so I deleted it and recopied it into my scripts page, but this doesn’t make the script work.

        Have I done something else wrong, or what?

    • Adding to my comment below, I’m afraid Estriole’s script just doesn’t work, at all. I’ve just put it into my project and it works without errors… the only problem is that it doesn’t do anything. The subclass still does not level up, nor does it gain any experience at all.

      I have a feeling that Estriole is going to have to revise his script, because following his instructions still doesn’t get the script to achieve the desired effect. It’s a shame that it doesn’t work, but it was nice of him to try :3

  11. Argunas was making a joke about me saying it didn’t work. It does indeed work, in the technical sense- it doesn’t break the game. It just doesn’t do what you want it to do eg: let subclasses level up.

  12. Sorry for the error above this is the fixed for that

    here’s the code:
    #==============================================================================
    # ** ESTRIOLE – YEA ADDON – SUBCLASS GAIN EXP AND LEARN SKILL – FIXED
    #——————————————————————————
    # Author : ESTRIOLE
    #
    # Version History:
    # v 1.00 – 2012.06.21 > First relase
    # v 1.01 – 2012.08.29 > Fixed bug missing ends
    # > Fixed other bugs
    # > Now no need to touch vocab at all. just constomize this script
    #——————————————————————————
    # This script is addon to YEA class system. Subclass equiped will gain
    # full or some exp.
    #——————————————————————————
    # Compatibility
    # 1) Requires the script YEA – Class System
    #——————————————————————————
    # Instructions:
    # To instal the script, open you script editor and paste this script on
    # a new section on bellow the Materials section. This script must also
    # be bellow the script YEA – Class System
    # notes:
    # sorry took so long to fix the script since i’m not viewing this site often.
    # apparently previous error because i originaly use different script and when
    # i deleting part of the compatibility for it in this script it causes error..
    # now it fixed and work fine. i even found new way to show the subclass level up
    # without touching the vocab
    # and i guess now it’s error free. hope this help everyone using yanfly class script
    #——————————————————————————

    module ESTRIOLE
    SUB_EXP_RATE = 0.50 # exp rate. 0,50 means half exp rate for subclass
    primary_flag = 0
    VOCABSUBLVUP = “%s’s Subclass reached %s %s!”
    end

    class Game_Actor < Game_Battler
    # new method to add exp to subclass
    def subclass_add_exp(class_id,value)
    if @subclass_id == 0
    # do nothing
    else
    expvalue = value * ESTRIOLE::SUB_EXP_RATE
    expvalue.to_i
    sub_lv = class_level(class_id).to_i
    first_level = sub_lv
    cur_lv_exp = $data_classes[class_id].exp_for_level(sub_lv)
    @exp[class_id] = cur_lv_exp + expvalue
    last_level = sub_lv
    last_skills = skills
    #learn skill if sub level can learn it
    self.subclass.learnings.each do |learning|
    learn_skill(learning.skill_id) if learning.level last_level
    end
    end
    # new method subclass -> to get data classes of subclass
    def subclass
    init_subclass if @subclass_id.nil?
    $data_classes[@subclass_id]
    end

    # new method to display level up when subclass level
    def display_level_up_sub(new_skills)
    level_sub = class_level(@subclass_id).to_i
    lvuptext = ESTRIOLE::VOCABSUBLVUP
    $game_message.new_page
    $game_message.add(sprintf(lvuptext, @name, Vocab::level ,level_sub))
    new_skills.each do |skill|
    $game_message.add(sprintf(Vocab::ObtainSkill, skill.name))
    end
    end

    # override method change_exp so can add exp to subclass too
    def change_exp(exp, show)
    testexp = exp – self.exp
    @exp[@class_id] = [exp, 0].max
    last_level = @level
    last_skills = skills
    level_up while !max_level? && self.exp >= next_level_exp
    level_down while self.exp last_level
    refresh
    subclass_add_exp(@subclass_id, testexp)
    end
    # override method gain_exp so can add exp to subclass too
    def gain_exp(exp)
    enabled = SceneManager.scene_is?(Scene_Battle)
    change_exp(self.exp + (exp * final_exp_rate).to_i, enabled)
    end

    end

    • Tested out your new script and it works like a charm, not a single error to be seen. Thanks for the effort put in! Have yourself an internet, a cookie and the combined thanks of everyone who was waiting for this :3

  13. i try that in fresh project with only yanfly class script, class specific, class unlock level. i put this script below them. so i guess it should works now. sorry for long update. since i rarely check this page and i think the previous script works just fine :p.

  14. Is the fact that skills enabled by sub-classing never disappear, after the class is completely removed via script, intentional?

    I realize that subclass skills can be disabled, but I assumed that they would only be enabled, by default, when the subclass is active. Rather ALL of them are. And yet removing them to try and work around this, doesn’t work either.

    Would it be possible to add a new option that will only enable subclass skills when the subclass is ACTIVE? This way it wouldn’t matter. As a removed class can not be active.

  15. Is there a way to make it so that classes marked ONLY appear under the primary class menu and classes marked ONLY appear under the subclass menu?
    Because right now I have 3 classes with 6 subclasses (2 for each class) and presence of all of the classes on the same list makes the whole thing look rather confusing…

  16. Sorry to sound like a real script noob here, but I’ve looked through all your class scripts and I can’t really find what i’m looking for.

    Is there anyway to make it possible to attach a class to only 1 actor without that class showing up in the Primary or Sub menus?

  17. I was just wondering if there is a way to prevent certain classes from showing up on the class changer. (Eg. My hero has berserker and assassin already unlocked at the start of the game but shes only supposed can only be dragon kin with no subclass)

    Another problem is the fact berserker and assassin are automatics for all my actors. I don’t want that.

    • Line 100 has this:
      DEFAULT_UNLOCKS = [1, 11, 21, 31] # Classes unlocked by default.
      Are assassin or berserker one of those numbers?

  18. I am getting the same problem Onnonnon. Anyone who can post a link, or paste the script would be nice. Thanks!

  19. Could somebody post the script or maybe a URL of one we can copy? Pastebin perhaps :P Because dropbox has error 509 :( Thanks!

  20. Hey guys, been refreshing the dropbox link hoping to get it, but I found another link in the comments with an attempted subscript and example project. had the script in it. .gist table { margin-bottom: 0; } This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters #============================================================================== # # ▼ Yanfly Engine Ace – Class Specifics v1.00 # — Last Updated: 2011.12.23 # — Level: Normal # — Requires: YEA – Class System v1.03+ # #============================================================================== $imported = {} if $imported.nil? $imported["YEA-ClassSpecifics"] = true #============================================================================== # ▼ Updates # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # 2011.12.23 – Started Script and Finished. # #============================================================================== # ▼ Introduction # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This script allows for certain classes to be primary-only or sublcass-only. # In addition to that, subclasses can require certain classes to be primary # classes in order to be applied. # #============================================================================== # ▼ Instructions # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # To install this script, open up your script editor and copy/paste this script # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save. # # —————————————————————————– # Class Notetags – These notetags go in the class notebox in the database. # —————————————————————————– # <primary only> # Makes this class equippable only if it's the primary class. # # <subclass only> # Makes this class equippable only if it's the subclass class. # # <subclass to: x> # <subclass to: x, x> # This makes the class subclass only and only equippable if the primary class # is one of the listed x classes. # #============================================================================== # ▼ Compatibility # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that # it will run with RPG Maker VX without adjusting. # # This script requires Yanfly Engine Ace – Class System v1.03+. # #============================================================================== # ▼ Editting anything past this point may potentially result in causing # computer damage, incontinence, explosion of user's head, coma, death, and/or # halitosis so edit at your own risk. #============================================================================== if $imported["YEA-ClassSystem"] module YEA module REGEXP module CLASS PRIMARY_ONLY = /<(?:PRIMARY_ONLY|primary only)>/i SUBCLASS_ONLY = /<(?:SUBCLASS_ONLY|subclass only)>/i SUBCLASS_TO = /<(?:SUBCLASS_TO|subclass to):[ ]*(d+(?:s*,s*d+)*)>/i end # CLASS end # REGEXP end # YEA #============================================================================== # ■ DataManager #============================================================================== module DataManager #————————————————————————– # alias method: load_database #————————————————————————– class <<self; alias load_database_csp load_database; end def self.load_database load_database_csp load_notetags_csp end #————————————————————————– # new method: load_notetags_csp #————————————————————————– def self.load_notetags_csp for obj in $data_classes next if obj.nil? obj.load_notetags_csp end end end # DataManager #============================================================================== # ■ RPG::Class #============================================================================== class RPG::Class < RPG::BaseItem #————————————————————————– # public instance variables #————————————————————————– attr_accessor :primary_only attr_accessor :subclass_only attr_accessor :subclass_to #————————————————————————– # common cache: load_notetags_csp #————————————————————————– def load_notetags_csp @primary_only = false @subclass_only = false @subclass_to = [] #— self.note.split(/[rn]+/).each { |line| case line #— when YEA::REGEXP::CLASS::PRIMARY_ONLY @primary_only = true @subclass_only = false @subclass_to = [] when YEA::REGEXP::CLASS::SUBCLASS_ONLY @primary_only = false @subclass_only = true when YEA::REGEXP::CLASS::SUBCLASS_TO @primary_only = false @subclass_only = true $1.scan(/d+/).each { |num| @subclass_to.push(num.to_i) if num.to_i > 0 } end } # self.note.split #— end end # RPG::Class #============================================================================== # ■ Game_Actor #============================================================================== class Game_Actor < Game_Battler #————————————————————————– # alias method: change_class #————————————————————————– alias game_actor_change_class_csp change_class def change_class(class_id, keep_exp = false) return if $data_classes[class_id].subclass_only game_actor_change_class_csp(class_id, keep_exp) correct_subclass end #————————————————————————– # alias method: change_subclass #————————————————————————– alias game_actor_change_subclass_csp change_subclass def change_subclass(class_id) return unless subclass_requirements_met?(class_id) game_actor_change_subclass_csp(class_id) end #————————————————————————– # new method: subclass_requirements_met? #————————————————————————– def subclass_requirements_met?(class_id) subclass = $data_classes[class_id] return false if subclass.primary_only return subclass_to?(class_id) if subclass.subclass_to != [] return true end #————————————————————————– # new method: subclass_to? #————————————————————————– def subclass_to?(class_id) return true if class_id == 0 subclass = $data_classes[class_id] return false if subclass.nil? for class_id in subclass.subclass_to return true if class_id == self.class.id end return false end #————————————————————————– # new method: correct_subclass #————————————————————————– def correct_subclass return if @subclass_id == 0 subclass = $data_classes[@subclass_id] return if subclass.nil? return if subclass.subclass_to == [] @subclass_id = 0 if !subclass_to?(@subclass_id) end end # Game_Actor #============================================================================== # ■ Window_ClassList #============================================================================== class Window_ClassList < Window_Selectable #————————————————————————– # alias method: enable? #————————————————————————– alias window_classlist_enable_csp enable? def enable?(item) case @command_window.current_symbol when :primary return false if item.subclass_only when :subclass return false if item.primary_only return @actor.subclass_to?(item.id) if item.subclass_to != [] end return window_classlist_enable_csp(item) end end # Window_ClassList end # $imported["YEA-ClassSystem"] #============================================================================== # # ▼ End of File # #============================================================================== view raw gistfile1.rb hosted with ❤ by GitHub
  21. I’m trying to work with having a set of tertiary classes (the subclass is actually more of a primary class and the primary class is just a way to make a generic character with a set of skills), how would I get the subclass to interact with this tertiary class? Like, I’m aiming on putting a tag into the tertiary that would be along the lines of . Is there an easy way to do this or am I being dumb?

  22. hey im having trouble with the class system and the add-ons for some reason when i set a subclass to unlock at lv 2 it is unlocked right away. and the second character and on all have access to the first class and subclass even though they shouldn’t

  23. I happen to have an issue that I’m most likely overlooking. When character A gets to level A, they unlock skill A. When character A switches to class B, skill A is still available to be used.

    Is there a way to prevent this?

  24. Is there a way to limit the skills from a selected subclass?

    I’m wanting to make it so a class only gives it’s unlocked skills/spells up to a certain level when it’s selected as a subclass, but has them all if selected as a primary.

    Is there an easy way to do this?

    Thanks Yanfly! Your scripts are superb!

  25. Yeah… When I use the script call to unlock stuff, all it gives me is an error in Game_Interpreter. Anyone know how to fix this?

Leave a comment