Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

in desperate need of help with a limit breaking script

Hi all

This is my first time posting. I've recently been trying to learn scripting but this stuff is hard. I'd like to break actor and enemy limits so I can get stats similar to those in the Star Ocean games and I've found a script that apparently works but it won't for me. I've been messing with it for about a week and nothing I try works. I put this in at the top of "Main" but maybe it belongs elsewhere. Can someone tell me where this script goes and how to use it properly? Or even if there's an easier to use script for RMXP?

Code:
#==============================================================================

#  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

 

Hopefully someone out there can tell me what I'm doing wrong. As you can see, there's not really any instructions on how to use this or where to put it. Or maybe the coding itself is enough of a hint to someone who knows how to do this sort of thing? lol :cry:

Once I get this script stuff out of the way I can move on to making my own spells (using 3DSMax, Particle Illusion and Adobe Premiere) and I plan on uploading a batch of spells for you guys when they are done.

I heard about some KGC Limit Break script but I can only find it for VX and I'm using XP :crazy:

Oh and happy holidays to everyone :D :toot: :thumb:
 
I have no idea what you're doing wrong. The script definitely goes above Main and not elsewhere. What exactly isn't working for you? Now, I have a present for you.

Introduction to Ruby

Ruby is a dynamic, reflective, general purpose object-oriented programming language. Every data type is an object, including classes. Every function is a method.

An object is a data structure consisting of data fields and methods. A class is a collection of objects, and an object itself. These two concepts are essential paradigms of data encapsulation. Finally, a method is a function which allows you to access data. With methods, you can retrieve or modify data contained in objects.

The way this usually works is writing a class and writing methods inside the class.

Person Example

The following code defines a class named Person. The class has three methods: initialize, set_age and get_age. The first method, initialize, creates the new objects, two instance variables named "name" and "age". That is to say, each Person object you create will have an initial "name" and "age. The second method, set_age, modifies the "age" variable. The third method, get_age, retrieves the age variable.

Ruby:
class Person

  attr_reader :name

  attr_reader :age

 

  def initialize(name, age)

    @name = name

    @age = age

  end

 

  def set_age(new_age)

    @age = new_age

  end

 

  def get_age

    return @age

  end

end

Configuring the Script

The variables at the beginning of the script with the "$" are global variables. In other words, these variables can be accessed in any script. You should only modify these variables and the following methods: final_level, max_hp, max_sp, max_str, max_dex, max_agi and max_int.

The following code takes your actor ID number and branches accordingly. When 1, it means you're actor number one. When 2, you're actor number two, and so on. This way, you can have different values for your different characters.

Ruby:
case self.id

when 1

  dex = 9999

when 2

  dex = 9999

when 8

  dex = 9999

else

  dex = $MAX_DEX

end

return dex

I hope this was helpful.
 
What exactly isn't working for you?
I can't break any limits, when I try to go over 999 for any stat the game tells me I have to keep it under 999.

Now, I have a present for you.
yayyyyy christmas gift ^_^ :cute:

ok at first glance that looks like it's confusing, but I'll check it later on in the day when I have time to actually sit and concentrate on it :) Thanks.

does color of text mean anything in scripting? because that little code you wrote at the bottom is from the script I need help with, but the colors of the numbers are different and how come your $MAX_DEX is red while mine is black?
 
Colors mean everything when scripting. It's an easy way to distinguish components. It also varies from editor to editor. My code is in colors because when posting I used the tag "code=ruby". Try it out.

In this case, colors have the following meanings.
  • Purple. Modules, classes and methods.
    Red. Instance variables and global variables.
    Light blue. Other variables.
    Dark blue. Keywords.
    Light green. Comments.
    Dark green. Data.
 
oh ok, I think I'm getting it.

so
"when 1
dex = 9999"
means actor 1 and by default it would be the blond dude with the sword.
Still, it won't let me go over 999 on anything. maybe i'm doing it wrong? I'm trying to set stat limits in the curve editor for their levels.

I've been reading up on this for a bit and I think I'm getting the hang of this stuff.
when (purple)- its a method and it's saying "when using [insert data number here for class,actor,enemy,troop, etc]"
dex- this one shows up black so i don't know what black text means :P but I'll assume it's saying the stat "dex"
9999-is data, but it can be altered unlike other types of variables?

and all together it's saying "when using [ actor number] set his [dex] to [9999]"?


so would $MAX_DEX 1 = 9999 work? or $Actor 1.max_dex = 9999 ?
I saw stuff like that for other scripts but never really understood it.
 
case example

Ruby:
case $age

when 0 .. 2

  "baby"

when 3 .. 6

  "little child"

when 7 .. 12

  "child"

when 13 .. 18

  "youth"

else

  "adult"

end

case expressions execute branching for a single expression via matching. A when clause compares the value specified to the evaluated result of the first expression. When the values match, it evaluates the contents of the when clause. case returns the result of the last evaluated expression in a conditional when (or else) clause. If neither condition is in effect, returns nil.

In your case, you are branching "self.id", where "self" refers to the Game_Actor class and, by definition, a party member, and "id" refers to an instance variable which holds the character ID number. Alexis is ID 1, Basil is ID 2, and so on.

"level", "hp", "sp", "str", "dex", "agi" and "int" are also instance variables which hold character data. Changing these variables will not inherently affect the max values. The max values are not variables. The max values are methods. Methods are defined the following syntax.

Ruby:
def method_name

  # Method content

end

As I've stated before, a method is a function which allows you to access data. With methods, you can retrieve or modify data contained in objects. In such case, you are using methods to retrieve data with the return exit.

Various methods, such as max_hp and max_sp, determine the max values. The script you borrowed rewrites these methods. The script also uses global variables, such as "$MAX_HP" or "$MAX_SP", to easily determine the max values for all characters. However, it also grants you the possibility to determine a different max value for each character.

My personal advice: leave the script alone and only change the global variables at the beginning of the script. Paste above Main.
 
I think I'm going to just give up on scripting for now. It doesn't work, if colors mean everything then something is horribly wrong with the script I borrowed because the "$" aren't red and "case" and "when" aren't purple. The majority of the text is black so I guess something with the script itself isn't working or something is wrong with my rpg maker. :pissed:

I even tried pasting your examples just to see if the script shows up properly and it still shows up mostly black text. I think this is more of a "my rpg maker is screwing up on me" problem than a "this script isn't working" problem. It seems the script itself is fine and should work but it just isn't.

I'll just stick to doing the artsy stuff for now and look for KGC's Limit Break script for RMXP (or try to, that script is hard to find).

Thanks for the help anyways medinastories, much appreciated :thumb: , I'm understanding what you're saying now but I guess the problem roots deeper than the script. If anyone still wants to help it's welcomed and appreciated and I'll try any suggestions but I think my copy of RPG Maker XP is the problem, not the script. :cry:
 
Oh, no. The color-coding here is slightly different from that of the RM Script Editor, so don't worry if it appears differently. Your editor is likely fine.

Did you make sure to paste the code in a new, blank section, above Main? To do that, rightclick->Insert above Main.

For customizing the script itself, you just edit the areas with lists. The comments should guide you with what to edit.

In the long run, if you plan on using a lot of scripts, learning RGSS (or the basics of any programming language) is the best way to go. Trust me, relying on others for help won't benefit your gammaking. Best of luck, anyhow!
 
hey guys did you miss me? :P
I'm back from christmas festivities

Yep, I pasted it into a blank section about Main. Overall, I don't know what the problem is because that script is supposed to work when you paste it. Either way, I'm going to take your advice and read up on RGSS. I don't know how that will go though, I have a hard time understanding computer coding stuff and I suck at math XD. That's why I took art in college, no math needed :haha:

I found a thread on here with a bunch of compiled RGSS tutorials and whatnot so I'm gonna read that for the day


thanks for the help Regi :biggrin:
 
Maybe the script isn't working. Who knows. I would try another script if I were you. Heck, I would start with something simpler.

Look, you can't learn how to ride a bicycle by reading about it. You need to write your own scripts. Otherwise, you'll never learn. I suggest opening a new project, and modifying the default RPG Maker XP scripts. Start with the class Scene_Title. Personally, I've never read an Ruby tutorial in my life, and I know how to script better than many people in this community.

Another word of advice, RPG Maker XP comes with many hidden default classes. You can't modify these, but you can read about them if you go to Help, Table of Contents..., or press the F1 key. Open the book RGSS Reference Manual. It's better than most tutorial out there, it comes with lots of examples, and it's easy to read.
 
medinastories":3jr3bnr5 said:
Another word of advice, RPG Maker XP comes with many hidden default classes. You can't modify these, but you can read about them if you go to Help, Table of Contents..., or press the F1 key. Open the book RGSS Reference Manual. It's better than most tutorial out there, it comes with lots of examples, and it's easy to read.

Actually, you can modify any of the hidden classes, including the ones that are just masks for C++ code hidden away in the RGSS102e.dll file. It's just a matter of figuring out what really needs to be edited and minimizing the expected slowdown you get from adding Ruby code to process with the much faster C++. (Or from replacing it altogether, like some scripts do. And by some scripts, I mean stuff like SephirothSpawn's Tilemap, or stuff like the script that allows you to "edit" the default window class by replacing it.)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top