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.

[XP/VX] Ability Grid

Ability Grid

I've decided to create an ability grid.  I got the inspiration from Final Fantasy X's Sphere Grid by Square Enix, so I feel I should credit them.  This is made almost completely with events.  The only things that require scripts are optional.

Demos/Resources:
Ability Grid (XP)
Ability Grid (VX)

Instructions:
This requires a little work on your part, but it is completely customizable to your liking.

1. Export TileE from the resource manager in the demo, then import it to the game you want to use it in.  These tiles are essential to using the system, but can be replaced by your own or other graphics if you so desire.

2. Create a variable to be used as the party's AP.

3. Create maps for each character's ability grid, like you'll see I did in the demo.  I used a parallax for the background.

4. Arrange the tiles based on how you want each character to advance.  I added the tiles as graphics, but you can put them in the events if you want.  For RMXP, you must make one of the invisible tiles unpassable and encircle the ability grid with it in the third layer to prevent the player from being able to walk anywhere.

5. Create a single tile event.  You can follow my outline, or you can edit it however you'd like.

6. Copy that tile and paste it on one of each kind of tile.  Then, edit those tiles for their respective advancements and copy and paste them to each of their similar tiles.  This is much easier than creating each event individually.

7. Don't forget to include a way out of the grid!  You can use whatever you want to teleport you out.  I used a magic circle since that was easiest.

8. Create an event that teleports the characters to their respective grids.

Optionals:
Ability Crystal - this item increases the AP of the party by a certain amount.
________________________________________

Grid Key - this will unlock the locks on an ability grid.
________________________________________

Increase Party AP with Each Level Gained - this small script increases a variable each time a character levels up.

XP:
Go to Game_Actor in the script editor and find line 462 (@level += 1).  Create a new line below this by clicking on the end of line 462 and pressing Enter.  Paste this script into the new line:
Code:
$game_variables[id] += value
Change "id" to whatever the id of the variable is and change "value" to the amount you want to increase it by with each level.

VX:
Go to Game_Actor in the script editor and find line 525 (level_up).  Create a new line below this by clicking on the end of line 525 and pressing Enter.  Paste this script into the new line:
Code:
$game_variables[id] += value
Change "id" to whatever the id of the variable is and change "value" to the amount you want to increase it by with each level.
________________________________________

Increase Individual AP with Each Level Gained - this script increases AP for individual party members each time they level up.  No work is required to change this, but you must be aware that the variable that is used for a character's AP corresponds to their ID in the database.  EX: If Ralph (ID: 001) levels up by 1, Variable 001 will increase by 1.

XP:
Insert in a new section above main.
Code:
class Game_Actor

  def exp=(exp)
    @exp = [[exp, 9999999].min, 0].max
    # Level up
    while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
      @level += 1
      # increment the corresponding game variable
      $game_variables[@actor_id] += 1
      # Learn skill
      for j in $data_classes[@class_id].learnings
        if j.level == @level
          learn_skill(j.skill_id)
        end
      end
    end
    # Level down
    while @exp < @exp_list[@level]
      @level -= 1
    end
    # Correction if exceeding current max HP and max SP
    @hp = [@hp, self.maxhp].min
    @sp = [@sp, self.maxsp].min
  end
end

VX:
Insert in a new section above (Insert here) under materials.
Code:
class Game_Actor
  def level_up
    @level += 1
    # increment the corresponding game variable
    $game_variables[@actor_id] += 1
    for learning in self.class.learnings
      learn_skill(learning.skill_id) if learning.level == @level
    end
  end
end
________________________________________

HUD - This script works in both XP and VX.  It will display the variable used for a character in their ability grid.  In XP, place this in a new section above Main.  In VX, place it in a new section under (Insert here) in the Materials category.  Just replace the Map IDs (top and bottom of script) and the Variable IDs (top of script).

Code:
#==============================================================================
# ** Window_AP
#------------------------------------------------------------------------------
#  This class creates the window and writes the current "AP".
#  You can customize all the "Grid.." ID's and "Variable.." variables
#  so they suit you. here are some instructions:
#
#  Grid_One   - The ID of the first Ability Grid.
#  Grid_Two   - The ID of the second Ability Grid.
#  Grid_Three - The ID of the third Ability Grid.
#  Grid_Four  - The ID of the fourth Ability Grid.
#
#  Set all the "Grid.." variables to the ID's of your four Ability Grid map's.
#  
#
#  VariableOne   - The id of the variable for "Grid_One".
#  VariableTwo   - The id of the variable for "Grid_Two".
#  VariableThree - The id of the variable for "Grid_Three".
#  VariableFour  - The id of the variable for "Grid_Four".
#
#  Example: When the player is on the "Grid_One"'s map ID, it will show the
#           "VariableOne"'s value, and when the player is on "Grid_Two"'s
#           map ID, it will show the "VariableTwo"'s value.
#
#==============================================================================
class Window_AP < Window_Base
  # The map ID's of the Ability Grids.
  Grid_One = 1
  Grid_Two = 4
  Grid_Three = 0
  Grid_Four = 0
  
  VariableOne = 1
  VariableTwo = 4
  VariableThree = 0
  VariableFour = 0
  #--------------------------------------------------------------------------
  # * Initialize
  #--------------------------------------------------------------------------
  # Self.opacity - This is the opacity of the window, you can change this
  #                to whatever you want between 0-255. 
  #                0 = Fully transparent 
  #                255 = opaque                             
  # 
  # Self.visible - This will make the window invisible as default. 
  #                So that the HUD won't show on every map.
  #               
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 200, 70)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 150
    self.visible = false
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  #  This will display the "Current AP:" text, and the variables of the 
  #  Party members based on which map the player is on. 
  #  You can change the "Current AP" text to whatever you want,
  #  but the rest you should keep as it is.
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    reset_variables
    self.contents.draw_text(0, 0, 100, 32, "Current AP:", 0)
  if $game_map.map_id == Grid_One
    self.contents.draw_text(120, 0, 32, 32, @variableone.to_s, 0)
  else if $game_map.map_id == Grid_Two
    self.contents.draw_text(120, 0, 32, 32, @variabletwo.to_s, 0)
  else if $game_map.map_id == Grid_Three
    self.contents.draw_text(120, 0, 32, 32, @variablethree.to_s, 0)
  else if $game_map.map_id == Grid_Four
    self.contents.draw_text(120, 0, 32, 32, @variablefour.to_s, 0)
  end
  end
  end
  end
  end
  def reset_variables
   @variableone = $game_variables[VariableOne]
   @variabletwo = $game_variables[VariableTwo]
   @variablethree = $game_variables[VariableThree]
   @variablefour = $game_variables[VariableFour]
  end
  def update
    super
    refresh if (@variableone = $game_variables[VariableOne] or
                @variabletwo = $game_variables[VariableTwo] or
                @variablethree = $game_variables[VariableThree] or
                @variablefour = $game_variables[VariableFour])
  end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  This will add the HUD in Scene_Map.
#
#  Grid_One   - The ID of the first Ability Grid.
#  Grid_Two   - The ID of the second Ability Grid.
#  Grid_Three - The ID of the third Ability Grid.
#  Grid_Four  - The ID of the fourth Ability Grid.
#
#  NOTE: the numbers in these variables "Grid_One", "Grid_Two", etc. 
#        Should be the same as the ones in the beginning of this script.
#
#
#  This will make the HUD visible whenever the player is in any of the four
#  "Grid.." map ID's.
#
#==============================================================================
class Scene_Map
  # The map ID's of the Ability Grids.
  Grid_One = 1
  Grid_Two = 4
  Grid_Three = 0
  Grid_Four = 0
  alias yourhud_main main
  alias yourhud_update update
  def main
    @yourhud = Window_AP.new
    yourhud_main
    @yourhud.dispose
  end
  def update
    if ($game_map.map_id == Grid_One or 
        $game_map.map_id == Grid_Two or 
        $game_map.map_id == Grid_Three or 
        $game_map.map_id == Grid_Four)
      @yourhud.visible = true
    else
      @yourhud.visible = false      
    end
    @yourhud.update
    yourhud_update
  end
end
________________________________________

Ability Grid access through menu (VX only) - Dargor has generously agreed to help me create this script, but I'm not going to post it here because of its length.  You can find it in the demo, though.
________________________________________

Ability Grid appears in menu after a switch is turned on - In Dargor's script, named Ability Grid in the demo, search for the method "create_command_window" and replace that whole method with this:
Code:
 def create_command_window
    commands = $game_system.menu_commands
  if $game_switches[1] == true
    $game_system.add_menu_command(commands.size-1, Vocab::AbilityGrid)
  end
    dargor_vx_ag_menu_create_command_window
  end

Just change the number in "$game_switches[1]" to the ID of the switch that you wish to have activate the ability grid menu command.

Notes:
*You can replace the ability grid with teachers that would increase a character's stats and give them abilities.

Credit:
Please give credit to the following people:
Marpy for helping me with obtaining scripts and giving me some very good suggestions.
Gando for creating the Increase Party AP with Each Level Gained script, the Variable HUDs, and the script edit that allows access to the Ability Grid through the menu after a switch is turned on.
Brewmeister for creating the Increase Individual AP with Each Level Gained script.
Dargor for creating the menu script.
Me for creating the events and tileset.
(If I forgot anyone, please PM me so I can add you to the list.)

If you have any questions, comments, or problems, feel free to PM me or post in this thread.
 
A new option has been added which allows each character to have separate AP, which will increase when the corresponding character levels up.  All credit for this script should go to Brewmeister.
 
I've finally gotten around to creating an XP demo, and I updated the VX demo so it now contains the ability grid option in the menu.  Please keep in mind that you need Dargor's Custom Commands script to use the Ability Grid script he created.  The only problem that has arisen is that the player is transferred before the map reappears after leaving the ability grid, which means the player can walk a step before the menu pops up.  We're working on this, and I'll post the update when it's fixed.  I won't include the ability grid menu script in this post since it's long and would take up a lot of room.  It shouldn't take too long to download the demo and get it from that.  Just make sure you credit Dargor for this! :thumb:
 
Hi there, first of all i have to say great system! I was looking for something like this since i love the ability grid in FFX. Thanks! :thumb:
But here's a problem (This will probably be very easy to solve but i don't know anything about scripting in RPG-maker)
In my project the hero will start out as a student and about 10 minutes into the game he will achieve his powers and change class. This means that i don't want the Ability Grid to be showable unless a special switch is on.
Could you please help me?
 
Well, you have two options.  You can either disable the menu access until you want him to be able to access the ability grid, or I try and get a script to make it appear after a switch is turned on.  If you want the second one, it may take a little while for me to get it.
 
I would like the second one if not too much trouble :smile: i've got plenty of time for that btw, no rush.
You can be ensured to see your name amongst my credits :thumb:
 
You guys are talking about the Dargor's menu script right?
I mean, you want to make it so the Ability Grid access from the menu is only available when a certain switch is on?

Well, if that is the case, in Dargor's script, (named "Ability Grid" in the demo),  search for the method "create_command_window" and replace that whole method with this:
Code:
  def create_command_window
    commands = $game_system.menu_commands
  if $game_switches[1] == true
    $game_system.add_menu_command(commands.size-1, Vocab::AbilityGrid)
  end
    dargor_vx_ag_menu_create_command_window
  end

You can change the number in "$game_switches[1]" to the id of the switch that you wish to have.
Now, after 10 minutes in the game, you turn the switch on, and the Ability Grid choise will show up in the menu.
Hope that helps! :thumb:

Over and out - Gando
 
Looks good. I like it! I might use this in my game...

By the way, your in your signature, when I click on "Ability Grid," it takes me to w ww.rmxp.borg/forums/index.php?topic=44564.0

You might want to change that!  :thumb:

Anyways, nice job!
 
When I copy and paste the script from the demo, I can't access my menu (in game) because of an error on line 168. It works fine UNTIL I take it out of the demo then I get an error message and the game closes.
 
You just need to go through the setup in the script and change the IDs for the maps and map IDs.

Code:
#==============================================================================
# ** Ability Grid Setup
#==============================================================================
module Ability_Grid
  # The Ability Grid map id
  # SYNTAX: actor_id => map_id
  Maps = {
          1 => 1
         }
  # The initial position on the Ability Grid map id
  # SYNTAX: actor_id => [x,y]
  Position = {
              1 => [10,10]
             }
end

You need to change the first set using the format Actor ID => Map ID and the second set with the format Actor ID => Map Coordinates.  If you change this to your own settings, it should work.
         
 
I love how you release all of your scripts for RMXP and RMVX.  :thumb: Most of the time I see a script I like, but it is only for XP. By the way, I also use your ability grid script, too! I will credit you and if/when I sell my game, which isn't likely, I will talk to you about any payment.

*EDIT1* Weird, anyone know how to fix my signature?
 
hey thanks nice tut you got here i'm still tring to figure out how to do some of the things in here but it is a nice tut tho. Well come in handy for my game.
 
Absolutely gorgeous setup. its fantastic. just wanna let you know about your demo (XP). the lock events are set to action button rather than player touch and your chest doesn't give you a key.

also just some suggestions just for lazy convenience, you don't need to jump to this right away or anything.

It would be nice that the chest gives you as many keys as you action button for and the fairy gives you more than one AP at a time.

but this is great thank you for pulling this together!
 
I did the XP version rather quickly, so I'm not surprised, but thanks for pointing those errors out.  I'm currently concentrating on my own game, so I've kind of halted all work on other small projects.  I'll probably eventually fix the demo, but probably not for a little while.
 

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