Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Weapon Ranks

Hey guys, I need a script that displays the rank of which a character has with his weapon. Allow me to explain, with apologies in advance for any confusion. In my game, each character has an initial rank with each class of weapon, which I want randomized. As well as an actual name, each rank is associated with a number from 0.00 to 100.00, which increases as the character levels up. Here are the names of each rank, followed by the numbers that determine that rank...

00.00-04.99 = Unfimiliar
05.00-09.99 = Fimiliarizing
10.00-14.99 = Underused
15.00-19.99 = Unfavoured
20.00-24.99 = Using
25.00-29.99 = Basic
30.00-34.99 = Training
35.00-39.99 = Rookie
40.00-44.99 = Improving
45.00-49.99 = Favouring
50.00-54.99 = Proficent
55.00-59.99 = Effective
60.00-64.99 = Skilled
65.00-69.99 = Favoured
70.00-74.99 = Overused
75.00-79.99 = Specialized
80.00-84.99 = Outstanding
85.00-89.99 = Veteran
90.00-94.99 = Elite
95.00-99.99 = Mastered
100.00        = Ultimate

Below is the rank growth rate, ie the number that class ranks increase by per level up. The number on the right indicates the growth rate of the rank for the class of weapon the character is equipped with when he/she levels up, whereas the number on the left indicates the growth rate of the ranks for the other classes. For example: Alexus has just defeated a monster with a Mythril Sword, causing him to level up. His Sword rank is Elite, his Spear rank is Rookie, his Axe rank is Proficent, his Knife rank is Favoured, his Bow rank is Underused, his Gun rank is Unfimiliar, his Mace rank is Basic and his Rod rank is Using. Alexus's Gun rank would go up by 4.20, Bow rank up by 3.60, Rod rank by 3.00, Mace rank by 2.70, Spear rank by 2.22, Axe rank by 1.50 and Knife rank by 0.96. His Sword rank would usually go up by 0.24, but since he was equipped with a Mythril Sword, which is obviously a sword, at the time, the Sword rank goes up by 0.30

4.20/5.25 - Unfimiliar
3.90/4.87 - Fimiliarizing
3.60/4.50 - Underused
3.30/4.12 - Unfavoured
3.00/3.75 - Using
2.70/3.37 - Basic
2.46/3.07 - Training
2.22/2.77 - Rookie
1.98/2.47 - Improving
1.74/2.17 - Favoring
1.50/1.87 - Proficent
1.32/1.65 - Effective
1.14/1.42 - Skilled
0.96/1.20 - Favoured
0.78/0.97 - Overused
0.60/0.75 - Specialized
0.48/0.60 - Outstanding
0.36/0.45 - Veteran
0.24/0.30 - Elite
0.12/0.15 - Mastered
0.00/0.00 - Ultimate

And finally (for now anyway), I want the ranks of each class for each character to be displayable in the menu, even if it is in a seperate option. Here's how I want them to be displayed (not to scale!!), using Alexus as an example like last time. And no, I don't want a bar in between the class and the rank number, just to point that out.

Alexus

Sword                  90.00    Elite
Spear                  35.00    Rookie
Axe                    50.00    Proficent
Knife                  65.00    Favoured
Bow                    10.00    Underused
Gun                    00.00    Unfimiliar
Mace                  25.00    Basic
Rod                    20.00    Using

I will highlight any keywords the next time round if necessary
 
I think I have an idea on how this is going to have to work.

I'll have to make 8 variables (one for each class) and assign each variable with a random number from 0 to 10000, just because variables don't take decimals. Then I'll initialize 8 more variables to 1, and increment them every time the last ones reach/exceed a multiple of 500.

For example; say that my 1st variable is 'SwNm' and and my 9th variable is 'SwRn'

'SwRn' = 1
If 'SwNm' >= 500 then 'SwRn' = 2
If 'SwNm' >= 1000 then 'SwRn' = 3
If 'SwNm' >= 1500 then 'SwRn' = 4
If 'SwNm' >= 2000 then 'SwRn' = 5
And so on and so forth...

That's the rank assignment done for now. Now for the growth rate.

I'll need a script here that activates when one of the actors (regardless of who it is) levels up; and does the following when activated

Check the rank for each class for that actor
Check what class the weapon he/she is wielding is in (I'm guessing I'll need to create an element for each weapon)
Add the appropriate numbers to each class
Increment the rank WHEN the number reaches or exceeds a multiple of 500

For example: Alexus defeats an enemy with the Mythril Sword and levels up. His Sword rank is Elite, his Spear rank is Rookie, his Axe rank is Proficent, his Knife rank is Favoured, his Bow rank is Underused, his Gun rank is Unfimiliar, his Mace rank is Basic and his Rod rank is Using. In this example, his Sword and Axe ranks will improve, but the other classes' ranks won't.

What is 'SwRn' equal to? 19
Is Alexus wielding a sword? Yes
Increase 'SwNm' by 30
Is 'SwNm' >= 9500? Yes
Increase 'SwRn' by 1

What is 'SpRn' equal to? 8
Is Alexus wielding a spear? No
Increase 'SpNm' by 222
Is 'SpNm' >= 4000? No
Do not increase 'SpRn'

What is 'AxRn' equal to? 11
Is Alexus wielding a sword? No
Increase 'AxNm' by 150
Is 'AxNm' >= 5500? Yes
Increase 'AxRn' by 1

Etcetera, etcetera...

And finally the display. This maybe the most confusing, so forgive me if I'm not very clear...

I need a script that displays the ranks of each class of weapon somewhere in the menu, and if you manage to make the script, I need you to tell me where the ranks will show up. I want each rank to have its own line (or line fragment; either will be fine)

To the left I want either the name or an icon of the class

In the centre I want the name of the rank of that class. Rank names will be assigned by each of the 8 variables, so I'll use one of them as an example

If 'GnRn' = 1 then display "Unfimiliar" in Gun rank
If 'GnRn' = 2 then display "Fimiliarizing" in Gun rank
If 'GnRn' = 3 then display "Underused" in Gun rank
If 'GnRn' = 4 then display "Unfavoured" in Gun rank
If 'GnRn' = 5 then display "Using" in Gun rank
... you get the idea

And to the right I want the number of the appropriate variable (one of the first eight), divided by 100 and given like so: 88.88 < That's just an example BTW

This should be easier (I'm hoping for much easier). As always, I'll be waiting
 
I have found something sorta like this. But you don't get to view your levels. You can customize how much more damage per level, the max level, make your own weapon rank types, and this also works with skills. I am not too good with this script and it is old. I only know of one error, it sometimes happens. It's when in battle it cannot read your weapon rank/mastery level. All customization instructions are inside the topic. Here is a link to the topic: http://www.rmxp.org/forums/index.php?topic=9637.0. Please give credits to the maker of the script (this person is also the poster). Also I am not sure but the error I told you about might be because I have a custom battle system. Hope it helps  :thumb:.
 
just put it above main ^_^
if you wanna see the places I edited and compare it to the onesof the default script, here you go:
Code:
#==============================================================================
# Individual Character Development - Weapon Master by Fomar0153
#==============================================================================
class Game_Party

  attr_accessor :icd_weapon_masters
  attr_accessor :icd_weapon_type
  attr_accessor :icd_weapon_type_skills
  attr_accessor :icd_weapon_max_level
  attr_accessor :icd_weapon_damage_bonus
  
  alias fomar_icd_weapon_master_initialize initialize
  def initialize
    fomar_icd_weapon_master_initialize
# EDITED
    @icd_weapon_masters = [1, 2, 3, 4]
    @icd_weapon_type = [
    {'name'=>'Pick', 'weapons'=>[1, 2, 3, 4,]},
    {'name'=>'Sword', 'weapons'=>[5, 6, 7, 8]},
    {'name'=>'Spear', 'weapons'=>[9, 10, 11, 12]},
    {'name'=>'Axe', 'weapons'=>[13, 14, 15, 16]},
    {'name'=>'Dagger', 'weapons'=>[17, 18, 19, 20]},
    {'name'=>'Bow', 'weapons'=>[21, 22, 23, 24]},
    {'name'=>'Mace', 'weapons'=>[25, 26, 27, 28]},
    {'name'=>'Staff', 'weapons'=>[29, 30, 31, 32]},
    {'name'=>'Boomerang', 'weapons'=>[33]},
    {'name'=>'Fishing Pole', 'weapons'=>[34, 35, 36, 37]}
    ]
    @icd_weapon_type_skills = {'Sword5'=>3, 'Sword10'=>4, 'Sword15'=>5, 'Sword20'=>6,
    'Spear5'=>7, 'Spear10'=>8, 'Spear15'=>9, 'Spear20'=>10, 'Axe5'=>11, 'Axe10'=>12,
    'Axe15'=>13, 'Axe20'=>14, 'Dagger5'=>15, 'Dagger10'=>16, 'Dagger15'=>17, 'Dagger20'=>18,
    'Bow5'=>19, 'Bow10'=>20, 'Bow15'=>21, 'Bow20'=>22, 'Mace5'=>23, 'Mace10'=>24,
    'Mace15'=>25, 'Mace20'=>26, 'Staff5'=>27, 'Staff10'=>28, 'Staff15'=>29, 'Staff20'=>30,
    'Boomerang1'=>31}
    @icd_weapon_max_level = 20
    @icd_weapon_damage_bonus = 10
# /EDITED
    
  end
end

class Game_Actor < Game_Battler
  
  alias fomar_icd_weapon_master_setup setup
  def setup(actor_id)
    fomar_icd_weapon_master_setup(actor_id)
    @icd_weapon_type_levels = {}
    
    for icd_type in $game_party.icd_weapon_type
      @icd_weapon_type_levels[icd_type['name']] = 0
    end
    
  end
  
  def damage_multiplier
    for icd_type in $game_party.icd_weapon_type
      if icd_type['weapons'].include?(@weapon_id)
        return ((@icd_weapon_type_levels[icd_type['name']])/100)  * $game_party.icd_weapon_damage_bonus
      end
    end
    return 0
  end
  
  def improve_weapon_use
    for icd_type in $game_party.icd_weapon_type
      if icd_type['weapons'].include?(@weapon_id)
        unless @icd_weapon_type_levels[icd_type['name']] == 100 * $game_party.icd_weapon_max_level
          @icd_weapon_type_levels[icd_type['name']] += 1
          if (@icd_weapon_type_levels[icd_type['name']] / 100) == (@icd_weapon_type_levels[icd_type['name']].to_f / 100.00)
            self.learn_skill($game_party.icd_weapon_type_skills[icd_type['name'] + (@icd_weapon_type_levels[icd_type['name']] / 100).to_s])
          end
        end
      end
    end
  end  
end

class Game_Enemy < Game_Battler
  
  def attack_effect(attacker)
    if $game_party.icd_weapon_masters.include?(attacker.id)
      attacker.improve_weapon_use
      k = super
      x = self.damage
      self.damage *= (100 + attacker.damage_multiplier)
      self.damage /= 100
      self.hp -= (self.damage - x)
      return k
    else
      return super
    end
  end  
end
I put a # EDITED and # /EDITED to enclose the part I edited, hope that helps! :thumb:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top