RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[REQUEST][RMXP] Help with this level and stat breaking script

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 66
RMRK Junior
Can anyone help me modify this script?  I know how to set the limits, but would like to set the rates that stats increase to those limits.

I currently have in my game max level 99, 9999 HPs and SPs, and STR, INT, DEX, AGI at 100.  I have it set up as follows:
at level 1 you have 20 HPs, no SPs (you gain 5 at level 6 and then it goes up from there), and 5 in each stat STR, INT, AGI, DEX.
at 25 you have 619 HPs, 600 SPs, and 11 in each stat.
at 50 you have 2515 HPs, 2500 SPs, and 29 in each stat.
at 75 you have 5710 HPs, 5702 SPs, and 60 in each stat.
and at 99 you have 9999 HPs, 9999 SPs, and 100 in each stat.

All rates are set with the slider to the far right, for the slowest gain in all stats.  The EXP needed bar is set for 13 Basis (13 XP to reach level 2) and Inflation 50 (you need 2175991 XP to reach level 99.)  Unfortunately, with the kind of game I'm making I believe this will not be high enough and the characters will reach level 99 far before the end of the game.

What I would like is to have it set for level 999, max HPs and SPs at 99,999, and max stats STR, INT, DEX and AGI at 999 - with the EXP needed to reach that level raising at the same pace (Inflation 50), so it would be:
at level 1 you have 20 HPs, no SPs (you gain 5 at level 6 and then it goes up from there (i would still like to do this if possible)), and 5 in each stat STR, INT, AGI, DEX.
at 25 you have 619 HPs, 600 SPs, and 11 in each stat.
at 50 you have 2515 HPs, 2500 SPs, and 29 in each stat.
at 75 you have 5710 HPs, 5702 SPs, and 60 in each stat.
at level 99 you have 9999 HPs, 9999 SPs, and 100 in each stat.
at level 250 (guesstimating) you have 25000 HPs, 25000 SPs, and 250 in each stat.
at level 500 - 50000 HPs and SPs, 500 in stats.
at level 999 - 99999 HPs and SPs, 999 in stats.

This way the player does not necessarily have to keep leveling past 99, but if they hit it way before the end of the game, they're not just cut off.  Or if they have a lot of time on their hands they can see if they can get to 999.  From testing the script below out, I used max lvl 999, max hps and sps 99,999, and max stats 999.  I then made a ghost have max XP in a new game and 1 hp and made 8 of them in an battle process event, so killing 8 gave me 799992 XP.  And it did indeed break lvl 99, I shot to 118 after the first battle, but the HPs and MPs increased to 96000, along with all of the stats hitting 999 as well.  I want it to be around 11800 HPs and MPs and stats at 118 (so generally 100 HPs and MPs and 1 point added to stats for every level past 99.)

Can anyone look at the code below and see if they can change the rate of the increases to be accordance to what I need?  I would really appreciate it!!  Thanks much in advance!

Spoiler for:
Code: [Select]
    #==============================================================================
    #  Unlimit Levels v1                                            by: cybersam
    #                                                               date: 14.09.06
    #------------------------------------------------------------------------------
    #  here is a full working scripts for you to this... (i think there is
    #  already one like this somewhere in the in the community...
    #  i did one back then when i started in RPG Maker XP
    #  some other guys did a few other script like this
    #==============================================================================
    #----------------------------------------------------------------------------
    # here you can set the max hp,sp,,str,dex,agi and int
    #----------------------------------------------------------------------------
      $FINAL_LVL  = 100
      $MAX_HP     = 99999
      $MAX_SP     = 99999
      $MAX_STR    = 9999
      $MAX_DEX    = 9999
      $MAX_AGI    = 9999
      $MAX_INT    = 9999
     
    class Game_Actor
     
      #--------------------------------------------------------------------------
      # setting the levels...
      #--------------------------------------------------------------------------
      def final_level
       
        # here you can set the max level for your characters based on their ID's...
        # i set it so that 3 characters have different levels and the rest
        # have max lvl of 9999
        #
        # this settings is only to show you how to change the max setting for your
        # characters... same thing is for the parameters -> hp,sp,str,dex.agi,int
       
        case self.id
        when 1
          level = 100
        when 2
          level = 100
        when 8
          level = 100
        else
          level = $FINAL_LVL
        end
        return level
      end
     
     
      #--------------------------------------------------------------------------
      # setting max hp...
      #--------------------------------------------------------------------------
      def max_hp
     
        case self.id
        when 1
          hp = 99999
        when 2
          hp = 99999
        when 8
          hp = 99999
        else
          hp = $MAX_HP
        end
        return hp
      end
      #--------------------------------------------------------------------------
      # setting max sp...
      #--------------------------------------------------------------------------
      def max_sp
     
        case self.id
        when 1
          sp = 99999
        when 2
          sp = 99999
        when 8
          sp = 99999
        else
          sp = $MAX_SP
        end
        return sp
      end
      #--------------------------------------------------------------------------
      # setting max str...
      #--------------------------------------------------------------------------
      def max_str
        case self.id
        when 1
          str = 9999
        when 2
          str = 9999
        when 8
          str = 9999
        else
          str = $MAX_STR
        end
        return str
      end
      #--------------------------------------------------------------------------
      # setting max dex...
      #--------------------------------------------------------------------------
      def max_dex
        case self.id
        when 1
          dex = 9999
        when 2
          dex = 9999
        when 8
          dex = 9999
        else
          dex = $MAX_DEX
        end
        return dex
      end
      #--------------------------------------------------------------------------
      # setting max agi...
      #--------------------------------------------------------------------------
      def max_agi
        case self.id
        when 1
          agi = 9999
        when 2
          agi = 9999
        when 8
          agi = 9999
        else
          agi = $MAX_AGI
        end
        return agi
      end 
      #--------------------------------------------------------------------------
      # setting max int...
      #--------------------------------------------------------------------------
      def max_int
        case self.id
        when 1
          int = 9999
        when 2
          int = 9999
        when 8
          int = 9999
        else
          int = $MAX_INT
        end
        return int
      end
     
      #--------------------------------------------------------------------------
      # Creating the new EXP list
      # dont change anything from here on... (only if you know what you're doing)
      #--------------------------------------------------------------------------
      def make_exp_list
        actor = $data_actors[@actor_id]
        @exp_list = Array.new(final_level + 2)
        @exp_list[1] = 0
        pow_i = 2.4 + actor.exp_inflation / 1000.0
        for i in 2..final_level + 1
          if i > final_level
            @exp_list[i] = 0
          else
            n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
            @exp_list[i] = @exp_list[i-1] + Integer(n)
          end
        end
      end
     
      #--------------------------------------------------------------------------
      # setting parameters like hp, sp, str, dex, agi and int
      #--------------------------------------------------------------------------
      def maxhp
        n = [[base_maxhp + @maxhp_plus, 1].max, $MAX_HP].min
        for i in @states
          n *= $data_states[i].maxhp_rate / 100.0
        end
        n = [[Integer(n), 1].max, $MAX_HP].min
        return n
      end
     
      def base_maxhp
        maxhp = $data_actors[@actor_id].parameters[0, 1]
        maxhp += $data_actors[@actor_id].parameters[0, 2] * @level
        return maxhp
      end
     
      def base_maxsp
        maxsp = $data_actors[@actor_id].parameters[1, 1]
        maxsp += $data_actors[@actor_id].parameters[1, 2] * @level
        return maxsp
      end
     
      def base_str
        n = $data_actors[@actor_id].parameters[2, 1]
        n += $data_actors[@actor_id].parameters[2, 2] * @level
        weapon = $data_weapons[@weapon_id]
        armor1 = $data_armors[@armor1_id]
        armor2 = $data_armors[@armor2_id]
        armor3 = $data_armors[@armor3_id]
        armor4 = $data_armors[@armor4_id]
        n += weapon != nil ? weapon.str_plus : 0
        n += armor1 != nil ? armor1.str_plus : 0
        n += armor2 != nil ? armor2.str_plus : 0
        n += armor3 != nil ? armor3.str_plus : 0
        n += armor4 != nil ? armor4.str_plus : 0
        return [[n, 1].max, $MAX_STR].min
      end
     
      def base_dex
        n = $data_actors[@actor_id].parameters[3, 1]
        n += $data_actors[@actor_id].parameters[3, 2] * @level
        weapon = $data_weapons[@weapon_id]
        armor1 = $data_armors[@armor1_id]
        armor2 = $data_armors[@armor2_id]
        armor3 = $data_armors[@armor3_id]
        armor4 = $data_armors[@armor4_id]
        n += weapon != nil ? weapon.dex_plus : 0
        n += armor1 != nil ? armor1.dex_plus : 0
        n += armor2 != nil ? armor2.dex_plus : 0
        n += armor3 != nil ? armor3.dex_plus : 0
        n += armor4 != nil ? armor4.dex_plus : 0
        return [[n, 1].max, $MAX_DEX].min
      end
     
      def base_agi
        n = $data_actors[@actor_id].parameters[4, 1]
        n += $data_actors[@actor_id].parameters[4, 2] * @level
        weapon = $data_weapons[@weapon_id]
        armor1 = $data_armors[@armor1_id]
        armor2 = $data_armors[@armor2_id]
        armor3 = $data_armors[@armor3_id]
        armor4 = $data_armors[@armor4_id]
        n += weapon != nil ? weapon.agi_plus : 0
        n += armor1 != nil ? armor1.agi_plus : 0
        n += armor2 != nil ? armor2.agi_plus : 0
        n += armor3 != nil ? armor3.agi_plus : 0
        n += armor4 != nil ? armor4.agi_plus : 0
        return [[n, 1].max, $MAX_AGI].min
      end
     
      def base_int
        n = $data_actors[@actor_id].parameters[5, 1]
        n += $data_actors[@actor_id].parameters[5, 2] * @level
        weapon = $data_weapons[@weapon_id]
        armor1 = $data_armors[@armor1_id]
        armor2 = $data_armors[@armor2_id]
        armor3 = $data_armors[@armor3_id]
        armor4 = $data_armors[@armor4_id]
        n += weapon != nil ? weapon.int_plus : 0
        n += armor1 != nil ? armor1.int_plus : 0
        n += armor2 != nil ? armor2.int_plus : 0
        n += armor3 != nil ? armor3.int_plus : 0
        n += armor4 != nil ? armor4.int_plus : 0
        return [[n, 1].max, $MAX_INT].min
      end
     
      def exp=(exp)
        @exp = [exp, 0].max
        while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
          @level += 1
          for j in $data_classes[@class_id].learnings
            if j.level == @level
              learn_skill(j.skill_id)
            end
          end
        end
        while @exp < @exp_list[@level]
          @level -= 1
        end
        @hp = [@hp, self.maxhp].min
        @sp = [@sp, self.maxsp].min
      end
     
      def level=(level)
        level = [[level, final_level].min, 1].max
        self.exp = @exp_list[level]
      end
    end
     
     
     
    #==============================================================================
    # ** Game_Battler
    #==============================================================================
     
    class Game_Battler
     
      def maxhp
        n = [[base_maxhp + @maxhp_plus, 1].max, $MAX_HP].min
        for i in @states
          n *= $data_states[i].maxhp_rate / 100.0
        end
        n = [[Integer(n), 1].max, $MAX_HP].min
        return n
      end
     
      def maxsp
        n = [[base_maxsp + @maxsp_plus, 0].max, $MAX_SP].min
        for i in @states
          n *= $data_states[i].maxsp_rate / 100.0
        end
        n = [[Integer(n), 0].max, $MAX_SP].min
        return n
      end
     
      def str
        n = [[base_str + @str_plus, 1].max, $MAX_STR].min
        for i in @states
          n *= $data_states[i].str_rate / 100.0
        end
        n = [[Integer(n), 1].max, $MAX_STR].min
        return n
      end
     
      def dex
        n = [[base_dex + @dex_plus, 1].max, $MAX_DEX].min
        for i in @states
          n *= $data_states[i].dex_rate / 100.0
        end
        n = [[Integer(n), 1].max, $MAX_DEX].min
        return n
      end
     
      def agi
        n = [[base_agi + @agi_plus, 1].max, $MAX_AGI].min
        for i in @states
          n *= $data_states[i].agi_rate / 100.0
        end
        n = [[Integer(n), 1].max, $MAX_AGI].min
        return n
      end
     
      def int
        n = [[base_int + @int_plus, 1].max, $MAX_INT].min
        for i in @states
          n *= $data_states[i].int_rate / 100.0
        end
        n = [[Integer(n), 1].max, $MAX_INT].min
        return n
      end
     
      def maxhp=(maxhp)
        @maxhp_plus += maxhp - self.maxhp
        @maxhp_plus = [[@maxhp_plus, -$MAX_HP].max, $MAX_HP].min
        @hp = [@hp, self.maxhp].min
      end
     
      def maxsp=(maxsp)
        @maxsp_plus += maxsp - self.maxsp
        @maxsp_plus = [[@maxsp_plus, -$MAX_SP].max, $MAX_SP].min
        @sp = [@sp, self.maxsp].min
      end
     
      def str=(str)
        @str_plus += str - self.str
        @str_plus = [[@str_plus, -$MAX_STR].max, $MAX_STR].min
      end
     
      def dex=(dex)
        @dex_plus += dex - self.dex
        @dex_plus = [[@dex_plus, -$MAX_DEX].max, $MAX_DEX].min
      end
     
      def agi=(agi)
        @agi_plus += agi - self.agi
        @agi_plus = [[@agi_plus, -$MAX_AGI].max, $MAX_AGI].min
      end
     
      def int=(int)
        @int_plus += int - self.int
        @int_plus = [[@int_plus, -$MAX_INT].max, $MAX_INT].min
      end
    end

I tried the ghost with max XP scenario in a brand new game.  In my game I will be using Tons of Addons, an enemy health bar script, Easy Level Addon, Skill Shop addon, and a small script that adds "when X return Y" which means when monster ID is X then return Variable ID which adds 1 to that specific variable - it's for monster hunting jobs - go out and kill X amount of a specific monsters kind of thing - each kill of a specific kind of monster adds 1 to that monster's specific variable.

***
Rep:
Level 82
We learn by living...
I'm not very smart but isn't your exp code referring back to the main interface?

let's see

Code: [Select]
  def make_exp_list
    actor = $data_actors[@actor_id]
    @exp_list[1] = 0
    pow_i = 2.4 + actor.exp_inflation / 100.0
    for i in 2..100
      if i > actor.final_level
        @exp_list[i] = 0
      else
        n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
        @exp_list[i] = @exp_list[i-1] + Integer(n)
      end
    end
  end

compared with

Code: [Select]
def make_exp_list
        actor = $data_actors[@actor_id]
        @exp_list = Array.new(final_level + 2)
        @exp_list[1] = 0
        pow_i = 2.4 + actor.exp_inflation / 1000.0
        for i in 2..final_level + 1
          if i > final_level
            @exp_list[i] = 0
          else
            n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
            @exp_list[i] = @exp_list[i-1] + Integer(n)
          end
        end
      end

yeah, uhmn, I usually overwrite that thing before trying to change experience and level maximums, otherwise it plays hockey with my head.

**
Rep: +0/-0Level 66
RMRK Junior
I'm sorry I should of said that this is not my script, but a script that I found.  I should of also said I know nothing about scripting =P!  Sorry!  Thanks very very much for any help you can give, nonetheless.

What I'd like it to do would be, basically:

levels 1-99:  whatever inflation curves I put into the editor, just like I would have for a normal game where you only level to 99.  For my game it would be starting HP 20, starting SPs 0, AGI, DEX, STR, INT 5.  The SPs would go up to 5 at level 6, and increase from there.  Everything is as slow of increase possible (ie, slider bars to extreme right)

levels 100+:  each level past 99 will add 100 to HPs, 100 to SPs, and 1 to AGI, DEX, STR, INT.  The EXP Needed for Next Level curve used for levels past 99 would be keeping in par with the levels 1-99, ie Inflation set to 50.

thanks very much for looking at this =)

***
Rep:
Level 82
We learn by living...
the slider bar equations are kind of weird. Here's an example of an experience table modern algebra helped me make when I was new to scripting

Code: [Select]
  #--------------------------------------------------------------------------
  # * Calculate EXP
  #--------------------------------------------------------------------------
  #def make_exp_list
  #  actor = $data_actors[@actor_id]
  #  @exp_list[1] = 0
  #  pow_i = 2.4 + actor.exp_inflation / 100.0
  #  for i in 2..100
  #    if i > actor.final_level
  #      @exp_list[i] = 0
  #    else
  #      n = actor.exp_basis * ((i + 3) ** pow_i) / (5 ** pow_i)
  #      @exp_list[i] = @exp_list[i-1] + Integer(n)
  #    end
  #  end
  #end
    def make_exp_list
    actor = $data_actors[@actor_id]
    @exp_list[1] = 0
    for i in 2..100
      if i > actor.final_level
        @exp_list[i] = 0
      else
        @exp_list[i] = ((i -1)*(i + 1))*(actor.exp_inflation - 9)
      end
    end
  end

Maybe you can learn something from it.

Here's something a bit more messy someone else showed me...
Code: [Select]
  #--------------------------------------------------------------------------
  # * Calculate EXP EDITS BEGIN HERE!!!
  #--------------------------------------------------------------------------

 
    def actor_exp_rates(level)
    case @class_id
#==============================================================================
#   ** Config **
#==============================================================================
# Follow this template for your actors in your game to set their exp.
    when 0 # Class ID
      exp = { # Exp for levels
      2 => 30,  # A => B
      3 => 40,  # A is level
      4 => 50   # B is EXP needed
      }
      return exp[level]
    when 1
      exp = {   # Because the levels 3 and 5 are not set here, the script will
      2 => 45,  # get the default values from the default settings.
      4 => 73,  # if the default setting is not set it will return 0 and the
      6 => 83   # actor will not be allowed to level up past that point.
      }
      return exp[level]
      when 4
      exp = { 1 => 0,
      2 => 1250,
      3 => 2500,
      4 => 5000,
      5 => 10000,
      6 => 20000,
      7 => 40000,
      8 => 70000,
      9 => 110000,
      10 => 160000,
      11 => 220000,
      12 => 440000,
      13 => 660000,
      14 => 880000,
      15 => 1100000,
      16 => 1320000,
      17 => 1540000,
      18 => 1760000,
      19 => 1980000,
      20 => 2200000,
      21 => 2420000,
      22 => 2640000,
      23 => 2860000,
      24 => 3080000,
      25 => 3300000,
      26 => 3520000,
      27 => 3740000,
      28 => 3960000,
      29 => 4180000,
      30 => 4400000
      }
      return exp[level]
            when 11
      exp = { 1 => 0,
      2 => 2500,
      3 => 5000,
      4 => 10000,
      5 => 20000,
      6 => 40000,
      7 => 60000,
      8 => 80000,
      9 => 125000,
      10 => 200000,
      11 => 350000,
      12 => 650000,
      13 => 950000,
      14 => 1250000,
      15 => 1550000,
      16 => 1850000,
      17 => 2150000,
      18 => 2450000,
      19 => 2750000,
      20 => 3050000
      }
      return exp[level]
      else # These are the default exp requirements, if the actor id is not set
      # the required exp will be set to these values.
      exp = { 1 => 0,
         2 => 2000,
      3 => 4000,
      4 => 8000,
      5 => 16000,
      6 => 32000,
      7 => 64000,
      8 => 125000,
      9 => 250000,
      10 => 500000,
      11 => 750000,
      12 => 1000000,
      13 => 1250000,
      14 => 1500000,
      15 => 1750000,
      16 => 2000000,
      17 => 2250000,
      18 => 2500000,
      19 => 2750000,
      20 => 3000000
      }
      return exp[level]
#==============================================================================
#   ** End Config **
#==============================================================================
    end
  end
 
  def get_exp_needed(level)
    exp = actor_exp_rates(level)
    exp = actor_exp_rates(level) if exp == nil
    exp = 0 if exp == nil
    return exp
  end

  def make_exp_list
    actor = $data_actors[@actor_id]
    @exp_list[1] = 0
    for i in 2..100
      if i > actor.final_level
        @exp_list[i] = 0
      else
        @exp_list[i] = get_exp_needed(i)
      end
    end
  end


plus this in the same Game_Actor, which I seem to recall was missing from the original...

Code: [Select]
  #--------------------------------------------------------------------------
  # * Change Class ID EDITED BY SHINTASHI
  #     class_id : new class ID
  #--------------------------------------------------------------------------
  def class_id=(class_id)
    if $data_classes[class_id] != nil
      @class_id = class_id
      make_exp_list #new by shintashi
      # Remove items that are no longer equippable
      unless equippable?($data_weapons[@weapon_id])
        equip(0, 0)
      end
      unless equippable?($data_armors[@armor1_id])
        equip(1, 0)
      end
      unless equippable?($data_armors[@armor2_id])
        equip(2, 0)
      end
      unless equippable?($data_armors[@armor3_id])
        equip(3, 0)
      end
      unless equippable?($data_armors[@armor4_id])
        equip(4, 0)
      end
    end
  end