[ACE] Hime's Parameter Table with extra stats

Hey guys! I'm having trouble adding more than eight stats to my project. I'm using Hime's parameter table script.

Here's the parameter table: level, mhp, mmp, atk, def, mat, mdf, agi, luk, mnd

I added mnd on purpose for healing spells and healing items. I'm using Crystal Noel's Extra stats script as well. I tried to make a script myself, but no luck. I even used param(8) and params(8) for extra stats script. I changed from 0..7 to 0..8 for parameter table script.

I got permission from both of them.

Scripts: Hime's parameter tables script, Crystalnoel42's Extra Stats script.
So what are you trying to do.
I can put hime parameter tables script in with the csv files and crystal noel extra stats script and it shows up fine in the status screen.

I understand now, the Noel script is not getting the new stat value from hime parameter table.
I'll see if there is something I can do.
Params actor 1.

Ruby:
module CRYSTAL
  module XSTAT
   
    STATS = [:mnd]
   
    #Default xstat formulas for ACTORS
    DEFAULT_LEVEL_FORMULA = {
       :mnd => '10',
      }
    #Default xstat formulas for ENEMIES     
    DEFAULT_FOR_ENEMIES = {
     :mnd => '0',
     }

    TERMS = {
    :mnd => "MND",
    }
    
    STAT_MIN = {
    :mnd => 0,
    }
    
    STAT_MAX = {
    :mnd => 100,
    }
    
  end
end
#====

If you unable to enter my csv file, let me know. I was wondering why nobody enter to my files from google.
Try this
Spoiler: Xstat Parameter Table
Ruby:
#===============================================================================
# ** Configuration
#===============================================================================
module TH
  module Param_Tables
  
    # Where to store parameter tables
    Param_Directory = "Data/Params"
  
    # Prefixes for your filenames. For example,
    Actor_Prefix = "params_actor"
    Class_Prefix = "params_class"
    Enemy_Prefix = "params_enemy"
  
    def has_param_table?
      !self.param_table.nil?
    end
  
    def param_table
      load_param_table unless @param_table_checked
      return @param_table
    end
  
    def load_param_table
      @param_table_checked = true
      dir = TH::Param_Tables::Param_Directory
      filename = sprintf("%s%d.csv", param_file_prefix, @id)
      path = File.join(dir, filename)
      begin
        data = load_data(path)
      rescue
        p 'no table found for %s' %path
        return
      end
    
      data = data.split($INPUT_RECORD_SEPARATOR)    
    
      # Don't use tables, since they only signed 2-byte integers.
      # For a range (-32677, 32678)
      @param_table = Data_ParamTable.new
      @xstatmod = Data_ParamTable.new
    
      data[1..-1].each do |line|
        line = line.split(",")
        level = line[0].to_i
        for i in 0..7
          @param_table[i, level] = line[i+1].to_i
        end
        for i in 8..8
          @xstatmod[i, level] = line[i+1].to_i
        end
      end
    end
  end
end

module RPG
 
  class Actor < BaseItem
    include TH::Param_Tables
  
    def param_file_prefix
      TH::Param_Tables::Actor_Prefix
    end
  
    def params
      return @param_table if self.param_table
    end
  
    def xstatmod
      return @xstatmod
    end
  
  end
end

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias r2_actor_init_xstat_param_table   initialize
  def initialize(actor_id)
    r2_actor_init_xstat_param_table(actor_id)
    i = 1
    CRYSTAL::XSTAT::STATS.each do |stat|
      act = $data_actors[actor_id]
      @xstat_plus[stat] = act.xstatmod[i+7,@level]
      i += 1
    end
  end
  #--------------------------------------------------------------------------
  # * Level Up
  #--------------------------------------------------------------------------
  alias r2_level_up_xstat_param_table   level_up
  def level_up
    r2_level_up_xstat_param_table
    prelvl = @level - 1
    i = 1
    CRYSTAL::XSTAT::STATS.each do |stat|
      act = $data_actors[self.id]
      stpr = act.xstatmod[i+7,prelvl]
      stcl = act.xstatmod[i+7,@level]
      diflv = stcl - stpr
      @xstat_plus[stat] += diflv
      i += 1
    end
  end

end

#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This is a super class of all windows within the game.
#==============================================================================

class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw Parameters
  #--------------------------------------------------------------------------
  def draw_actor_xstat(actor, x, y, stat)
    change_color(system_color)
    draw_text(x, y, 120, line_height, CRYSTAL::XSTAT::TERMS[stat])
    change_color(normal_color)
    p(stat)
    p(actor.xstat_plus)
    value = actor.xstat_plus[stat.to_sym]
    p(value)
    draw_text(x + 120, y, 36, line_height, value, 2)
  end
end
It didn't work. This part of the script keeps setting the stats to zero.
Ruby:
class Game_BattlerBase
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :xstat_plus               # Additions to the xstats
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias init_ce_extra_stats initialize
  def initialize
    init_ce_extra_stats
    @xstat_plus = {}
    CRYSTAL::XSTAT::STATS.each do |stat|
      @xstat_plus[stat] = 0
    end
  end
Updated the code above. It works for the initialization, now I need to test the next levels.
*added in. I think it is good.
Thanks! Once you have finished working on the levels, I was thinking if you could work on enemy parameter tables next. Just need to be sure.

Next time you upload an unfinished script, make sure it says WIP. I assumed it's complete since your second post.
Next time you upload an unfinished script, make sure it says WIP. I assumed it's complete since your second post.
It was complete because I thought it was working when I tested. But then you pointed out that the value is set to 0. So I changed the value in the CSV file and confirmed it didn't change. That's when I realized I should have had a value there to begin with, but I made that mistake because I copied what you had shown in the file.

And furthermore, I will never mark something as WIP (not that you have any right to tell me so), because I will not publish anything unless I think it is good.

You have to realize that we may not have fully understood what needs to be done and mistakes can be made.
Okay, forget about the WIP part.

EDIT: It works! Thanks! I'll keep this on in case I need more help.

Original thread: https://forums.rpgmakerweb.com/threads/ace-himes-parameter-table-with-extra-stats.170393/