Custom Parameters Class base not Actor

Hello, I am using the following script to add custom parameters, but they are actor base and I would really like it to be class base. So I the parameters will be different base on which class is selected. Can anyone help me change from actor to class base?

Code:
#===============================================================================#						N.A.S.T.Y. Extra Stats#				  Nelderson's Awesome Scripts To You# By: Nelderson# Made On: 12/19/2011# Last Updated : 3/27/2012#===============================================================================# Update History:# - Version 1.1  - Cleaned up some , and added enemies xstats for Enemies!# - Version 1.0  - Initial release, made for the  of it <img src='http://forums.rpgmakerweb.com/public/style_emoticons/<#EMO_DIR#>/tongue.png' class='bbc_emoticon' alt=':P' />#===============================================================================# *Notes:# - This script can be used to make all sorts of stats that can derive from#   an actor's level, and base stats.## - This thing can be a pain to set up, but once it's done, it can be a very#   powerful way to include new stats into your game!## - Made a quick edit to the status screen to show up to 6 stats!## *Usage## -First is the STATS section.  This is an array that holds all the new#  stats that everything else gets info from.## - Next fill out the Default Level formula(Use Example Below as a guide)#   *ANYTHING that an actor has, you can base it off of (Except other XSTATS!)#	   (level, hp, mp, atk, spi, agi, maxhp, etc.)## -You can use the ACTOR and ENEMY NOTETAGS to customize#  the formulas for each actor.##  Examples:#   Place the following in an actor's notebox(You must make one for each stat):#		 <xstat>#		 :str => '(level/3.5) + 16',#		 :vit => '(level/5.6) + 12',#		 :dex => '(level/5.25) + 15 + agi',#		 :int => '(level/10.5) + 10',#		 :wis => '(level/10.5) + 10',#		 :wil => '(level/10.5) + 10',#		 <xstat_end>##   Or you can place this in an actor's/enemy's notebox#		 <xstat>#		 :str => 15,#		 :vit => 14,#		 :dex => 13,#		 :int => 12,#		 :wis => 11,#		 :wil => 0,#		 <xstat_end>## - This script also uses notetags for weapons and armors to increase xstats#   if you want.  Just place in a notebox:##		 <weapon_xstat: STAT x> , where STAT is th name of the new stat##	   Ex. <weapon_xstat: str 5> , would raise the actor's str +5##  *For Scripters##  -If you want to access the stats, just use:#		actor.xstat.STAT - Where STAT is the name of the new stat#	  #	   Ex. $game_actors[1].xstat.str , will return actor 1's str#  #===============================================================================# Credits:# -Nelderson and Zetu#  Original Script was made by Zetu, and I spiced the  out of it!#===============================================================================module Z26  STATS = [:str,:vit,:dex,:int,:wis,:wil]  #Default xstat formulas for ACTORS  DEFAULT_LEVEL_FORMULA =		{		  :str => '(level/3.5) + 16 + atk',		  :vit => '(level/5.6) + 12',		  :dex => '(level/5.25) + 15 + agi',		  :int => '(level/10.5) + 10',		  :wis => '(level/10.5) + 10',		  :wil => '(level/10.5) + 10',		}  #Default xstat formulas for ENEMIES	    DEFAULT_FOR_ENEMIES =		{		  :str => 0,		  :vit => 0,		  :dex => 0,		  :int => 0,		  :wis => 0,		  :wil => 0,		}   def self.actor_level_formulas(actor_id)	  jhh = ""	  strin = $data_actors[actor_id].get_start_end_cache	  strin.each do |i|		jhh += i	  end	  return DEFAULT_LEVEL_FORMULA if strin == "" or strin == []	  return eval("{#{jhh}}")	end	def self.enemy_stats(enemy_id)	  jhh = ""	  strin = $data_enemies[enemy_id].get_start_end_cache	  strin.each do |i|		jhh += i	  end	  return DEFAULT_FOR_ENEMIES if strin == "" or strin == []	  return eval("{#{jhh}}")	end  #=============================================================================  SYMBOLS = []  for stat in STATS	SYMBOLS.push(stat)  end  Xstats = Struct.new(*SYMBOLS)endclass Game_Enemy < Game_Battler  attr_accessor :xstat  alias z26_enemy_set initialize unless $@  def initialize(*args)	z26_enemy_set(*args)	@xstat = Z26::Xstats.new(*([0]*Z26::STATS.size))	for stat in Z26::STATS	  z26variate_stats(stat)	end  end  def z26variate_stats(stat)	return if Z26.enemy_stats(@enemy_id)[stat].nil?	if Z26.enemy_stats(@enemy_id)[stat].is_a?(String)	  set_in = eval(Z26.enemy_stats(@enemy_id)[stat]).to_i	  eval("@xstat.#{stat} += #{set_in}")	else	  set_in = Z26.enemy_stats(@enemy_id)[stat]	  @xstat[stat] += set_in	end  endendclass Game_Actor < Game_Battler  attr_accessor :xstat  alias z26_s setup unless $@  def setup(actor_id)	z26_s(actor_id)	@xstat = Z26::Xstats.new(*([0]*Z26::STATS.size))	for item in equips.compact	  z26variate_equip(item)	end	for stat in Z26::STATS	  z26variate_stats(stat, @level)	end  end  alias z26_change_equip change_equip  def change_equip(equip_type, item, test = false)	last_item = equips[equip_type]	z26_change_equip(equip_type, item)	z26variate_equip(item)	z26variate_equip(last_item, false)  end  #=====================#  ##EDITED BY NELDERSON##  #=====================#  def z26variate_equip(item, adding = true)	return if item.nil?	for line in item.note.split(/[\r\n]+/).each{ |a|	  case a	  when /<weapon_xstat:[ ](.*)[ ](\d+)>/i		  if Z26::STATS.include?(eval(":" + $1))			if adding			  eval("@xstat.#{$1} += #{$2}")			else			eval("@xstat.#{$1} -= #{$2}")		  end		end	  end	  }	end  end  def z26variate_stats(stat, level, adding = true)	return if Z26.actor_level_formulas(@actor_id)[stat].nil?	if Z26.actor_level_formulas(@actor_id)[stat].is_a?(String)	  amount = eval(Z26.actor_level_formulas(@actor_id)[stat]).to_i	else	  amount = Z26.actor_level_formulas(@actor_id)[stat]	end	if adding	  eval("@xstat.#{stat} += #{amount}")	else	  eval("@xstat.#{stat} -= #{amount}")	end  end  alias z26level_up level_up unless $@  def level_up	for stat in Z26::STATS	  z26variate_stats(stat, @level, false)	end	z26level_up	for stat in Z26::STATS	  z26variate_stats(stat, @level)	end  endendclass Window_Status < Window_Selectable  def draw_block3(y)	draw_parameters(0, y)	draw_equipments(344, y)#288	draw_xstat_parameters(172, y)  end  def draw_xstat_parameters(x, y)	@actor.xstat.size.times {|i|	draw_actor_xstat_param(@actor, x, y + line_height * i, i) }  endendclass Window_Base < Window  def draw_actor_xstat_param(actor, x, y, param_id)	id = Z26::STATS[param_id]	change_color(system_color)	draw_text(x, y, 120, line_height, id.capitalize)	change_color(normal_color)	draw_text(x + 120, y, 36, line_height, actor.xstat[id], 2)  endendclass RPG::BaseItem  def get_start_end_cache	record = false	temp = []	self.note.split(/[\r\n]+/).each do |line|	  if line =~ /<xstat>/i		record = true	  elsif line =~ /<xstat_end>/i		record = false	  end	  if record		temp << line	  end	end	return nil if temp == ""	temp.delete_at(0)	temp  endend
Ask and you shall receive.....

Spoiler
Code:
#===============================================================================#					               	N.A.S.T.Y. Extra Stats#				             Nelderson's Awesome Scripts To You# By: Nelderson# Made On: 12/19/2011# Last Updated : 7/5/2015#===============================================================================# Update History:# - Version 1.0  - Initial release, made for the  of it # - Version 1.1  - Cleaned up some , and added xstats for Enemies!# - Version 1.2 - Added ability to see xstat changes in the Equip screen.#                 Added compatability to NASTY Extra Equip slots# - Version 1.3 - Added ability to use formulas on class notes instead #                 of actor notes#===============================================================================# *Notes:# - This script can be used to make all sorts of stats that can derive from#   an actor's level, and base stats.## - This thing can be a pain to set up, but once it's done, it can be a very#   powerful way to include new stats into your game!## - Made a quick edit to the status screen to show up to 6 stats!## *Usage## -First is the STATS section.  This is an array that holds all the new#  stats that everything else gets info from.## - Next fill out the Default Level formula(Use Example Below as a guide)#   *ANYTHING that an actor has, you can base it off of (Except other XSTATS!)#	   (level, hp, mp, atk, spi, agi, maxhp, etc.)## -You can use the ACTOR and ENEMY NOTETAGS to customize#  the formulas for each actor.## - You can set the CLASS_FORMULA to true to use Class notetags instead of #   actor notetags.##  Examples:#   Place the following in an actor's notebox(You must make one for each stat):#		 <xstat>#		 :str => '(level/3.5) + 16',#		 :con => '(level/5.6) + 12',#		 :dex => '(level/5.25) + 15 + agi',#		 :int => '(level/10.5) + 10',#		 :wis => '(level/10.5) + 10',#		 :cha => '(level/10.5) + 10',#		 <xstat_end>##   Or you can place this in an actor's/enemy's notebox#		 <xstat>#		 :str => 15,#		 :con => 14,#		 :dex => 13,#		 :int => 12,#		 :wis => 11,#		 :cha => 0,#		 <xstat_end>## - This script also uses notetags for weapons and armors to increase xstats#   if you want.  Just place in a notebox:##		 <weapon_xstat: STAT x> , where STAT is th name of the new stat##	   Ex. <weapon_xstat: str 5> , would raise the actor's str +5##  *For Scripters##  -If you want to access the stats, just use:#		actor.xstat.STAT - Where STAT is the name of the new stat#	  #	   Ex. $game_actors[1].xstat.str , will return actor 1's str#  #===============================================================================# Credits:# -Nelderson and Zetu#  Original Script was made by Zetu, and I spiced the  out of it!#===============================================================================module Z26  STATS = [:str,:con,:dex,:int,:wis,:cha]    #Use Class notetags instead of Actor notetags for formulas  CLASS_FORMULA = true  #Default xstat formulas for ACTORS  DEFAULT_LEVEL_FORMULA =		{		  :str => '(level/3.5) + 16 + atk',		  :con => '(level/5.6) + 12',		  :dex => '(level/5.25) + 15 + agi',		  :int => '(level/10.5) + 10',		  :wis => '(level/10.5) + 10',		  :cha => '(level/10.5) + 10',		}  #Default xstat formulas for ENEMIES	    DEFAULT_FOR_ENEMIES =		{		  :str => 0,		  :con => 0,		  :dex => 0,		  :int => 0,		  :wis => 0,		  :cha => 0,		}   def self.actor_level_formulas(actor_id)     if CLASS_FORMULA == true      jhh = ""      strin = $data_classes[$data_actors[actor_id].class_id].get_start_end_cache      strin.each do |i|      jhh += i     end    else      jhh = ""      strin = $data_actors[actor_id].get_start_end_cache      strin.each do |i|      jhh += i      end     end	  return DEFAULT_LEVEL_FORMULA if strin == "" or strin == []	  return eval("{#{jhh}}")	end	def self.enemy_stats(enemy_id)	  jhh = ""	  strin = $data_enemies[enemy_id].get_start_end_cache	  strin.each do |i|		jhh += i	  end	  return DEFAULT_FOR_ENEMIES if strin == "" or strin == []	  return eval("{#{jhh}}")	end  #=============================================================================  SYMBOLS = []  for stat in STATS	SYMBOLS.push(stat)  end  Xstats = Struct.new(*SYMBOLS)endclass Game_Enemy < Game_Battler  attr_accessor :xstat  alias z26_enemy_set initialize unless $@  def initialize(*args)	z26_enemy_set(*args)	@xstat = Z26::Xstats.new(*([0]*Z26::STATS.size))	for stat in Z26::STATS	  z26variate_stats(stat)	end  end  def z26variate_stats(stat)	return if Z26.enemy_stats(@enemy_id)[stat].nil?	if Z26.enemy_stats(@enemy_id)[stat].is_a?(String)	  set_in = eval(Z26.enemy_stats(@enemy_id)[stat]).to_i	  eval("@xstat.#{stat} += #{set_in}")	else	  set_in = Z26.enemy_stats(@enemy_id)[stat]	  @xstat[stat] += set_in	end  endendclass Game_Actor < Game_Battler  attr_accessor :xstat  alias z26_s setup unless $@  def setup(actor_id)    z26_s(actor_id)    @xstat = Z26::Xstats.new(*([0]*Z26::STATS.size))    for item in equips.compact      z26variate_equip(item)    end    for stat in Z26::STATS      z26variate_stats(stat, @level)    end  end  alias z26_change_equip change_equip  def change_equip(equip_type, item, test = false)    last_item = equips[equip_type]    z26_change_equip(equip_type, item)    z26variate_equip(item)    z26variate_equip(last_item, false)  end  alias z26_change_force_equip force_change_equip  def force_change_equip(equip_type, item, test = false)    last_item = equips[equip_type]    z26_change_force_equip(equip_type, item)    z26variate_equip(item)    z26variate_equip(last_item, false)  end  #=====================#  ##EDITED BY NELDERSON##  #=====================#  def z26variate_equip(item, adding = true)	return if item.nil?	for line in item.note.split(/[\r\n]+/).each{ |a|	  case a	  when /<weapon_xstat:[ ](.*)[ ](-?\d+)>/i		  if Z26::STATS.include?(eval(":" + $1))			if adding			  eval("@xstat.#{$1} += #{$2}")			else			eval("@xstat.#{$1} -= #{$2}")		  end		end	  end	  }	end  end  def z26variate_stats(stat, level, adding = true)	return if Z26.actor_level_formulas(@actor_id)[stat].nil?	if Z26.actor_level_formulas(@actor_id)[stat].is_a?(String)	  amount = eval(Z26.actor_level_formulas(@actor_id)[stat]).to_i	else	  amount = Z26.actor_level_formulas(@actor_id)[stat]	end	if adding	  eval("@xstat.#{stat} += #{amount}")	else	  eval("@xstat.#{stat} -= #{amount}")	end  end  alias z26level_up level_up unless $@  def level_up	for stat in Z26::STATS	  z26variate_stats(stat, @level, false)	end	z26level_up	for stat in Z26::STATS	  z26variate_stats(stat, @level)	end  endendclass Window_Status < Window_Selectable  def draw_block3(y)    draw_parameters(0, y)    draw_equipments(344, y)#288    draw_xstat_parameters(112, y) # CHANGED x==172 originally  end       def draw_xstat_parameters(x, y)    @actor.xstat.size.times {|i|    draw_actor_xstat_param(@actor, x, y + line_height * i, i) }  endendclass Window_Base < Window  def draw_actor_xstat_param(actor, x, y, param_id)    id = Z26::STATS[param_id]    change_color(system_color)    draw_text(x, y, 120, line_height, id.capitalize)    change_color(normal_color)    draw_text(x + 60, y, 36, line_height, actor.xstat[id], 2)  end    def draw_actor_param(actor, x, y, param_id) #Rewritten for NASTY Equip Slots    change_color(system_color)    draw_text(x, y, 120, line_height, Vocab::param(param_id))    change_color(normal_color)    draw_text(x + 60, y, 36, line_height, actor.param(param_id), 2)  endend#########################################REWRTES FOR EQUIP STATUS COMPATIBILITY#########################################class Window_EquipStatus < Window_Base    def refresh    contents.clear    draw_actor_name(@actor, 4, 0) if @actor    6.times {|i| draw_item(0, line_height * (1 + i), 2 + i) }    @actor.xstat.size.times {|i| draw_xstat_item(0, line_height * (1 + i), i) } if @actor  end    def draw_xstat_item(x, y, param_id)    id = Z26::STATS[param_id]    draw_param_name_xstat(x + 91, y, id)    draw_current_param_xstat(x + 111, y, @actor.xstat[id]) if @actor #94    draw_right_arrow(x + 135, y) #126    draw_new_param_xstat(x + 147, y, id) if @temp_actor #150  end    def draw_param_name_xstat(x, y, param_id)    change_color(system_color)    draw_text(x, y, 26, line_height, param_id.capitalize)  end    def draw_current_param_xstat(x, y, param_id)    change_color(normal_color)    draw_text(x, y, 24, line_height, param_id, 2)#32  end    def draw_new_param_xstat(x, y, param_id)    new_value = @temp_actor.xstat[param_id]    change_color(param_change_color(new_value - @actor.xstat[param_id]))    draw_text(x, y, 25, line_height, new_value, 2)#32  end    def draw_item(x, y, param_id)    draw_param_name(x + 0, y, param_id)    draw_current_param(x + 21, y, param_id) if @actor #94    draw_right_arrow(x + 51, y) #126    draw_new_param(x + 61, y, param_id) if @temp_actor #150  end    def draw_param_name(x, y, param_id)    change_color(system_color)    draw_text(x, y, 26, line_height, Vocab::param(param_id))  end    def draw_current_param(x, y, param_id)    change_color(normal_color)    draw_text(x, y, 24, line_height, @actor.param(param_id), 2)#32  end    def draw_right_arrow(x, y)    change_color(system_color)    draw_text(x, y, 18, line_height, "→", 1)#22  end    def draw_new_param(x, y, param_id)    new_value = @temp_actor.param(param_id)    change_color(param_change_color(new_value - @actor.param(param_id)))    draw_text(x, y, 25, line_height, new_value, 2)#32  endendclass RPG::BaseItem  def get_start_end_cache	record = false	temp = []	self.note.split(/[\r\n]+/).each do |line|	  if line =~ /<xstat>/i		record = true	  elsif line =~ /<xstat_end>/i		record = false	  end	  if record		temp << line	  end	end	return nil if temp == ""	temp.delete_at(0)	temp  endend
Acquired.  :ninja:  
thank you!
now how do I get them to effect the basic parameters?

Like str adds to atk, vit adds to maxhp, int adds to maxmp, wis adds to matk, and wis + int adds to mdef?
now how do I get them to effect the basic parameters?

Like str adds to atk, vit adds to maxhp, int adds to maxmp, wis adds to matk, and wis + int adds to mdef?
That would require a whole different script since you want to define how the base stats are generated......

I would try to instead use things like attack and strength in your battle formulas instead of strength affecting your attack power which then increases your damage.....

Hope that helps!
I still need vit effecting maxhp, wis and int effecting mat, mdf, etc. 
You could potentially do that with Parameter Bonuses, which adds params based on formulas.


So for example you can tag the actor with a maxHP bonus that uses the actor's vit stat so that the max HP is controlled by vit.
that looks like it would do what I want, but I need it to be class based not actor. I will try plugging it into the game and setting it up in classes to see if it works but looks like it's actor base.
yeah keep getting error message undefined method for sta. and goes to line 190 in parameter bonuses.
ok so parameter bonuses gives an error msg and i can't seem to get that to work.

but, i just need a working formula for ATK, MATK, MDEF, MAXHP and MAXMP, using the new parameters. so I can knock this issue off the script, and this script off the list.

Please, and thank you in advance!
Bump
Decided to explain my reasoning better.

The reason I want STR to be forumla setup and grow (a little) as you level up and adds to ATK, is because lets say Warrior might get a bonus to his ATK from STR a little quicker than a Wizard.

INT would define your character's MaxMP, WIS would do the same to MDEF. WIS and INT together would effect MATK. Vit would of course effect your MaxHP. I do believe I already have a HPBonus script installed and know that it works. Just need a MaxHP forumla. So some classes would have higher bonuses or rather gain a bonus quicker than others, while other would grow slowly. 

These are the last part of this script that I need, so I can mark this script off my list of programming for my game. Which isn't very long at the moment.

If anyone can please offer help, I would very happy as I have already tried some things and cannot seem to get it to work. I hate the programming part of game making, and much rather focus on graphics. However, I have 2 main scripts at the moment that I consider high important, and need to get working. The other 4 or 5 things that I wish to add to the game, are low and can wait till the game is more finished to add.
🙁
dayhjawk, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.

It's only been 3 hours since your post.  You have to allow for differing time zones as well as the fact that everyone answering here does so in their free time and so will have other commitments as well.
this post can be closed

Original thread: https://forums.rpgmakerweb.com/threads/custom-parameters-class-base-not-actor.41935/