ok sry for confuing ^^
i use the legacy class change script.
but i want that like in the RO system jobs/classes get leveled up by job exp and not like in the legacy class change with levels or normal exp !
i still want to have an normal actor level but also the job lv.
here is what i get so far but it gave me an error and idk why ?!
"Script Sprite_Character Line 45 Type error occured"
"cannot convert string into nil..."
but why comes an error like this up?
i looked on the whole Sprite_character script and found nothing what probably can cause the bug...
module BlizzCFG
INIT_JP = 1
LVLUP_RATE = 20
EXP_RATIO = 20
def self.rojob_maxlevel(id)
case id
when 1 then return 10
when 2 then return 30
end
return 1
end
end
class Game_Actor
attr_accessor :jp
#attr_accessor :job_level # maybe ???
#attr_accessor :job_exp # maybe ???
#----------------------------------------------------------------------------
# override setup
# Adds some hashes for additional data.
#----------------------------------------------------------------------------
def setup(id)
@job_level, @job_exp, @jp = {}, {}, BlizzCFG::INIT_JP
end
#----------------------------------------------------------------------------
# job_level
# id - class ID
# Safe return of any job level, current job level is default.
#----------------------------------------------------------------------------
def job_level(id = @class_id)
return (@job_level[id] == nil ? 1 : @job_level[id])
end
#----------------------------------------------------------------------------
# job_exp
# id - class ID
# Safe return of any job exp, current job exp are default.
#----------------------------------------------------------------------------
def job_exp(id = @class_id)
return (@job_exp[id] == nil ? 0 : @job_exp[id])
end
#----------------------------------------------------------------------------
# job_level_change
# val - new level value
# id - class ID
# flag - determines whether EXP should be updated or not
# This method processes change of a job level.
#----------------------------------------------------------------------------
def job_level_change(val, id = @class_id, flag = true)
# get level
new_level = BlizzCFG.rojob_maxlevel(id)
# limit level value
if new_level > val
new_level = val
elsif new_level < 1
new_level = 1
end
# get Job Points
jp = new_level - self.job_level(id)
# increase Job Points
@jp += jp if jp > 0
# set new Job level
@job_level[id] = new_level
# set Job EXP if the setting flag is active
@job_exp[id] = BlizzCFG::LVLUP_RATE * new_level * (new_level - 1) if flag
end
#----------------------------------------------------------------------------
# override exp=
# val - new exp value
# This method was modified to add job EXP each time real EXP are added.
#----------------------------------------------------------------------------
alias exp_is_rosys_later exp=
def exp=(val)
# store old EXP and skills
old_exp
exp_is_rosys_later(val)
# increase Job EXP
exp = @exp - old_exp
add_job_exp(exp * BlizzCFG::EXP_RATIO / 100) if exp > 0
end
#----------------------------------------------------------------------------
# add_job_exp
# val - new exp value
# id - class ID
# This method executes job exp increasing.
#----------------------------------------------------------------------------
def add_job_exp(val, id = @class_id)
max_level = BlizzCFG.rojob_maxlevel(id)
# set new Job EXP
exp1 = self.job_exp(id) + val
exp2 = BlizzCFG::LVLUP_RATE * max_level * (max_level - 1)
@job_exp[id] = (exp1 < exp2 ? exp1 : exp)
# as long as Job level can be increased
while self.job_level(id) < max_level && self.job_exp(id) >=
BlizzCFG::LVLUP_RATE * self.job_level(id) * (self.job_level(id) + 1)
# increase Job level
job_level_change(self.job_level(id) + 1, id, false)
end
end
#----------------------------------------------------------------------------
# job_max_level?
# Checks if the Job's level is at the maximum.
#----------------------------------------------------------------------------
def job_max_level?
return (self.job_level >= BlizzCFG.rojob_maxlevel(@class_id))
end
end
this is what i cuttet out to test it in a new project.
and i still have the jp system in that but i dont need it so it can be cuttet out as well...
only job lv and job exp are important to me.
@blizz ok ive seen this last night with the font an o and an 0 are the same in the rgss editor <.<