[XP] RO Job/Skill System

Started by Blizzard, January 09, 2008, 04:24:13 pm

Previous topic - Next topic

Kiwa

December 26, 2013, 04:29:52 am #160 Last Edit: December 26, 2013, 08:00:35 am by Kiwa
@finalholy...it was a long time ago you asked but i jsut starting putzing with this script.
Quote
In ragnarok game,even player change from job 1 to job 2, he can still use points to learn skills that he did not learn from job 1.


I'm not sure exactly what you are talking about because i never played RO, but i think your issue is with "CLASS_SKILLS = !false"
you need to remove the "!" and it should let you keep skills after you have learned them, even when you change class.
But if you don't have the skill listed in the "skills to learn" box under the "Classes" tab in the Database you must change classes to obtain the skills.
I think you want to set it like this. (i added some extra comments to maybe help)



Spoiler: ShowHide


  INIT_JP = 2             # Points you begin the game with at Lv 1
  LVL1_POWER = 50    # Skills power at Lv 1
  LVL1_COST = 100    # % of base skill cost.
  LVLUP_RATE = 20    # 20% increase between level_min and level_max
  EXP_RATIO = 400    # 400% Exp to become job pts.. (about 2 pts per level)
  RESET_LVLS = false # wipes Skills and does not return points on class switch
  JOB_ONLY = false     # ***********True Disables the ENTIRE skill System here and leaves only JOB system.
  USE_LEVEL = false  # Uses Toon Lv not Job level.
  USE_ALL = false    # Locks class untill all Job points are spent.
  CLASS_SKILLS = false # Keeps skills bound to designated classes. no cross over.
  HIDE_SKILLS = false # hides skills untill 100% ready to learn.
  RO_RIGHT = false # Re arranges windows to be on the right..not left.
  EVASION = 'EVA' # Displays EVA for the word Evasion in status.
  UP_COLOR = Color.new(0, 255, 0) # (R, G, B)
  DOWN_COLOR = Color.new(255, 0, 0) # (R, G, B)
  CD_SKILLS = [1]





I wanted to ask a question as well for anyone who may know.
Id like to re design the script to change the required level for class..(hard to understand ..i know)
heres an example.. linking blizzes original pic.
Spoiler: ShowHide




look to the left. you can see " Thief  (Lv 1)" and "Figher (Lv 10)"
Id like to change that ...not to the char level required to unlock the class.. but the current level of that class on your character.

I lookd this script up and down for around an hour.. i found no draw including text like "Lv" or anthting.. if some one could point me in the right direction id appreciate it :D

Thanks fellas.. and i hope this post helped ya final holy!

KK20

Look for the method make_class_window. I take it you have separate levels: the actor's level and the class's level?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Kiwa

December 27, 2013, 01:01:05 am #162 Last Edit: December 27, 2013, 01:02:24 am by Kiwa
Quote from: KK20 on December 26, 2013, 08:07:53 pm
Look for the method make_class_window. I take it you have separate levels: the actor's level and the class's level?


Hey KK20. thanks for looking out for me as usual :P
I gotta ask for where to fix instead of how..cuz im not learning fast enough lol. im tired of begging for scraps from people.. tho i'll always have to...but i wanna be more proficient.

I spent a lot of last night in this box...i just woke up and my mind is more clear.. i can see some things differently now. however.. still, im useless lol.
and i don't see where this connects to the list box text im looking for.
ive changed and tampered with some of the code here to understand what it does. but still i cant find it.

I'm looking at this line with an eyebrow up..this looks like it may be my special line. but i cant understand it clearly.

@configs.each {|c| commands.push([$data_classes[c[1]].name,
          "(#{BlizzCFG::Lv} #{c[0]})"])}


especially the second line...the blizzcfg::lv. but i think thats my culprit. ill toy with it after i eat lol.


Note:
so with this script each class has its own level...and each character has its own level. you can see in the image from my last post where they are.

Here it is again:
Spoiler: ShowHide




You can see the char level under his name basil. under the character art you can see the class (job) and class (job) level.



KK20

December 27, 2013, 01:35:04 am #163 Last Edit: December 27, 2013, 01:38:53 am by KK20
First, you need to know what @configs is.
Spoiler: ShowHide


   # get configuration and initialize data
   @configs = BlizzCFG.rojob_next(@actor.class_id)

which calls back to this

 def self.rojob_next(id)
   case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START RO Job-Connection Database
#  
#   Here you can define job change trees. When you have one job active you can
#   change to any other job that is defined here. It is possible to define
#   recursive trees where a class can be changed back as well without problems.
#   Use following template to set up your configuration:
#
#     when ID then return [[MIN_LEVEL1, NEW_ID1], [MIN_LEVEL2, NEW_ID2], ...]
#
#   ID        - the current class ID
#   MIN_LEVEL - minimum level required to be allowed to change
#   NEW_ID    - the ID of the new class
#
#   You can add as many next classes as you want, separate them with commas.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
   when 1 then return [[1, 2], [15, 3]]
   when 2 then return [[10, 1], [15, 3], [1, 4], [1, 5], [1, 6]]
   when 3 then return [[1, 2], [6, 7]]
   when 4 then return [[1, 2]]
   when 5 then return [[1, 2], [8, 6], [10, 8]]
   when 6 then return [[1, 2], [11, 3]]
   when 7 then return [[1, 2], [5, 1], [5, 4]]
   when 8 then return [[1, 2], [5, 7]]

Using Basil (Actor ID 2) as our example, we see how the class data will be drawn. Class ID 1 (Fighter) requires a level of 1, Class ID 3 (Warrior) requires a level of 15, etc.

Thus, @configs will hold the 2D-Array: [[10, 1], [15, 3], [1, 4], [1, 5], [1, 6]]



@configs.each{|c| will iterate each and every element within that array, like in a loop. commands.push will hold the results of each iteration.
Spoiler: ShowHide

The first pass will turn c into [10, 1]. So, theoretically, it'd look like this

commands.push([$data_classes[1].name,
         "(#{BlizzCFG::Lv} #{10})"])

$data_classes[1] is the Fighter class. We want this class's name, so we call the method name.
The second part is fancy string manipulation. #{BlizzCFG::Lv} calls upon this part in the script:

module BlizzCFG

 # All the configuration stuff in between...

 YesNo = ['Yes', 'No']
 AreYouSure = 'Are you sure?'
 Current = 'Current'
 JobPoints = 'Job Points'
 JobLevel = 'Job Level'
 JobEXP = 'Job EXP'
 EXP = 'EXP'
 Next = 'next'
 EmptyEXP = '------'
 None = 'None'
 Lv = 'Lv'                   #<=============== This one right here
 SkillLevel = 'Skill Level'
 MaximumLevel = 'Maximum Level'
 Cost = 'Cost'
 Power = 'Power'
 ClassCommands = ['Select', 'Next', 'Previous', 'Exit']
 ChangeClass = 'Change Class?'
 SkillCommands = ['Learn new Skill', 'Improve Skill', 'Next', 'Previous', 'Exit']
 LearnSkill = 'Learn Skill?'
 ImproveSkill = 'Improve Skill?'

end

#{10} is the same as saying 10.to_s.
This is the result.

commands.push(["Fighter",
         "(Lv 10)"])

That result (which is an array) will be added into commands (also an array). We then move onto the next iteration: [15, 3]

In the end, commands will look like this:

print commands
#Output: [["Fighter", "(Lv 10)"], ["Warrior", "(Lv 15)"], ["Thief", "(Lv 1)"], ["Hunter", "(Lv 1)"], ["Gunner", "(Lv 1)"]]



Lastly, commands is passed into another class
Spoiler: ShowHide


@class_window = Window_Class.new(224, commands)

where the actual drawing of the classes and levels takes place

class Window_Class < Window_Command
 
 #----------------------------------------------------------------------------
 # draw_item
 #  i     - index
 #  color - font color
 #  Changed to draw class/job and level requirement.
 #----------------------------------------------------------------------------
 def draw_item(i, color)
   self.contents.font.color = color
   rect = Rect.new(4, 32 * i, self.contents.width - 8, 32)
   self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
   self.contents.draw_text(rect, @commands[i][0])      #<==== Draws class name
   self.contents.draw_text(rect, @commands[i][1], 2)   #<==== Draws (Lv X)
 end
 
end


Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Kiwa

First i need to complement you KK20.

You made this really easy to follow. I didn't realize what i was looking to do threaded thru so many things.
I was breathing heavily and licking windows till you pointed out some of the stuff here. (perhaps i shouldn't start with such a large script to change lol)

Thank you sooooo much for helping always ...and investing the time into research and creating this guide for me.
you deserve a trophy.

now on to the topic at had lol.


so to do what im looking to do...the best way would be to make my own configs.each{|c| type module or something and

connect it to

"(#{BlizzCFG::Lv} #{c[0]})"])}


and place my array in c[0]?

KK20


@configs.each{|c| commands.push([$data_classes[c[1]].name,
          "(#{BlizzCFG::Lv} #{@actor.job_level(c[1])})"])}

This should get you the class name and current class level for every class this actor can switch between.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Kiwa

Hey KK20 thanks again!

I tried that code and it works wonderfully.
I tried the exact same thing at one point and it failed.. i must have miss typed something. i didn't do it cuz i knew it would work tho.. it was kinda like.. "UHH...how bout this!? rofl.."

Thanks for teaching me and fixing it for me :D