Help - Search - Members - Calendar
Full Version: Leveling Equips (weapons & armors that level up)
RPG RPG Revolution Forums > Scripting > Script Submissions > RGSS2-Submissions
Pages: 1, 2
LordHeinrich
Equip Levels

Version 0.6.03
Author Lordheinrich
Release Date 09/10/2010
Last Update 09/18/2010

Exclusive Script at RPG RPG Revolution


Introduction
This script makes it so that equipment (weapons and armors) can gain levels. Equips are basically set up like actors in that they gain experience in battle, level up, gain stat bonuses, etc... This is a rather large script and is still incomplete, however complete enough post for feedback, feature requests, and such. I don't know if I can test all features of the script myself, do please post report any bugs.

Features
- Experience System
- Leveling System with stat bonuses
- Script calls and note tags for customization
- Equip Status Scene accessible from Scene Item
- All Equips are unique, i.e., only the ones equipped gained experience, ex: you can have a lvl 1 short sword, a lvl 2, etc...
- Ability to randomize Experience earned
- Ability to randomize Experience needed for Equips to level up
- Progress Bars for EXP and Levels
- Equip Skill System based on EXP gained, Battles and Enemies Killed
** Skills learned either by Weapon EXP, Armor EXP, Total Battles, Enemies Killed or any combination of the FOUR
- Color Coded Equips
** Different colors based on whether level is max, cannot level, or level disabled

-----------------------------------------------
Planned:
- Equip Skill System (in progress)
** Based on either level or EXP (maybe stats) << Will probably scrap level as that method is broken, same for stats...
** Based on Battles and Kills (completed)
- Percent Based Equips
** Equips can raise stats by set number, percent or both
- Equip Price based on Level/Stats
-----------------------------------------------
Please suggest additional features

Script

Link for v 0.6.27 Script

RPG Armor Fix
CODE
module RPG
  class Armor < BaseItem
    #------------------------------------------------------------------------
    # gain experience
    #------------------------------------------------------------------------
    def gain_exp(amount)
      return if $BTEST
      return if @no_level
      return unless @can_level or LEVEL_ARMORS
      return if @level >= @max_level
      mx = (@exp_list[@max_level] - 1) - @exp
      amount = amount >= mx ? [mx - 1, 0].max : amount
      @exp += amount
      while @exp >= @exp_list[@level] and @exp_list[@level] > 0
        level_up
      end
    end
    #------------------------------------------------------------------------
    # level up
    #------------------------------------------------------------------------
    def level_up
      return if @no_level
      return unless @can_level or LEVEL_ARMORS
      if @level >= @max_level
      else
        @level = [@level + 1, @max_level].min
        if $game_switches[LEVEL_UP_SWITCH]
          @exp += @exp_list[@level-1] - @exp_list[@level-2]
        end
        $game_switches[LEVEL_UP_SWITCH] = false
        @maxhp  = [@maxhp  + @hp_gain,  @max_hp].min  unless @max_hp == @maxhp
        @maxmp  = [@maxmp  + @mp_gain,  @max_mp].min  unless @max_mp == @maxmp
        @atk = [@atk + @atk_gain, @max_atk].min unless @max_atk == @atk
        @def = [@def + @def_gain, @max_def].min unless @max_def == @def
        @spi = [@spi + @spi_gain, @max_spi].min unless @max_spi == @spi
        @agi = [@agi + @agi_gain, @max_agi].min unless @max_agi == @agi
        @eva = [@eva + @eva_gain, @max_eva].min unless @max_eva == @eva
        if $imported["DEX Stat"]
          @dex = [@dex + @dex_gain, @max_dex].min unless @max_dex == @dex
        end
        if $imported["RES Stat"]
          @res = [@res + @spi_gain, @max_res].min unless @max_res == @res
        end
      end
    end
  end
end


Customization
READ THE INSTRUCTIONS!!!
- Global Customization within script
- Per item customization with note tags
- Script calls in events can alter some attributes of equips
- New stats for Weapons
** HP, MP, CRI
- New stats for Armors
** HP, MP

Compatibility
- Compatible with Default System
- Compatible with YEM New Battle Stats
- New command in YEM Item Overhaul to access Equip Scene
- YEM Equipment Overhaul patch within script
** Fix for purge_equipment issue now included
- Likely needs patches to work with New equip Scenes
- Must be placed below YEM Item Overhaul and YEM Equip Overhaul, if used
** Rewrites portions of those YEM Scripts
- Place above YEM Item Overhaul Patch if used
** The YEM Item Overhaul Patch rewrites a portion of this script

Screenshot
15 Zipped Screen Shots

EXP Progress

Enemy Setup


Installation
- below materials/above main
- below YEM Equipment Overhaul & Item Overhaul if used
- above YEM Item Overhaul Mod if used


Terms and Conditions
This is a beta script. Please do not use in Games meant for distribution as there may be bugs.

Credits
None while in Beta Mode
Hoopsnake Games
o/ Did you ever know that you're my hero?
You're everything I would like to be. o/
This could be an enormous help. I'll let you know if I see any bugs, but this could truly be the greatest subconcious help that anyone has EVER done for me.
LordHeinrich
Got to testing EXP fluctuation and found a bug. Also, tested with YEM Enemy Levels. I will be updating the whole script shortly to v 0.6.03, but here's a patch for those that downloaded the script already.

Patch to v0.6.03
CODE
class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # * Get Weapon Experience
  #--------------------------------------------------------------------------
  def wep_exp
    dexp = GNM::EQUIP_LEVEL::DEFAULT_WEAPON_EXP
    p = (GNM::EQUIP_LEVEL::PERCENT >= 6 ? 6 : GNM::EQUIP_LEVEL::PERCENT)
    fluctuation = GNM::EQUIP_LEVEL::W_FLUCTUATION
    dexp = (dexp*(1.0+p/100.0)**(@level-1.0)).round if $imported["EnemyLevels"]
    lower = Integer(dexp * (100 - fluctuation) / 100)
    upper = Integer(dexp * (100 + fluctuation) / 100)
    dexp = lower + rand(upper - lower + 1)
    unless enemy.weapon_exp.nil?
      v = enemy.weapon_exp
      v = (v * (1.0 + p/100.0)**@level-1.0).round if $imported["EnemyLevels"]
      lower = Integer(v * (100 - fluctuation) / 100)
      upper = Integer(v * (100 + fluctuation) / 100)
      v = lower + rand(upper - lower + 1)
    end
    return enemy.weapon_exp.nil? ? dexp : v
  end
  #--------------------------------------------------------------------------
  # * Get Armor Experience
  #--------------------------------------------------------------------------
  def arm_exp
    dexp = GNM::EQUIP_LEVEL::DEFAULT_ARMOR_EXP
    fluctuation = GNM::EQUIP_LEVEL::A_FLUCTUATION.to_f
    p = (GNM::EQUIP_LEVEL::PERCENT >= 6 ? 6 : GNM::EQUIP_LEVEL::PERCENT)
    dexp = (dexp*(1.0+p/100.0)**(@level-1.0)).round if $imported["EnemyLevels"]
    lower = Integer(dexp * (100 - fluctuation) / 100)
    upper = Integer(dexp * (100 + fluctuation) / 100)
    dexp = lower + rand(upper - lower + 1)
    unless enemy.armor_exp.nil?
      v = enemy.armor_exp
      v = (v * (1.0 + p/100.0)**@level-1.0).round if $imported["EnemyLevels"]
      lower = Integer(v * (100 - fluctuation) / 100)
      upper = Integer(v * (100 + fluctuation) / 100)
      v = lower + rand(upper - lower + 1)
    end
    return enemy.armor_exp.nil? ? dexp : v
  end
end # class Game_Enemy


EDIT: I updated the original script to 0.6.03. The new link DOES NOT need the patch, however, anyone who downloaded prior to the patch, will either need to download the new version or install the patch just below the old one.
Feldschlacht IV
I honestly think this is a great idea. Looking forward to the end result.
Lockheart
Trying this script out, I notice that it removes all default equipped items from a character, is this normal? Cause it sorta messes up my game and likely others by doing this.
The Wizard 007
Good idea and the interface looks good but I can't seem to get my stats to increase when I level a weapon up, I read the instructions and followed them.
LordHeinrich
One of your scripts must be rewriting something in this script or changing the way that stats are made. Please give me more information about your game (which scripts you are using). Also, maybe sending me scripts.rvdata from your game would help. I would prefer fixing this issue before adding a new feature.

Thank you for pointing this out and I will try to make this compatible with whatever scripts are causing conflicts.
systemsfailed
Download seems to be broken sad.gif
LordHeinrich
Maybe it was some server issue or something cause it's working for me. Try it again (maybe refresh the page a couple times). If it doesn't work, I'll post a new link.
LordHeinrich
I just wanted to post an update. I started working on the equip skill portion of this script today. I completed the skeleton of the EXP portion, so I will start refining it within the next couple of days. I will try to release a patch once I feel the EXP portion is ready for testing, however if it gets too complicated, I'll just update the script.
LordHeinrich
I made an update and also included a patch. The patch is ONLY for v0.6.03 and is NOT required for the new release 0.6.17.

The newest update features an equip skill system based on Weapon/Armor EXP. This does not mean exactly what you may think. Enemies are what give Weapon or Armor EXP. When leveling equips, a Weapon requires Weapon EXP and an Armor requires Armor EXP, however, for skills, it does not matter. So a skill can require Weapon EXP, Armor EXP or both. You can decide whatever you want.

This system can work for all equips regardless if they can level up or not, however, I made an option to skip ones that cannot level.

I have not done anything in terms of display other than a message saying a skill was mastered. Ultimately, I will include progress bars and some type of information on the Equips. I will wait however until I finish the core of the Equip Skill System.
#----------------------------
Bug report: I noticed upon testing this system that the equip level system is not compatible with YEM Equip Overhaul's Extra armor slots. I will look into that before proceeding with the next feature.
LordHeinrich
Sorry for bumping, but I found a bug. I didn't realize that I had my Sell Item Overhaul Script installed so it always tested fine. The bug was if YEM Item Overhaul or Sell Item Overhaul was not installed, it would crash when trying to draw the Equip Data in the Equip Level Scene. This is corrected in v0.6.18. I also included a new patch for those that downloaded v0.6.03. Do not use the patch for v0.6.17 because that only adds the equip feature.

update to the bug report in the previous post: The extra armor slot bug will hopefully be fixed in the next update/patch. I got them to work, however I have not done any testing. If after testing the fix works, I will post the patch.

@lockheart,

post got a little long, so I spoilered
Sorry, but I missed your post before. I just noticed that is happening with YEM Equipment Overhaul. I will have to look into it, however at the moment, there is not full compatibility with YEM Equipment Overhaul, just enough compatibility where it will not crash with Yanfly Engine Melody.

If you are using a different Equipment Scene Let me know.

I think in the end, I will have to write my own Item Scene and Equip Scene, cause usually it is a bit of a pain to get some of the scripts to be fully compatible, but I will try my best to make it fully compatible with YEM Equipment Overhaul.

Thanks for pointing out the bug!!

EDIT: It looks like it has to do with the "purge_unequippable" method. That command kicks in before the setup of this script, therefore it will unequip all equips. There isn't a universal solution to this without making the script installation complicated. For the initial setup, you can probably correct it editing YEM Equipment Overhaul:

CODE
class Game_Actor < Game_Battler
  
  #--------------------------------------------------------------------------
  # alias method: setup
  #--------------------------------------------------------------------------
  alias setup_eo setup unless $@
  def setup(actor_id)
    setup_eo(actor_id)
    @extra_armor_id = []
    @locked_equips = []
    @equip_type = nil
    @bonus_apt = nil
    create_aptitude_bonus
  #  purge_unequippable  ## This line was commented out.
  end


This will make it so that equips are not lost when the game starts. However, if armor slots are going to be altered by a script call, potentially every armor equipped will be lost! This is part of YEM Equipment Overhaul and I think it has to do with the way that you set up the Rules for the armor slots and this happens regardless of using the equip level script.

An alternative to editing any scripts would be to just have the starting equips in the party inventory, but this will not work for every game.
Kaimi
I like the script, but where are any screenshots?
LordHeinrich
@kaimi,

I added a zip archive with 15 screen shots. I didn't feel like uploading one by one to imageshack, so for now this is the only way to get them. The archive includes the following:

Scene Item - accessing the equip level scene
Equip LVL Scene - View equipped equips
Equip LVL Scene - Weapons that can level
Equip LVL Scene - Armors that can level
Gain EXP event
Example of Setting up event
Disable Level Event
Disabled Level in Equip Scene
EXP Progress
Level Progress
EXP Skill - Setup up Equip
EXP Skill - Setup skill
EXP Skill - Mastered Skill
Setting up Enemies to give EXP
Variable EXP earned from enemies

It should be enough to get a nice feel of what the script does and how to set up some of the events.
Dyrnwyn
OK, this script is awesome and the answer for something I've been trying to make myself for a long time.

I just have one question:

It looks like you can call how much of a stat increase a piece of equipment will get when leveling. At least, it seems to be mentioned in this section of the directions:

QUOTE
# ---------
# STAT "formulas". These give your equips new stats. They are HP, MP & CRI.
# Also, it allows you to modify how EVA and HIT are evaluated. Since these are
# formulas, they can be numbers, or expressions. Valid variables are:
# @level, @max_level, @base_exp, @stat ... basically all attributes that are
# within the class. You can make the formula as simple or complicated as you
# like.
# ---------


What I'm after is making a staff, for example, that will gain 1 agility and 3 spirit per level, then have a sword that does 2 str and 2 def and a shield that does 1 spi and 3 def per level. See what I'm after?

So, can you give some examples of how to make those formulas work? I assume it has to do with tagging the descriptions in the item info, but I need just a bit more info so I can do it properly.

Beyond that, awesome script!!!
LordHeinrich
New version 0.6.20 uploaded with YEM Compatibility Patch, additional features and some bug fixes. No separate patch will be available for older version because it is a little tricky to pull the updates out of the full script.

EDIT: New features expand the Skill Equip features. Now, you can also learn skills from total battles or enemies killed. I still haven't modified any of the windows, so no progress bars and such for that.

YEM Equipment Overhaul expanded. Extra Armor Slots now work, with limitations. Anything in the extra armor slots will not be unique! This means that once an item gains experience in one of the new item slots, all copies of that item will gain experience. So if you have 3 Boots and one is equipped in your extra footwear slot, all 3 boots will gain EXP/Levels/etc... Not sure if I will be able to fix this.

@Dyrnwyn,

In order to alter how much equips can gain per level, you need to use the note tags.

so for example, in the staff note box you can do something like:

<agi gain: 1>
<spi gain: 3>

They need not be numbers. They can also be equations like:

<agi gain: @level + 3>
----------------------------
Some useful info:

For Weapons, they will gain 1 atk per level default without doing anything to the note boxes.

For Armors, they will gain 1 def per level default without doing anything to the note boxes.
Dyrnwyn
Sweeeeet! That is amazingly simple! You should make sure to include it in your instructions on the script. I hunted for ages to find the proper reference in it, figuring you already had it in there.

This script is absolutely great so far! Does everything you advertise and warns about potential issues you're already working on.

I especially love that it is compatible with Yanfly's Battle Engine Melody! Really nice touch there that most don't do. smile.gif
Dyrnwyn
EDIT: Deleted prior text.

It's not a bug with the party system like I thought. It's erroring out when I try to level up a shield on one of my characters. All I have for the stats on the shield right now are:
<can level>
<max item level: 255>
<def gain: 3>
<wep exp: 1>

EDIT 2: Tried it with other armors and none of them are working. I'm getting a division by 0 error at line 2338 of your script.

QUOTE
gw = [[gb * (@item.now_exp) / (@item.next_exp), width].min, 0].max
LordHeinrich
EDIT: How did you set up the max levels. Did you only use note tags, or did you also set something in the configuration of the script?

I'll look into this promptly. There is a chance I goofed on one of those two methods for armors tongue.gif

One thing though, I capped Equip levels at level 20, so <max item level: 255> will still cap the level at 20.

Edit II: I've duplicated the error. The reason is because you went past the allowed level max and I noticed that I didn't put a safety measure just in case that happened when using only configuration. It's a bug for now, but avoidable as long as MAX_WEAPONS or MAX_ARMORS is 20 or lower.

I'll change level caps to 1000 in the next release. Only thing is that I am not changing the amount characters can level up to, so I may include that in the script as well.
Dyrnwyn
Awesome. thanks for the fast reply. I think i actually know how to adjust the caps, but I'll let you do it proper so I don't blow up my game, again. smile.gif
Swish
Well it doesn't work properly... I made accessory called cure orb, and written in it <equip skill 6>, then written in 006: Cure <requires battles: 3> and after 3 battles my char didn't learn skill... sad.gif what should I do?
LordHeinrich
Give me a moment to test it out some more. While I do this, please let me know if you are using an extra armor (YEM Equipment Overhaul) slot or a default armor slot.
Swish
not using extra slot atm
LordHeinrich
I tested it with the default system and it works fine, however, it doesn't work with Yanfly Engine Melody. It might be YEM Skill Overhaul that is causing a conflict. This one will take a bit of time to look into. I will delay the next release until I figure something out for this. Thanks for pointing out the issue

EDIT : I'm an idiot tongue.gif I was fooled by my own feature!! I didn't explain it to you, but one feature of the equip skill system is that you can restrict it to only equips that can level up. This is set at the beginning of the configuration by setting RESTRICT_EQUIPS = true/false. By default, it is set to true meaning that only equipment that can level up will teach skills. So, you have to set the feature according to how you are making your game. I wasn't getting it to work with YEM, because Leather Shield wasn't set to level up, but it was in the other tongue.gif It works as it should as long as everything is setup correctly.

I'll alter Scene Battle Slightly, because Victory Aftermath may or may not cause issues.

Next update should be up in a few minutes.
LordHeinrich
New version 0.6.27 uploaded. I removed the level cap on equips, so now you can set them to whatever you want (within reason). In order to do this, you must first set the absolute cap using the configuration LEVEL_CAP_nnn. Whatever is set here, is the absolute highest level that equips can level to. This is the only way to make it so the game will not crash when you alter the level caps. There is a note about setting levels in the instructions, but basically higher levels = more CPU cycles.

@Swish,
Just in case you didn't read the edit above, the Equip Skill system is set to work only for equips that can level by default. If you plan to use it on all equips, then you must set RESTRICT_EQUIPS = false.

I also added customization for different colors based on the equip status. The different status are:

no_level - This means an equip cannot level and never leveled up
disabled - This means an equip was able to level up and reached minimum level 2, but it can no longer level (because of a disable_level script call)
can_level - This means an equip can still level and is not at max level
max_level - This means an equip is at maximum level.

I also made some minor bug fixes, although I do not remember what as they were actually from an unreleased v0.6.21. I do remember correcting the Two-Handed equip bug, where you can equip a Two handed weapon with a shield.

I am not going to add the Skill Require Equip Level and Require Equip Stat feature to the script. I can't get them to work correctly and it is better if I move on to finishing up the system by creating item windows and such.

The script still has a long way to go before leaving Beta status, but it may be good enough to start using in Demo Projects. Because of the size of the script, it is getting hard to catch all the bugs, so please report any!!
Dyrnwyn
Thanks, LH! I'll load it up in AoS and give it a shot. I think this is going to be exactly what I was hoping for and enable me to cut my database from about 750 weapons / armor down to about 125. HUGE HELP! smile.gif

Double post: Megaupload hates me. File temporarily unavailable. sad.gif
Swish
Thank you LordHeinrich! It works great!. Now I just await when you add compatibility to menu so I can see battle requirements for skills.
LordHeinrich
@Dyrnwyn,

The link should work. You could be trying at a time when the servers from your country are busy. Try refreshing when pages don't work. If you can't get it, I can re-upload and post a second link or something.
-------------------
I made a very small progress on the script, not enough to warrant a new release, but added the ability to view what skills get taught by equips. This is for the item scene, so no progress bars in this one. I'll have progress bars and such in the equip scene. This is also compatible with my Sell Item Overhaul script and will display the equip_skill info in the additional window. The patch is small enough to spoiler, so no download link:

Equip Info Patch
CODE
module GNM
  module DISPLAY_EQ_LEVELS  
    hash1 = EQUIP_PROPERTIES # do not edit
    
    # displays what to display when equipping skills
    hash2 ={:eq_skill   => "Teaches Skills"}
    
    hash1.merge!(hash2) # do not edit
    EQUIP_PROPERTIES = hash1 # do not edit
  end
end

#==============================================================================
# class Window_EquipData
#==============================================================================
class Window_EquipData < Window_Base
  #--------------------------------------------------------------------------
  # draw_weapon_properties
  #--------------------------------------------------------------------------
  alias_method :hein_patch_wp_prop, :draw_weapon_properties unless $@
  def draw_weapon_properties(dy)
    dy = hein_patch_wp_prop(dy)
    draw_equip_skill(dy)
    return dy
  end
  #--------------------------------------------------------------------------
  # draw_armor_properties
  #--------------------------------------------------------------------------
  alias_method :hein_patch_ar_prop, :draw_armor_properties unless $@
  def draw_armor_properties(dy)
    hein_patch_ar_prop(dy)
    draw_equip_skill(dy)
    return dy
  end
  #--------------------------------------------------------------------------
  # draw_equip_skills
  #--------------------------------------------------------------------------
  def draw_equip_skill(dy)
    return dy if @item.equip_skills.nil? or @item.equip_skills == []
    dx = 0; @data = []; text = @hash[:eq_skill]
    self.contents.font.color = system_color
    self.contents.draw_text(dx, dy, contents.width, WLH, text, 1)
    dy += WLH
    skills = @item.equip_skills
    skills.each { |i|
    @data << $data_skills[i] }
    for skill in @data
      if @data.index(skill).to_i%2 == 0
        dx = 4
      else
        dx = contents.width/2 + 4; dy -= WLH
      end
      n = skill.name
      self.contents.font.color = normal_color
      self.contents.draw_text(dx, dy, contents.width/2 - 8, WLH, n, 0)
      dy += WLH
    end
    return dy
  end
end
if $imported["SellItemOverhaul" && "EquipLevels"]
  #==========================================================================
  # ** Window_CustomStatus
  #==========================================================================
  class Window_CustomStatus < Window_Base
    alias_method :hein_patch_sio_draw_info, :draw_information
    def draw_information(dy)
      draw_equip_skill(dy)
      hein_patch_sio_draw_info(dy)
      return dy
    end
    #--------------------------------------------------------------------------
    # draw_equip_skills
    #--------------------------------------------------------------------------
    def draw_equip_skill(dy)
      return dy if @item.equip_skills.nil? or @item.equip_skills == []
      dx = 0; @data = []; cw = contents.width
      skills = @item.equip_skills
      skills.each { |i|
      @data << $data_skills[i] }
      for skill in @data
        n = skill.name; t = "Equips Skill "
        self.contents.font.color = system_color
        self.contents.draw_text(dx, dy, cw*2/5, WLH, t, 0)
        self.contents.font.color = normal_color
        self.contents.draw_text(cw*2/5 + 4, dy, cw*3/5 - 4, WLH, n, 0)
        dy += WLH
      end
      return dy
    end
  end
end
Swish
umm where should i put patch?
Dyrnwyn
Try putting it at the bottom of the existing script. from the looks of it, it adds another scene, so it can go anywhere before/after existing scenes.
LordHeinrich
Right, it goes right below the equip level script. You can either append to the script or make a new one just below. Note, that I made a slight edit because I didn't notice when I posted, but it didn't copy/paste correctly. No code was changed, I just deleted the line that was just "===".

What the patch does is add lines to the display box in the new scene I made for viewing the Level Status. It will look something like:

Teaches Skills
Skill 1 Skill 2
Skill 3 Skill 4
etc...

Don't go to crazy teaching equips too many skills, or it will eat up all the space in the window as it is set for two skills per row.

Also, if using my Sell Item Overhaul Script, it will add those lines to the Information Window. This looks something like:

Information
Teaches Skill 1
Teaches Skill 2
Teaches Skill 3

The good thing about that is that it will show when selling equips that equip skills... if I remember correctly, also when buying equips with the Buy Item add-on.

It also adds a line to the EQUIP_PROPERTIES hash in the configuration of the equip level script to be able to edit what it says when a weapon can equip skills.

The patch is temporary and once the next version is up (when I get to editing the equip scene) it won't be needed.
Dyrnwyn
Heyas, again, LH. I found another bug in the system. I'm not sure if this one will be fixable, but here's what I have:

I have multiple weapons that require a LOT of exp to level. In testing this awesome mod, I got about 1/2 to a level on a high-end item, then needed to take care of something, so I saved the game to resume testing later. When I reloaded the game later, I noticed all the exp was gone from the item. After more checking, I found that every item loses its exp when you save and then resume later. Something you can work with?

And a second small bug:

I know you were designing your script to be fully compatible with the melody battle engine (YAY!!!) I just wanted to let you know that if you swap weapons in battle, as Yanfly's scripts allow, it'll crash out after battle when it tries to award weapon / armor exp. Thanks LH!

EDIT: And one more thing: I'm sometimes getting a nil error with line 1388,
@cri = [@cri + @cri_gain, @max_cri].min unless @max_cri == @cri
no idea how that happened, because I haven't set up any critical factors in my RPG.
LordHeinrich
I will try and look into the first bug because that one is pretty serious. Does this only happen when an equip gains experience, but does not level up? I'll fiddle a bit to try and duplicate the bug first, cause levels are saving fine for me on the YEM set up I have and they show the proper experience.

Edit: I am noticing some odd behavior, with the exp shifting to unequipped weapons. ** I meant equips **

Edit II: Which version of the script are you using? Line 1388 is just "end" in the uploaded one. In the unreleased version that integrates the patch, line 1388 is "return if @no_level". I can't seem to get either of the first two bugs except for the odd behavior I posted in the first edit. You can try this to see if it solves the exp being lost... Not sure if it will do anything (won't mess anything up though), but worth a try:

Scene File
CODE
#==============================================================================
# Scene File
#==============================================================================
class Scene_File < Scene_Base
  #--------------------------------------------------------------------------
  # alias method: Execute Load
  #--------------------------------------------------------------------------
  alias_method :hein_equplvls_scene_file_do_load, :do_load unless $@
  def do_load
    hein_equplvls_scene_file_do_load
    for actor in $game_party.members
      for item in actor.equips
        next if item.nil?
        item.scan
      end
    end
    for item in $game_party.items
      next if item.nil?
      item.scan
    end
  end
end


Also, there is a chance a script is overwriting something in this script or just clashing for some reason.

As for the line 1388 bug, that was due to my laziness and using copy/paste. I always made changes to RPG::Weapon first, tested, and if everything is fine, I then modified RPG::Armor. I normally don't use copy/paste, but once in a while, I get lazy or tired. The error arises because Armor does not have either critical or hit, but does have eva. Use this as a patch for class RPG::Armor. If you want to directly edit the script, I marked the modifications:

RPG Armor Fix
CODE
module RPG
  class Armor < BaseItem
    #------------------------------------------------------------------------
    # gain experience
    #------------------------------------------------------------------------
    def gain_exp(amount)
      return if $BTEST
      return if @no_level
      return unless @can_level or LEVEL_ARMORS # modified from LEVEL_WEAPONS
      return if @level >= @max_level
      mx = (@exp_list[@max_level] - 1) - @exp
      amount = amount >= mx ? [mx - 1, 0].max : amount
      @exp += amount
      while @exp >= @exp_list[@level] and @exp_list[@level] > 0
        level_up
      end
    end
    #------------------------------------------------------------------------
    # level up
    #------------------------------------------------------------------------
    def level_up
      return if @no_level
      return unless @can_level or LEVEL_ARMORS # modified from LEVEL_WEAPONS
      if @level >= @max_level
      else
        @level = [@level + 1, @max_level].min
        if $game_switches[LEVEL_UP_SWITCH]
          @exp += @exp_list[@level-1] - @exp_list[@level-2]
        end
        $game_switches[LEVEL_UP_SWITCH] = false
        @maxhp  = [@maxhp  + @hp_gain,  @max_hp].min  unless @max_hp == @maxhp
        @maxmp  = [@maxmp  + @mp_gain,  @max_mp].min  unless @max_mp == @maxmp
        @atk = [@atk + @atk_gain, @max_atk].min unless @max_atk == @atk
        @def = [@def + @def_gain, @max_def].min unless @max_def == @def
        @spi = [@spi + @spi_gain, @max_spi].min unless @max_spi == @spi
        @agi = [@agi + @agi_gain, @max_agi].min unless @max_agi == @agi
        @eva = [@eva + @eva_gain, @max_eva].min unless @max_eva == @eva # modified added @eva line, deleted @hit & @cri #lines
        if $imported["DEX Stat"]
          @dex = [@dex + @dex_gain, @max_dex].min unless @max_dex == @dex
        end
        if $imported["RES Stat"]
          @res = [@res + @spi_gain, @max_res].min unless @max_res == @res
        end
      end
    end
  end
end
Dyrnwyn
Heyas, LH. Sorry for the slow reply. I was out most of the day.

I did the second patch you listed for the armor fix and it works like a champ. No more crashing. Here's the info on the armor losing exp after the game is turned off and loaded from a save file:

The item is a HP booster that gains HP every level. here is the setup:
<can level>
<max item level: 200>
<maxhp: +10>
<exp: 5>
<hp gain: 5>

And so you can debug, here is a list of my scripts installed:
YEM Core fixes/upgrades
YEM Custom message melody
YEM Equipment Overhaul
YEM Extended Movement
YEM Item Overhaul
YEM Main Menu Melody
YEM Skill Overhaul
YEM Status Menu Melody

YEM Battle Engine Melody 1-5
YEM New Battle Stats
Wereform script (From Yanfly's site)

YEM System game options
YEM Victory Aftermath
YEM Aftermath Compatibility
KGC_Large Party

YEM Controlled Encounter Rate
YEM Debug Menu Extension
YEM Keyboard Input
YEM Iconview Melody
YEM Party Influenced music
YEM Snapshot Battle Back
YEM Swap Random Monster
YEM Icon Module Library
Leveling weapons (This scirpt)
Thomas_Edison_VX
Map Name Popup

Overall, I don't see anything that would interfere with the script directly, so long as it works with all the YEM scripts. Godspeed on debugging.

QUICK EDIT:

This is probably really important. The armor is the only thing losing exp when I load the file. Weapons retain their exp just fine. Hope that helps!
LordHeinrich
I can't spot anything in the extra scripts that would interfere with the equip level script. The only thing I can think of is the extra armor slots from YEM Equipment Overhaul. The extra armor slots are still buggy and I am not sure if I can fix that.
Dyrnwyn
Nerts. OK, LH, I have confirmed it:

The issue is with the YERD Equipment extension settings. When it is loaded, the gear loses its weapons on load. If I disable the script, your script works perfectly for weapons and armors.

Think you might be able to work with Yanfly on getting it figured out?

Either way, it's working great for weapons, which is exactly what I needed for my RPG. Much appreciated there!! biggrin.gif

EDIT: On further testing, shields, helms, armor all work fine. It's just accessories that seems to be a problem. Hope that helps out. smile.gif

EDIT 2: On even further testing, if you create another accessory type, and don't have multiple armor of the same types, it works fine. So, instead of 3x accessory slots like I did have, I'm just going to make a ring slot, bracer slot, and amulet slot. That's got it fixed. smile.gif
LordHeinrich
Glad you got it resolved! Also, thanks for the info. I am still confused as to your setup that is working fine. If you can take a screen shot of your equip scene, I would appreciate that. Maybe that would help me a bit, because I have an odd setup in in my YEM Equipment Overhaul and that could be why the EXP is behaving oddly on the extra armor slots.

I'll start working more on expanding the equip scene for compatibility (equip progress and such). Right now, I may go on something like the FFIX menu format. Then have an additional scene within that for the extra info for the equip skills and the ability to access the Equip Level info scene... Hopefully it will not get too crazy.
nevious
you should realy put a demo to this it would help people much more
Dyrnwyn
I'll do you one better, LH. The issue is fixed with the YEM equipment overhaul. Here's what I have now that I made the changes:
CODE
  # This determines the order of equipment inside the equipment scene. Note
    # that this does not include weapons as they're automatically the first
    # piece of equipment by default.
    TYPE_LIST =[
      :shield,   # Shield slot for equippable shield type armours.
      :helmet,   # Helmet slot for equippable headgear type armours.
      :armour,   # Armour slot for equippable bodygear type armours.
      :cloak,    # Cloak Accessory for back.
      :charm,    # 1st Accessory slot for misc armours.
      :other,      # 2nd Accessory slot for misc armours.
      :ring,     # 3rd Accessory slot for misc armours.
    ] # Do not remove this
    
    # Adjust the following below to determine the ruleset adjusted for equip
    # equip type following the pre-made template. Here's what each does:
    #     Name - The name of the equip type. When using tag, refer to this.
    #     Kind - The kind number associated with the equip type.
    #   Empty? - Whether or not the equipment slot can be empty.
    # Optimize - When optimizing, include this equipment type or not.
    TYPE_RULES ={
    # Type     => [     Name, Kind, Empty?, Optimize],
      :weapon  => [ "Weapon",  nil,   true,     true],
      :shield  => [ "Shield",    0,   true,     true],
      :helmet  => [ "Helmet",    1,   true,     true],
      :armour  => [ "Armour",    2,   true,     true],
      :charm   => [ "Charm",     5,   true,    false],
      :other   => [ "Accessory", 3,   true,    false],
      :ring    => [ "Ring",      6,   true,    false],
      :cloak   => [ "Cloak",     4,   true,     true],


Originally, under Yanfly's default setup, it's like this:
CODE
# This determines the order of equipment inside the equipment scene. Note
    # that this does not include weapons as they're automatically the first
    # piece of equipment by default.
    TYPE_LIST =[
      :shield,   # Shield slot for equippable shield type armours.
      :helmet,   # Helmet slot for equippable headgear type armours.
      :armour,   # Armour slot for equippable bodygear type armours.
      :cloak,    # Cloak slot for equippable mantle type armours.
      :other,    # 1st Accessory slot for misc armours.
      :other,    # 2nd Accessory slot for misc armours.
      :other,    # 3rd Accessory slot for misc armours.
    ] # Do not remove this
    
    # Adjust the following below to determine the ruleset adjusted for equip
    # equip type following the pre-made template. Here's what each does:
    #     Name - The name of the equip type. When using tag, refer to this.
    #     Kind - The kind number associated with the equip type.
    #   Empty? - Whether or not the equipment slot can be empty.
    # Optimize - When optimizing, include this equipment type or not.
    TYPE_RULES ={
    # Type     => [     Name, Kind, Empty?, Optimize],
      :weapon  => [ "Weapon",  nil,  false,     true],
      :shield  => [ "Shield",    0,   true,     true],
      :helmet  => [ "Helmet",    1,   true,     true],
      :armour  => [ "Armour",    2,   true,     true],
      :other   => [  "Other",    3,   true,    false],
      :cloak   => [  "Cloak",    4,   true,     true],


As you can see, the issue comes up with the accessories. She had 3x all using the same number for the kind, which was 3 in the second group. I think that was what threw things. In mine, I just simply made 2 more kinds so there were no repeat numbers. Easiest coding fix I've ever encountered. smile.gif
LordHeinrich
lol tongue.gif now I get it biggrin.gif I'll have to double check my setup then, cause the EXP behaves oddly for me tongue.gif Thanks for the info!
Dyrnwyn
Sweet. Glad to help.

Annnnnnd, I'm going to make a request: Is it possible to set up a script in the enemies to determine how much weapon/armor exp they give when defeated? It'd be very nice for when you kill bosses and earn the nifty bonuses.
LordHeinrich
I guess I need to improve the instructions on that section. I only gave it one sentence tongue.gif The note tags are the following for that:

<weapon exp: n>
<armor exp: n>

The default values are global and then you can use the note tags on enemies to get unique values. Any other requests are welcome and thanks for all the feedback!!
Dyrnwyn
blink.gif

Wellll, don't i feel silly now!

Awesome! That completes all the needs I had for my RPG. I'm moving forward with the full creation. Thanks for the awesome script!
LordHeinrich
Sounds good. Check the status from time to time because I will eventually get it to a 1.0.00 (non-commercial only). I'll keep on making the new features bold (unless I forget) as I add them, so it will be easy to see what's new.
Craze
I would suggest uploading at least a screenshot or two to TinyPic, since zipping up the screenshots that are meant to help sell/display your script is silly! I want to see it before I download it.

Still cool, though.
LordHeinrich
I'll get to it, but I have 15..or 17 or something like that... I'll get to it, but it's not a priority at the moment. I'll add one or two after this post of the addition to the item scene. II may also make a demo if I have time as nevious suggested.
BlackMagicKitten
Any new developments with the script? improvements? A final draft and screenshots?
icycold2367
This looks like a really good script and I really liked the features when I tested it but I can't get the window to open up properly and let me see my xp and such.
LordHeinrich
I haven't abandoned the script, just I didn't expect work to pile up like it did. I took a demotion and HUGE pay cut so that I can have more free time for myself, and two days later I'm given a promotion (still nowhere near previous pa)... Kinda sucks cause I've been trying to juggle lots of stuff. Work and business and looking for some investment properties (lots of competition for the good deals).

Anyway, the EXP menu should be accessible in the Item menu. When you hover over an item that can level up you will get a message to hit shift or whatever button. Once hit, it will take you to a new menu scene. Latest YEM Build I tested it with must have been 1.00l maybe 1.00m. I don't even know what's out at the moment, so I can't say anything about compatibility on it with current YEM. If there are any issues, it may be a conflict, but those are usually easy to solve.

As for improvements, I can't really think of any other than creating a more compatible equip scene. Requests for improvements are welcome. I've done a little bit of work on the script to where it is slightly past what is released, but nothing really functional, just framework for later additions.
icycold2367
I think its a really, really good script it turned out very well and fits it's purpose perfectly 10/10 review
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.