[XP] R0 Job/Skill System Job EXP

Started by Griver03, June 17, 2011, 10:07:51 am

Previous topic - Next topic

Griver03

June 17, 2011, 10:07:51 am Last Edit: June 17, 2011, 03:36:50 pm by Griver03
hi again now i got almost everything finished in my class system the only thing left is the levelup system for jobs.
i use legacy blades legacy class change script and want the job EXP part from R0 Job/Skill system in the legacy class change script.
i tryed much things to cut the part out and integrate it in legacy class change but i dont get it...
i dont want the jp or the skill system only the job exp !
in the lagacy class chnage script the levelup method for job levels are like if you get an actor lrvrl up you get an job level up...
so i want that the job exp for leveling up classes.
like i said i didnt get it working so if someone maybe could help me by this ?!

thx in advance


Legacy Class Change

RO SKILL/JOB System

In the legacy class change script the level up method is on line 570 if that helps.
My most wanted games...



Blizzard

I just wanted to point out, it's RO, not R0. xD
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Twb6543

You linked to the same topic twice (both to the RO job/skill system)...
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

Griver03

QuoteI just wanted to point out, it's RO, not R0. xD


yeah i know but in your script header its a 0 and a 0 its in online jargon an o so sorry when i confuse someone with that xDDD
My most wanted games...



Blizzard

No, it's also an O, but it might look a lot like 0 because of the font. xD
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Twb6543

So what do you actually want your first post is very confusing,
Do you want the job xp to level the character as well, (I get the bit about you wanting the job to level up when the character levels up as well).

I'll try and have a go at this but I mainly script in VX so sorry if I can't complete it...
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

Griver03

June 18, 2011, 10:32:25 am #6 Last Edit: June 18, 2011, 10:52:20 am by Griver03
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...

Spoiler: ShowHide

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 <.<
My most wanted games...



Twb6543

June 18, 2011, 12:37:05 pm #7 Last Edit: June 18, 2011, 01:06:40 pm by Twb6543
First of all that error is non existent, the correct error is nil to string this suggests something hasn't been defined, I'll take a closer look in a bit...



You need to at least alias the setup(id) like below (on line 26), I changed your other alias to alias :old_method :new_method just because it's how I type, Test it and see if you get any more problems...

Spoiler: ShowHide

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 < Game_Battler
 
  attr_accessor :jp
  #attr_accessor :job_level # maybe ???
  #attr_accessor :job_exp # maybe ???
  #----------------------------------------------------------------------------
  # override setup
  #  Adds some hashes for additional data.
  #----------------------------------------------------------------------------
  alias :setup_JP :setup # Added this line
  def setup(id)
    setup_JP(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
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

Griver03

June 18, 2011, 02:20:57 pm #8 Last Edit: June 18, 2011, 02:24:00 pm by Griver03
ok now i didnt get the error but i cant say if it works because i need to display the job lv in the main menu after the classname,
the job exp and next job exp somewhere in the main menu.
if i had that i can test if it works standalone.

i need these parameters and the values.
BlizzCFG::JobPoints + ':'
BlizzCFG::JobLevel + ':'
BlizzCFG::JobEXP + ':'
BlizzCFG::Next + ':'
My most wanted games...



Twb6543

June 19, 2011, 05:53:19 am #9 Last Edit: June 19, 2011, 06:00:54 am by Twb6543
Sorry I actually can't work on this for quite a while so you probably need to find another scripter (get someone who is actually good at RGSS (I'm ok at it but I mainly prefer VX's RGSS2) ) I've done little work on it but I have another project that takes priority (sorry)...
:( :(
If you put a million monkeys at a million keyboards, one of them will eventually write a Java program.
The rest of them will write Perl programs.

Griver03

June 19, 2011, 11:22:10 am #10 Last Edit: June 20, 2011, 11:50:25 am by Griver03
np dude ^^

edit: read one post below. (this is old and not nececary anymore...)
Spoiler: ShowHide
ok ive editet the window_base a bit to show the joblevel, job exp and jp in main menu.
but when i increase the job level, job exp or jp it doesnt show them correct in menu.
it shows me an 1 for all of them and when i increase them more it comes an 0 again....
i think something is resetting them all the time...
and i dont have all of the parameters in menu because i dont know how i make this.
here i got that what i have so far. (its made with an trial of rmxp so you have to replace the project file.)
http://www.mediafire.com/?9zxauy99zvdhm98

hope someone will help me.
My most wanted games...



Griver03

June 20, 2011, 11:25:29 am #11 Last Edit: June 20, 2011, 11:28:47 am by Griver03
oki got it now ready to be integratet into the legacy script !
all works thx to Twb6543 great help  :haha:
the adjustments for the windows arent fine yet but they work.
i still have 2 lil probs with displaying but theyre very easy.

1. Menu looks good


2. Menu looks bad ^^

the job exp numbers are resized but they should look like normal exp, i think i need more space (x,y,XXX,32... the XXX must be higher or?!
and the jp should be drwan to the right side so that they not going to overlay with the JP string.
but like i said i think its very easy to fix that !

but now it begins to get hard...
it must be integrated to the legacyblade legacy class change script.
the hard thing at this is, at least i think so that the skill system of legacy still works as it should !
also the standart class level system from legacy should be removed so that the new system not conflict with the old one.

like i always say, thx in advance  :shy:


edit: heres is a demo from that what i have so far:
(its made with a trial of rmxp so you have to replace the project file or you get an error that its from an old version.)
My most wanted games...