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! —
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.
That’s the idea, yeah. <3
Is there a way to make it so a Class can only be Primary on 1 Hero and only Secondary on another?
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.
Methinks that the two above posters are making things too complicated for their games. Simplicity is where it’s at, guys.
Is there a way if a Class is note tagged as subclass only, it won’t show a “Lv” in the menu?
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
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
sorry found some bug in that script. subclass dont learn skill. use the one below this post instead
#==============================================================================
# ** 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?
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)
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?
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.
Go into the main class script itself. You will find a line called DEFAULT_UNLOCKS. Change that.
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?
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
Oh, well then just ignore the comment I just posted… lol… sigh…
ohhh but it does work, just not the way it was supposed to. XP
Does it now? Care to explain for those of us who apparently don’t know?
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.
Oh… derp… I feel dumb now… *insert face palm pic*
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
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.
http://www.rpgmakervxace.net/topic/6661-yea-class-script-addon-subclass-gain-exp/
Hey first off, thanks aton for your script, but I’m having an issue with it atm. The subclasses can level, but only once. Each subclass seems to max at lvl 2. Any idea what’s going wrong?
I’ve managed to replicate that error, there is something stopping the subclasses levelling up past 2 or 3. Any idea what might be causing it? I can poke around, but I don’t pretend to have any knowledge on programming.
fixed. open above link again(i edited the first post). sorry for some apparently logical error i made. since this addon actually downgraded version of mine (and sometimes downgrading script is not enough by just deleting lines :D). hope this works now. any bug feel free to post in those link above. thx
You are a god of game scripting ! This makes it easier , thank you so much ! :D
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.
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…
anyway an addon could be made that makes actor graphic change with class?
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?
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?
could someone re post the script i get an error from dropbox when i try to get to it
I am getting the same problem Onnonnon. Anyone who can post a link, or paste the script would be nice. Thanks!
Could somebody post the script or maybe a URL of one we can copy? Pastebin perhaps :P Because dropbox has error 509 :( Thanks!
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?
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
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?
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!
For some reason, the subclass and primary only notetags aren’t working, I’m able to set them for either one
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?