After using this script for a while I noticed some strange quirks. I do not know if it is working as intended but I figured I'd point them out just in case.
1. The xparams are displayed as percentages but they seem to be an order of 100 too small. For example hit chance is 0.85% but using the default character who has 95% hit - 10% hit for wielding an axe results in 85% not 0.85%. I believe this is a mistake since 0.85 % indicates almost no chance of landing your hit.
2. The guages and numbers do not reflect changes made by Yanfly's Extra Parameters Formula script. This is because this script uses the xparam method to get parameter values instead of their alternative names such as "hit" and "eva" which are aliased by Yanfly's Extra Parameters Formula. The game values also seem to reflect the values generated by the alternative names rather than xparam as well.
3. Unspent attribute points are not saved properly. For example if you speed one point and you have four points left. You save and than close the game completely, open the game and load you will now have either 0 or 5 points.
My fix for problems 1 + 2:
Spoiler
class Game_BattlerBase def xparam(xparam_id) features_sum(FEATURE_XPARAM, xparam_id) end alias_xparam = ["hit", "eva", "cri", "cev", "mev", "mrf", "cnt", "hrg", "mrg", "trg"] alias_xparam.each { |xparam| id = 0 if xparam == "hit" id = 1 if xparam == "eva" id = 2 if xparam == "cri" id = 3 if xparam == "cev" id = 4 if xparam == "mev" id = 5 if xparam == "mrf" id = 6 if xparam == "cnt" id = 7 if xparam == "hrg" id = 8 if xparam == "mrg" id = 9 if xparam == "trg" aStr = %Q( alias game_battlerbase_#{xparam}_epf2 #{xparam} def #{xparam} base_#{xparam} = game_battlerbase_#{xparam}_epf2 n = eval(YEA::XPARAM::FORMULA[:#{xparam}_n_value]) return eval(YEA::XPARAM::FORMULA[:#{xparam}_formula]) + xparam_plus(#{id}) end ) module_eval(aStr) }endclass Window_Base < Window def draw_actor_xparam_gauge(actor, x, y, width, xparam_id, font, size, bar_color1, bar_color2, txt_color1, txt_color2) case xparam_id when 0 xparam_rate = actor.hit xparam_name = Vocab.xparam(0) when 1 xparam_rate = actor.eva xparam_name = Vocab.xparam(1) when 2 xparam_rate = actor.cri xparam_name = Vocab.xparam(2) when 3 xparam_rate = actor.cev xparam_name = Vocab.xparam(3) when 4 xparam_rate = actor.mev xparam_name = Vocab.xparam(4) when 5 xparam_rate = actor.mrf xparam_name = Vocab.xparam(5) when 6 xparam_rate = actor.cnt xparam_name = Vocab.xparam(6) when 7 xparam_rate = actor.hrg xparam_name = Vocab.xparam(7) when 8 xparam_rate = actor.mrg xparam_name = Vocab.xparam(8) when 9 xparam_rate = actor.trg xparam_name = Vocab.xparam(9) end contents.font.name = font contents.font.size = size contents.font.bold = true contents.font.shadow = false draw_gauge_ex(x, y - 14, width, 20, xparam_rate, bar_color1, bar_color2) contents.font.color = txt_color1 draw_text(x + 10, y, 120, line_height, xparam_name) contents.font.color = txt_color2 draw_text(x + width - 38, y, 36, line_height, "#{(xparam_rate * 100).clamp(0,100).round_to(1)}%", 2) reset_font_settings endendclass Scene_Attribute < Scene_AttributeBase def on_index_change(index) title = Vocab::param(index) case index when 8 ; title = Vocab::xparam(0) when 9 ; title = Vocab::xparam(1) when 10 ; title = Vocab::xparam(2) when 11 ; title = Vocab::xparam(3) when 12 ; title = Vocab::xparam(4) when 13 ; title = Vocab::xparam(5) end stats = XAIL::ATTRIBUTE_SYSTEM::LIST[index][1] stats = (stats * 100).to_s + "%" if stats < 1 cost = XAIL::ATTRIBUTE_SYSTEM::LIST[index][2].to_s @attribute_param.set_text(title.to_s + " +" + stats.to_s, Color.new(150,205,150,225)) @attribute_info.set_text("Increase " + title + ". Cost » " + cost + " points", XAIL::ATTRIBUTE_SYSTEM::pARAM_TXT_COLOR[1]) refresh_windows endend
My fix for problem 3:
Spoiler
class Game_BattlerBase attr_accessor :points alias original_initialize initialize def initialize @points = [5] original_initialize endendclass Game_Actor < Game_Battler def gain_attribute(actor_id, value, type = :gain) points = @points case type when :gain points[0] = (points[0] + value).clamp(0, XAIL::ATTRIBUTE_SYSTEM.attr_max(actor)) when :lose points[0] = (points[0] - value).clamp(0, XAIL::ATTRIBUTE_SYSTEM.attr_max(actor)) end end def attribute?(actor_id) @points[0] endendclass Window_Attribute_Points < Window_Base def refresh contents.clear current = @actor.points[0].to_s max = XAIL::ATTRIBUTE_SYSTEM.attr_max($game_actors[@actor.id]).to_s text = "Points: " + current contents.font.name = XAIL::ATTRIBUTE_SYSTEM::FONT contents.font.size = 20 contents.font.color = Color.new(255,255,255) draw_text(0, 0, contents.width, line_height, text) reset_font_settings endend
Hopefully I didn't leave anything out. I'm still rather new at ruby so I wouldn't be surprised if I missed something.
Edit: Change "n = eval(YEA::XPARAM::FORMULA[:#{xparam}_n_value])" to "n = 0". It was calculating Yanfly's n value twice.