FamilyGamer7

Veteran
Veteran
Joined
Jan 4, 2021
Messages
33
Reaction score
6
First Language
English
Primarily Uses
RMVXA
I am currently working on a game project and have took a step back to see what scripts I can create/implement on my own. I am trying not to use custom scripts if it can be helped. In my current project, I am using "Victor Saint - MP Level" scripts to provide MP type levels as seen in games like the first Final Fantasy, Suikoden and Grandia. But, I have taken a stab at my own implementation to simulate this script.

The issue I am running into is once each individual skill usage reaches "0", it needs to disabled from being used from the menu and in battle. I have my current in progress script below to take a look at. Yes, I understand my approach may not be the best and I am sure it can be approved on. Feel feel to modify and show me a better way.

But, I ultimately just want to correctly disable the skill once it reaches a usage of "0".
*I am also using "Hime - Tag Manager" script to help with this implementation and my project as a whole.

Script referenced...
=> Victor Saint - MP Level: https://victorenginescripts.wordpress.com/rpg-maker-vx-ace/mp-level/

Script being used in my script below...
=> Hime - Tag Manager: https://himeworks.com/2013/03/tag-manager/

*I have attached a demo project to work with to make these a bit more simple. The following below are the steps to get to where I am at now:
  1. Start game and select the chest box to open and gain items + variable changes.
  2. Attach the magic "Fire" armor to either the slot "FH., RW., or LW." and you will gain the fire skills "fire" and "fire II".
  3. Before going to the skill scene, run around a little to have your party hurt by poison so you can be healed by the "fire" skill.
  4. Go into the skill scene and select an actor to use the skill to heal HP. You will notice, once the skill reaches "0", the MP Level 1 magic will turn 0 as well from being used.
  5. At this point, when the usage is at "0"... the skill should become inactive and disabled from being used until the MP Level 1 has been recovered to max mp. Currently, it keeps allowing you to based on the "original mp" setup. This is the part of my script that needs to be tweaked.

Ruby:
=begin
#===============================================================================
# Title: JRPG MP Levels
# Author: FamilyGamer7
# Date: ??????
#===============================================================================
# ** Description |
# ----------------
# The ability to avoid using external scripts and manipulate the default engine
# and variables to simulate MP Levels from the class jRPG games.
# (Script is still work in progress)
#===============================================================================
# ** Terms of Use |
# -----------------
# * Free to use in non-commercial projects and commercial projects
# * As is script - For Advanced Users
# * No credit Needed
#===============================================================================
=end

#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles parties. Information such as gold and items is included.
# Instances of this class are referenced by $game_party.
#==============================================================================

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * New Methods: Creates Actor MP level (Ex: 0 / 0 / 0 / 0)
  #--------------------------------------------------------------------------
  # Actor 1 - Sets up MP Level in an array (With Variables)
  def actor_mp_levels_actor1
    return [$game_variables[900], $game_variables[901], $game_variables[902], $game_variables[903]]
  end
  # Actor 2 - Sets up MP Level in an array (With Variables)
  def actor_mp_levels_actor2
    return [$game_variables[904], $game_variables[905], $game_variables[906], $game_variables[907]]
  end
  # Actor 3 - Sets up MP Level in an array (With Variables)
  def actor_mp_levels_actor3
    return [$game_variables[908], $game_variables[909], $game_variables[910], $game_variables[911]]
  end

end

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

class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw MP
  #--------------------------------------------------------------------------
  def draw_actor_mp(actor, x, y, width = 124)

    # Check if Actor 1 - Draws MP Levels
    if actor.id == 1
      draw_text(x + 18, y, 350, line_height, $game_party.actor_mp_levels_actor1[0])
      draw_text(x + 51, y, 350, line_height, $game_party.actor_mp_levels_actor1[1])
      draw_text(x + 85, y, 350, line_height, $game_party.actor_mp_levels_actor1[2])
      draw_text(x + 118, y, 350, line_height, $game_party.actor_mp_levels_actor1[3])
    end
   
    # Check if Actor 2 - Draws MP Levels
    if actor.id == 2
      draw_text(x + 18, y, 350, line_height, $game_party.actor_mp_levels_actor2[0])
      draw_text(x + 51, y, 350, line_height, $game_party.actor_mp_levels_actor2[1])
      draw_text(x + 85, y, 350, line_height, $game_party.actor_mp_levels_actor2[2])
      draw_text(x + 118, y, 350, line_height, $game_party.actor_mp_levels_actor2[3])
    end
   
    # Check if Actor 3 - Draws MP Levels
    if actor.id == 3
      draw_text(x + 18, y, 350, line_height, $game_party.actor_mp_levels_actor3[0])
      draw_text(x + 51, y, 350, line_height, $game_party.actor_mp_levels_actor3[1])
      draw_text(x + 85, y, 350, line_height, $game_party.actor_mp_levels_actor3[2])
      draw_text(x + 118, y, 350, line_height, $game_party.actor_mp_levels_actor3[3])
    end

    draw_text(x + 36, y, 350, line_height, "/")
    draw_text(x + 69, y, 350, line_height, "/")
    draw_text(x + 103, y, 350, line_height, "/")
    draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::mp_a)
  end
end

#==============================================================================
# ** Window_SkillList
#------------------------------------------------------------------------------
#  This window is for displaying a list of available skills on the skill window.
#==============================================================================

class Window_SkillList < Window_Selectable
  #--------------------------------------------------------------------------
  # * Get Activation State of Selection Item
  #--------------------------------------------------------------------------
  def current_item_enabled?
    enable?(@data[index])
    # I am stuck here. I know this controls the actual skill/item to disable
    # it from being used.
  end
  #--------------------------------------------------------------------------
  # * Display Skill in Active State?
  #--------------------------------------------------------------------------
  def enable?(item)
    @actor && @actor.usable?(item)
    # I am stuck here as well. I know this controls the color of its active
    # state to appear disabled.
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    if skill
      rect = item_rect(index)
      rect.width -= 4
      draw_item_name(skill, rect.x, rect.y, enable?(skill))
      draw_skill_cost(rect, skill)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Skill Use Cost
  #--------------------------------------------------------------------------
  def draw_skill_cost(rect, skill)

    # Check if Actor 1
    if @actor.id == 1
      # Checks for Skill Tag "Lv1"
      if skill.tags[0] != nil && skill.tags[0].include?("lv1")
        draw_text(rect, $game_party.actor_mp_levels_actor1[0], 2)
      end
      # Checks for Skill Tag "Lv2"
      if skill.tags[0] != nil && skill.tags[0].include?("lv2")
        draw_text(rect, $game_party.actor_mp_levels_actor1[1], 2)
      end
      # Checks for Skill Tag "Lv3"
      if skill.tags[0] != nil && skill.tags[0].include?("lv3")
        draw_text(rect, $game_party.actor_mp_levels_actor1[2], 2)
      end
      # Checks for Skill Tag "Lv4"
      if skill.tags[0] != nil && skill.tags[0].include?("lv4")
        draw_text(rect, $game_party.actor_mp_levels_actor1[3], 2)
      end
    end
   
    # Check if Actor 2
    if @actor.id == 2
      # Checks for Skill Tag "Lv1"
      if skill.tags[0] != nil && skill.tags[0].include?("lv1")
        draw_text(rect, $game_party.actor_mp_levels_actor2[0], 2)
      end
      # Checks for Skill Tag "Lv2"
      if skill.tags[0] != nil && skill.tags[0].include?("lv2")
        draw_text(rect, $game_party.actor_mp_levels_actor2[1], 2)
      end
      # Checks for Skill Tag "Lv3"
      if skill.tags[0] != nil && skill.tags[0].include?("lv3")
        draw_text(rect, $game_party.actor_mp_levels_actor2[2], 2)
      end
      # Checks for Skill Tag "Lv4"
      if skill.tags[0] != nil && skill.tags[0].include?("lv4")
        draw_text(rect, $game_party.actor_mp_levels_actor2[3], 2)
      end
    end
   
    # Check if Actor 3
    if @actor.id == 3
      # Checks for Skill Tag "Lv1"
      if skill.tags[0] != nil && skill.tags[0].include?("lv1")
        draw_text(rect, $game_party.actor_mp_levels_actor3[0], 2)
      end
      # Checks for Skill Tag "Lv2"
      if skill.tags[0] != nil && skill.tags[0].include?("lv2")
        draw_text(rect, $game_party.actor_mp_levels_actor3[1], 2)
      end
      # Checks for Skill Tag "Lv3"
      if skill.tags[0] != nil && skill.tags[0].include?("lv3")
        draw_text(rect, $game_party.actor_mp_levels_actor3[2], 2)
      end
      # Checks for Skill Tag "Lv4"
      if skill.tags[0] != nil && skill.tags[0].include?("lv4")
        draw_text(rect, $game_party.actor_mp_levels_actor3[3], 2)
      end
    end
   

  end
end

#==============================================================================
# ** Scene_ItemBase
#------------------------------------------------------------------------------
#  This class performs common processing for the item screen and skill screen.
#==============================================================================

class Scene_ItemBase < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Actor [OK]
  #--------------------------------------------------------------------------
  def on_actor_ok
    if item_usable?
      use_item
   
      # Checks for Actor 1 to use skill
      if @actor.id == 1
        # Checks for Skill Tag "Lv1"
        if item.tags[0].include?("lv1")
          $game_variables[900] -= 1
        end
        # Checks for Skill Tag "Lv2"
        if item.tags[0].include?("lv2")
          $game_variables[901] -= 1
        end
        # Checks for Skill Tag "Lv3"
        if item.tags[0].include?("lv3")
          $game_variables[902] -= 1
        end
        # Checks for Skill Tag "Lv4"
        if item.tags[0].include?("lv4")
          $game_variables[903] -= 1
        end
      end
     
      # Checks for Actor 1 to use skill
      if @actor.id == 2
        # Checks for Skill Tag "Lv1"
        if item.tags[0].include?("lv1")
          $game_variables[904] -= 1
        end
        # Checks for Skill Tag "Lv2"
        if item.tags[0].include?("lv2")
          $game_variables[905] -= 1
        end
        # Checks for Skill Tag "Lv3"
        if item.tags[0].include?("lv3")
          $game_variables[906] -= 1
        end
        # Checks for Skill Tag "Lv4"
        if item.tags[0].include?("lv4")
          $game_variables[907] -= 1
        end
      end
           
      # Checks for Actor 1 to use skill
      if @actor.id == 3
        # Checks for Skill Tag "Lv1"
        if item.tags[0].include?("lv1")
          $game_variables[908] -= 1
        end
        # Checks for Skill Tag "Lv2"
        if item.tags[0].include?("lv2")
          $game_variables[909] -= 1
        end
        # Checks for Skill Tag "Lv3"
        if item.tags[0].include?("lv3")
          $game_variables[910] -= 1
        end
        # Checks for Skill Tag "Lv4"
        if item.tags[0].include?("lv4")
          $game_variables[911] -= 1
        end
      end
     
    else
      Sound.play_buzzer
    end
  end

end
 

Attachments

  • Project 3.zip
    1.3 MB · Views: 3
Last edited:

FamilyGamer7

Veteran
Veteran
Joined
Jan 4, 2021
Messages
33
Reaction score
6
First Language
English
Primarily Uses
RMVXA
bump

*As mentioned, if someone has a better and more simple way of writing this script, then please go ahead.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,045
Reaction score
681
First Language
English
Primarily Uses
RMVXA
So, essentially you want to recreate Victor Sant's MP Levels. Why?
It works fine and is free to use.
Is there an issue with using the base module?
 

FamilyGamer7

Veteran
Veteran
Joined
Jan 4, 2021
Messages
33
Reaction score
6
First Language
English
Primarily Uses
RMVXA
So, essentially you want to recreate Victor Sant's MP Levels. Why?
It works fine and is free to use.
Is there an issue with using the base module?

Yes, I am trying to implement the same concept from his script, but try to simplify it with the default rpg maker vx ace engine. I am avoiding the script due to its basic module. I would like to avoid any additional "modules" and unnecessary scripts if need be.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,045
Reaction score
681
First Language
English
Primarily Uses
RMVXA
I would like to avoid any additional "modules" and unnecessary scripts
Well for VE MP Level the Basic Module is necessary. But if you are wanting to avoid using scripts, then that's your preference. I think the scripts work fine.
As I said if you are having an issue with the script, then tell us what the problem is and we can probably find a solution for it.
I'm not interested in rewriting a perfectly good functional script. To do so in my opinion would be to copy/paste.

What you have written so far is very inefficient, very constrained and clumsy. Even though it is basically working to a degree, the VE script has all the necessary parts completed. Including note tags to set the MP levels and consumption of levels. But I can see where using variables for the levels would be nice (to adjust them), I'd be more inclined to make an add on to make the levels adjustable for VE MP Levels. Probably with note tags for equipment or maybe items.
To rewrite what you have done would be basically me making the script. And I'm not that good at ruby yet. I just started the lesson on hashes.
If other ace scripters want to they may help.
I'm still very much in favor of using VE's MP Levels. So if you would like to tell me what the issue with it is, unless it really is just a preference.
Using VE Basic Module is not an issue, unless there is a problem with your project. I have 9 basic modules in my project. All of them work fine together.
 

FamilyGamer7

Veteran
Veteran
Joined
Jan 4, 2021
Messages
33
Reaction score
6
First Language
English
Primarily Uses
RMVXA
Well for VE MP Level the Basic Module is necessary. But if you are wanting to avoid using scripts, then that's your preference. I think the scripts work fine.
As I said if you are having an issue with the script, then tell us what the problem is and we can probably find a solution for it.
I'm not interested in rewriting a perfectly good functional script. To do so in my opinion would be to copy/paste.

What you have written so far is very inefficient, very constrained and clumsy. Even though it is basically working to a degree, the VE script has all the necessary parts completed. Including note tags to set the MP levels and consumption of levels. But I can see where using variables for the levels would be nice (to adjust them), I'd be more inclined to make an add on to make the levels adjustable for VE MP Levels. Probably with note tags for equipment or maybe items.
To rewrite what you have done would be basically me making the script. And I'm not that good at ruby yet. I just started the lesson on hashes.
If other ace scripters want to they may help.
I'm still very much in favor of using VE's MP Levels. So if you would like to tell me what the issue with it is, unless it really is just a preference.
Using VE Basic Module is not an issue, unless there is a problem with your project. I have 9 basic modules in my project. All of them work fine together.

As I know the VE - Basic Module is necessary for the MP Level script, i find it very unnecessary and feel it could be rewritten with using the default engine mechanics in mind. I wasn't technically asking for a rewrite, I was asking for assistance on what I wrote and once completed, I was going to rewrite my own script... to be efficient and ideally small in code/script wise. I only mentioned if someone wanted to write the script better and I would not object.

There are many scripts created that literally perform the same function but are written differently, so stating this is irrelevant.

I see you have PMed me and I appreciate you doing that. I will take a look at using that. But, I want to leave this request open for a little longer to see if someone can assist with the issue on my inefficient, very constrained, and clumsy script.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
3,045
Reaction score
681
First Language
English
Primarily Uses
RMVXA
leave this request open for a little longer to see if someone can assist with the issue on my inefficient, very constrained, and clumsy script.
Understood. Sorry if I seem harsh.
So, following along with what you have done so far; (I have some free time)
This works how you want it to.
Ruby:
=begin
#===============================================================================
# Title: JRPG MP Levels
# Author: FamilyGamer7
# Date: ??????
#===============================================================================
# ** Description |
# ----------------
# The ability to avoid using external scripts and manipulate the default engine
# and variables to simulate MP Levels from the class jRPG games.
# (Script is still work in progress)
#===============================================================================
# ** Terms of Use |
# -----------------
# * Free to use in non-commercial projects and commercial projects
# * As is script - For Advanced Users
# * No credit Needed
#===============================================================================
=end

#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles parties. Information such as gold and items is included.
# Instances of this class are referenced by $game_party.
#==============================================================================

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * New Methods: Creates Actor MP level (Ex: 0 / 0 / 0 / 0)
  #--------------------------------------------------------------------------
  # Actor 1 - Sets up MP Level in an array (With Variables)
  def actor_mp_levels_actor1
    return [$game_variables[900], $game_variables[901], $game_variables[902], $game_variables[903]]
  end
  # Actor 2 - Sets up MP Level in an array (With Variables)
  def actor_mp_levels_actor2
    return [$game_variables[904], $game_variables[905], $game_variables[906], $game_variables[907]]
  end
  # Actor 3 - Sets up MP Level in an array (With Variables)
  def actor_mp_levels_actor3
    return [$game_variables[908], $game_variables[909], $game_variables[910], $game_variables[911]]
  end

end

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

class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw MP
  #--------------------------------------------------------------------------
  def draw_actor_mp(actor, x, y, width = 124)
    return if actor.nil?
    if actor.id == 1
      draw_text(x + 18, y, 350, line_height, $game_party.actor_mp_levels_actor1[0])
      draw_text(x + 51, y, 350, line_height, $game_party.actor_mp_levels_actor1[1])
      draw_text(x + 85, y, 350, line_height, $game_party.actor_mp_levels_actor1[2])
      draw_text(x + 118, y, 350, line_height, $game_party.actor_mp_levels_actor1[3])
    end
    if actor.id == 2
      draw_text(x + 18, y, 350, line_height, $game_party.actor_mp_levels_actor2[0])
      draw_text(x + 51, y, 350, line_height, $game_party.actor_mp_levels_actor2[1])
      draw_text(x + 85, y, 350, line_height, $game_party.actor_mp_levels_actor2[2])
      draw_text(x + 118, y, 350, line_height, $game_party.actor_mp_levels_actor2[3])
    end
    if actor.id == 3
      draw_text(x + 18, y, 350, line_height, $game_party.actor_mp_levels_actor3[0])
      draw_text(x + 51, y, 350, line_height, $game_party.actor_mp_levels_actor3[1])
      draw_text(x + 85, y, 350, line_height, $game_party.actor_mp_levels_actor3[2])
      draw_text(x + 118, y, 350, line_height, $game_party.actor_mp_levels_actor3[3])
    end
    draw_text(x + 36, y, 350, line_height, "/")
    draw_text(x + 69, y, 350, line_height, "/")
    draw_text(x + 103, y, 350, line_height, "/")
    draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::mp_a)
  end
end

#==============================================================================
# ** Window_SkillList
#------------------------------------------------------------------------------
#  This window is for displaying a list of available skills on the skill window.
#==============================================================================

class Window_SkillList < Window_Selectable
  #--------------------------------------------------------------------------
  # * Get Activation State of Selection Item
  #--------------------------------------------------------------------------
  def current_item_enabled?
    enable?(@data[index])
        item = @data[index]
    return false unless enable?(item)
    actor = @actor
        if item.tags[0].include?("lv1")
            if actor.id == 1
                $game_party.actor_mp_levels_actor1[0] -= 1
            elsif actor.id == 2
                $game_party.actor_mp_levels_actor2[0] -= 1
            elsif actor.id == 3
                $game_party.actor_mp_levels_actor3[0] -= 1
            end
        elsif item.tags[0].include?("lv2")
            if actor.id == 1
                $game_party.actor_mp_levels_actor1[1] -= 1
            elsif actor.id == 2
                $game_party.actor_mp_levels_actor2[1] -= 1
            elsif actor.id == 3
                $game_party.actor_mp_levels_actor3[1] -= 1
            end
        elsif item.tags[0].include?("lv3")
            if actor.id == 1
                $game_party.actor_mp_levels_actor1[2] -= 1
            elsif actor.id == 2
                $game_party.actor_mp_levels_actor2[2] -= 1
            elsif actor.id == 3
                $game_party.actor_mp_levels_actor3[2] -= 1
            end
        elsif item.tags[0].include?("lv4")
            if actor.id == 1
                $game_party.actor_mp_levels_actor1[3] -= 1
            elsif actor.id == 2
                $game_party.actor_mp_levels_actor2[3] -= 1
            elsif actor.id == 3
                $game_party.actor_mp_levels_actor3[3] -= 1
            end
    end
  end
  #--------------------------------------------------------------------------
  # * Display Skill in Active State?
  #--------------------------------------------------------------------------
  def enable?(item)
    @actor && @actor.usable?(item)
    return false unless @actor && @actor.usable?(item)
    actor = @actor
        if actor.id == 1
      spell_class_one = $game_party.actor_mp_levels_actor1[0]
      spell_class_two = $game_party.actor_mp_levels_actor1[1]
      spell_class_three = $game_party.actor_mp_levels_actor1[2]
      spell_class_four = $game_party.actor_mp_levels_actor1[3]
            return true if item.tags[0].include?("lv1") and spell_class_one >= 1
            return true if item.tags[0].include?("lv2") and spell_class_two >= 1
            return true if item.tags[0].include?("lv3") and spell_class_three >= 1
            return true if item.tags[0].include?("lv4") and spell_class_four >= 1
    end
        if actor.id == 2
      spell_class_one = $game_party.actor_mp_levels_actor2[0]
      spell_class_two = $game_party.actor_mp_levels_actor2[1]
      spell_class_three = $game_party.actor_mp_levels_actor2[2]
      spell_class_four = $game_party.actor_mp_levels_actor2[3]
            return true if item.tags[0].include?("lv1") and spell_class_one >= 1
            return true if item.tags[0].include?("lv2") and spell_class_two >= 1
            return true if item.tags[0].include?("lv3") and spell_class_three >= 1
            return true if item.tags[0].include?("lv4") and spell_class_four >= 1
    end
        if actor.id == 3
      spell_class_one = $game_party.actor_mp_levels_actor3[0]
      spell_class_two = $game_party.actor_mp_levels_actor3[1]
      spell_class_three = $game_party.actor_mp_levels_actor3[2]
      spell_class_four = $game_party.actor_mp_levels_actor3[3]
            return true if item.tags[0].include?("lv1") and spell_class_one >= 1
            return true if item.tags[0].include?("lv2") and spell_class_two >= 1
            return true if item.tags[0].include?("lv3") and spell_class_three >= 1
            return true if item.tags[0].include?("lv4") and spell_class_four >= 1
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    if skill
      rect = item_rect(index)
      rect.width -= 4
      draw_item_name(skill, rect.x, rect.y, enable?(skill))
      draw_skill_cost(rect, skill)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Skill Use Cost
  #--------------------------------------------------------------------------
  def draw_skill_cost(rect, skill)
    if @actor.id == 1
      # Checks for Skill Tag "Lv1"
      if skill.tags[0] != nil && skill.tags[0].include?("lv1")
        draw_text(rect, $game_party.actor_mp_levels_actor1[0], 2)
      end
      # Checks for Skill Tag "Lv2"
      if skill.tags[0] != nil && skill.tags[0].include?("lv2")
        draw_text(rect, $game_party.actor_mp_levels_actor1[1], 2)
      end
      # Checks for Skill Tag "Lv3"
      if skill.tags[0] != nil && skill.tags[0].include?("lv3")
        draw_text(rect, $game_party.actor_mp_levels_actor1[2], 2)
      end
      # Checks for Skill Tag "Lv4"
      if skill.tags[0] != nil && skill.tags[0].include?("lv4")
        draw_text(rect, $game_party.actor_mp_levels_actor1[3], 2)
      end
    end
    if @actor.id == 2
      # Checks for Skill Tag "Lv1"
      if skill.tags[0] != nil && skill.tags[0].include?("lv1")
        draw_text(rect, $game_party.actor_mp_levels_actor2[0], 2)
      end
      # Checks for Skill Tag "Lv2"
      if skill.tags[0] != nil && skill.tags[0].include?("lv2")
        draw_text(rect, $game_party.actor_mp_levels_actor2[1], 2)
      end
      # Checks for Skill Tag "Lv3"
      if skill.tags[0] != nil && skill.tags[0].include?("lv3")
        draw_text(rect, $game_party.actor_mp_levels_actor2[2], 2)
      end
      # Checks for Skill Tag "Lv4"
      if skill.tags[0] != nil && skill.tags[0].include?("lv4")
        draw_text(rect, $game_party.actor_mp_levels_actor2[3], 2)
      end
    end
    if @actor.id == 3
      # Checks for Skill Tag "Lv1"
      if skill.tags[0] != nil && skill.tags[0].include?("lv1")
        draw_text(rect, $game_party.actor_mp_levels_actor3[0], 2)
      end
      # Checks for Skill Tag "Lv2"
      if skill.tags[0] != nil && skill.tags[0].include?("lv2")
        draw_text(rect, $game_party.actor_mp_levels_actor3[1], 2)
      end
      # Checks for Skill Tag "Lv3"
      if skill.tags[0] != nil && skill.tags[0].include?("lv3")
        draw_text(rect, $game_party.actor_mp_levels_actor3[2], 2)
      end
      # Checks for Skill Tag "Lv4"
      if skill.tags[0] != nil && skill.tags[0].include?("lv4")
        draw_text(rect, $game_party.actor_mp_levels_actor3[3], 2)
      end
    end
  end
end

#==============================================================================
# ** Scene_ItemBase
#------------------------------------------------------------------------------
#  This class performs common processing for the item screen and skill screen.
#==============================================================================

class Scene_ItemBase < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Actor [OK]
  #--------------------------------------------------------------------------
  def on_actor_ok
    if item_usable?
      empty = false
      if @actor.id == 1
        # Checks for Skill Tag "Lv1"
        if item.tags[0].include?("lv1")
          $game_variables[900] > 0 ? $game_variables[900] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv2"
        if item.tags[0].include?("lv2")
          $game_variables[901] > 0 ? $game_variables[901] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv3"
        if item.tags[0].include?("lv3")
          $game_variables[902] > 0 ? $game_variables[902] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv4"
        if item.tags[0].include?("lv4")
          $game_variables[903] > 0 ? $game_variables[903] -= 1 : empty = true
        end
      end
      if @actor.id == 2
        # Checks for Skill Tag "Lv1"
        if item.tags[0].include?("lv1")
          $game_variables[904] > 0 ? $game_variables[904] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv2"
        if item.tags[0].include?("lv2")
          $game_variables[905] > 0 ? $game_variables[905] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv3"
        if item.tags[0].include?("lv3")
          $game_variables[906] > 0 ? $game_variables[906] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv4"
        if item.tags[0].include?("lv4")
          $game_variables[907] > 0 ? $game_variables[907] -= 1 : empty = true
        end
      end
      if @actor.id == 3
        # Checks for Skill Tag "Lv1"
        if item.tags[0].include?("lv1")
          $game_variables[908] > 0 ? $game_variables[908] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv2"
        if item.tags[0].include?("lv2")
          $game_variables[909] > 0 ? $game_variables[909] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv3"
        if item.tags[0].include?("lv3")
          $game_variables[910] > 0 ? $game_variables[910] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv4"
        if item.tags[0].include?("lv4")
          $game_variables[911] > 0 ? $game_variables[911] -= 1 : empty = true
        end
      end
      if empty == true
        Sound.play_buzzer
      else
        use_item
        @item_window.refresh
      end
    else
      Sound.play_buzzer
    end
  end

end
 

FamilyGamer7

Veteran
Veteran
Joined
Jan 4, 2021
Messages
33
Reaction score
6
First Language
English
Primarily Uses
RMVXA
Understood. Sorry if I seem harsh.
So, following along with what you have done so far; (I have some free time)
This works how you want it to.
Ruby:
=begin
#===============================================================================
# Title: JRPG MP Levels
# Author: FamilyGamer7
# Date: ??????
#===============================================================================
# ** Description |
# ----------------
# The ability to avoid using external scripts and manipulate the default engine
# and variables to simulate MP Levels from the class jRPG games.
# (Script is still work in progress)
#===============================================================================
# ** Terms of Use |
# -----------------
# * Free to use in non-commercial projects and commercial projects
# * As is script - For Advanced Users
# * No credit Needed
#===============================================================================
=end

#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles parties. Information such as gold and items is included.
# Instances of this class are referenced by $game_party.
#==============================================================================

class Game_Party < Game_Unit
  #--------------------------------------------------------------------------
  # * New Methods: Creates Actor MP level (Ex: 0 / 0 / 0 / 0)
  #--------------------------------------------------------------------------
  # Actor 1 - Sets up MP Level in an array (With Variables)
  def actor_mp_levels_actor1
    return [$game_variables[900], $game_variables[901], $game_variables[902], $game_variables[903]]
  end
  # Actor 2 - Sets up MP Level in an array (With Variables)
  def actor_mp_levels_actor2
    return [$game_variables[904], $game_variables[905], $game_variables[906], $game_variables[907]]
  end
  # Actor 3 - Sets up MP Level in an array (With Variables)
  def actor_mp_levels_actor3
    return [$game_variables[908], $game_variables[909], $game_variables[910], $game_variables[911]]
  end

end

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

class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw MP
  #--------------------------------------------------------------------------
  def draw_actor_mp(actor, x, y, width = 124)
    return if actor.nil?
    if actor.id == 1
      draw_text(x + 18, y, 350, line_height, $game_party.actor_mp_levels_actor1[0])
      draw_text(x + 51, y, 350, line_height, $game_party.actor_mp_levels_actor1[1])
      draw_text(x + 85, y, 350, line_height, $game_party.actor_mp_levels_actor1[2])
      draw_text(x + 118, y, 350, line_height, $game_party.actor_mp_levels_actor1[3])
    end
    if actor.id == 2
      draw_text(x + 18, y, 350, line_height, $game_party.actor_mp_levels_actor2[0])
      draw_text(x + 51, y, 350, line_height, $game_party.actor_mp_levels_actor2[1])
      draw_text(x + 85, y, 350, line_height, $game_party.actor_mp_levels_actor2[2])
      draw_text(x + 118, y, 350, line_height, $game_party.actor_mp_levels_actor2[3])
    end
    if actor.id == 3
      draw_text(x + 18, y, 350, line_height, $game_party.actor_mp_levels_actor3[0])
      draw_text(x + 51, y, 350, line_height, $game_party.actor_mp_levels_actor3[1])
      draw_text(x + 85, y, 350, line_height, $game_party.actor_mp_levels_actor3[2])
      draw_text(x + 118, y, 350, line_height, $game_party.actor_mp_levels_actor3[3])
    end
    draw_text(x + 36, y, 350, line_height, "/")
    draw_text(x + 69, y, 350, line_height, "/")
    draw_text(x + 103, y, 350, line_height, "/")
    draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::mp_a)
  end
end

#==============================================================================
# ** Window_SkillList
#------------------------------------------------------------------------------
#  This window is for displaying a list of available skills on the skill window.
#==============================================================================

class Window_SkillList < Window_Selectable
  #--------------------------------------------------------------------------
  # * Get Activation State of Selection Item
  #--------------------------------------------------------------------------
  def current_item_enabled?
    enable?(@data[index])
        item = @data[index]
    return false unless enable?(item)
    actor = @actor
        if item.tags[0].include?("lv1")
            if actor.id == 1
                $game_party.actor_mp_levels_actor1[0] -= 1
            elsif actor.id == 2
                $game_party.actor_mp_levels_actor2[0] -= 1
            elsif actor.id == 3
                $game_party.actor_mp_levels_actor3[0] -= 1
            end
        elsif item.tags[0].include?("lv2")
            if actor.id == 1
                $game_party.actor_mp_levels_actor1[1] -= 1
            elsif actor.id == 2
                $game_party.actor_mp_levels_actor2[1] -= 1
            elsif actor.id == 3
                $game_party.actor_mp_levels_actor3[1] -= 1
            end
        elsif item.tags[0].include?("lv3")
            if actor.id == 1
                $game_party.actor_mp_levels_actor1[2] -= 1
            elsif actor.id == 2
                $game_party.actor_mp_levels_actor2[2] -= 1
            elsif actor.id == 3
                $game_party.actor_mp_levels_actor3[2] -= 1
            end
        elsif item.tags[0].include?("lv4")
            if actor.id == 1
                $game_party.actor_mp_levels_actor1[3] -= 1
            elsif actor.id == 2
                $game_party.actor_mp_levels_actor2[3] -= 1
            elsif actor.id == 3
                $game_party.actor_mp_levels_actor3[3] -= 1
            end
    end
  end
  #--------------------------------------------------------------------------
  # * Display Skill in Active State?
  #--------------------------------------------------------------------------
  def enable?(item)
    @actor && @actor.usable?(item)
    return false unless @actor && @actor.usable?(item)
    actor = @actor
        if actor.id == 1
      spell_class_one = $game_party.actor_mp_levels_actor1[0]
      spell_class_two = $game_party.actor_mp_levels_actor1[1]
      spell_class_three = $game_party.actor_mp_levels_actor1[2]
      spell_class_four = $game_party.actor_mp_levels_actor1[3]
            return true if item.tags[0].include?("lv1") and spell_class_one >= 1
            return true if item.tags[0].include?("lv2") and spell_class_two >= 1
            return true if item.tags[0].include?("lv3") and spell_class_three >= 1
            return true if item.tags[0].include?("lv4") and spell_class_four >= 1
    end
        if actor.id == 2
      spell_class_one = $game_party.actor_mp_levels_actor2[0]
      spell_class_two = $game_party.actor_mp_levels_actor2[1]
      spell_class_three = $game_party.actor_mp_levels_actor2[2]
      spell_class_four = $game_party.actor_mp_levels_actor2[3]
            return true if item.tags[0].include?("lv1") and spell_class_one >= 1
            return true if item.tags[0].include?("lv2") and spell_class_two >= 1
            return true if item.tags[0].include?("lv3") and spell_class_three >= 1
            return true if item.tags[0].include?("lv4") and spell_class_four >= 1
    end
        if actor.id == 3
      spell_class_one = $game_party.actor_mp_levels_actor3[0]
      spell_class_two = $game_party.actor_mp_levels_actor3[1]
      spell_class_three = $game_party.actor_mp_levels_actor3[2]
      spell_class_four = $game_party.actor_mp_levels_actor3[3]
            return true if item.tags[0].include?("lv1") and spell_class_one >= 1
            return true if item.tags[0].include?("lv2") and spell_class_two >= 1
            return true if item.tags[0].include?("lv3") and spell_class_three >= 1
            return true if item.tags[0].include?("lv4") and spell_class_four >= 1
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    if skill
      rect = item_rect(index)
      rect.width -= 4
      draw_item_name(skill, rect.x, rect.y, enable?(skill))
      draw_skill_cost(rect, skill)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Skill Use Cost
  #--------------------------------------------------------------------------
  def draw_skill_cost(rect, skill)
    if @actor.id == 1
      # Checks for Skill Tag "Lv1"
      if skill.tags[0] != nil && skill.tags[0].include?("lv1")
        draw_text(rect, $game_party.actor_mp_levels_actor1[0], 2)
      end
      # Checks for Skill Tag "Lv2"
      if skill.tags[0] != nil && skill.tags[0].include?("lv2")
        draw_text(rect, $game_party.actor_mp_levels_actor1[1], 2)
      end
      # Checks for Skill Tag "Lv3"
      if skill.tags[0] != nil && skill.tags[0].include?("lv3")
        draw_text(rect, $game_party.actor_mp_levels_actor1[2], 2)
      end
      # Checks for Skill Tag "Lv4"
      if skill.tags[0] != nil && skill.tags[0].include?("lv4")
        draw_text(rect, $game_party.actor_mp_levels_actor1[3], 2)
      end
    end
    if @actor.id == 2
      # Checks for Skill Tag "Lv1"
      if skill.tags[0] != nil && skill.tags[0].include?("lv1")
        draw_text(rect, $game_party.actor_mp_levels_actor2[0], 2)
      end
      # Checks for Skill Tag "Lv2"
      if skill.tags[0] != nil && skill.tags[0].include?("lv2")
        draw_text(rect, $game_party.actor_mp_levels_actor2[1], 2)
      end
      # Checks for Skill Tag "Lv3"
      if skill.tags[0] != nil && skill.tags[0].include?("lv3")
        draw_text(rect, $game_party.actor_mp_levels_actor2[2], 2)
      end
      # Checks for Skill Tag "Lv4"
      if skill.tags[0] != nil && skill.tags[0].include?("lv4")
        draw_text(rect, $game_party.actor_mp_levels_actor2[3], 2)
      end
    end
    if @actor.id == 3
      # Checks for Skill Tag "Lv1"
      if skill.tags[0] != nil && skill.tags[0].include?("lv1")
        draw_text(rect, $game_party.actor_mp_levels_actor3[0], 2)
      end
      # Checks for Skill Tag "Lv2"
      if skill.tags[0] != nil && skill.tags[0].include?("lv2")
        draw_text(rect, $game_party.actor_mp_levels_actor3[1], 2)
      end
      # Checks for Skill Tag "Lv3"
      if skill.tags[0] != nil && skill.tags[0].include?("lv3")
        draw_text(rect, $game_party.actor_mp_levels_actor3[2], 2)
      end
      # Checks for Skill Tag "Lv4"
      if skill.tags[0] != nil && skill.tags[0].include?("lv4")
        draw_text(rect, $game_party.actor_mp_levels_actor3[3], 2)
      end
    end
  end
end

#==============================================================================
# ** Scene_ItemBase
#------------------------------------------------------------------------------
#  This class performs common processing for the item screen and skill screen.
#==============================================================================

class Scene_ItemBase < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Actor [OK]
  #--------------------------------------------------------------------------
  def on_actor_ok
    if item_usable?
      empty = false
      if @actor.id == 1
        # Checks for Skill Tag "Lv1"
        if item.tags[0].include?("lv1")
          $game_variables[900] > 0 ? $game_variables[900] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv2"
        if item.tags[0].include?("lv2")
          $game_variables[901] > 0 ? $game_variables[901] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv3"
        if item.tags[0].include?("lv3")
          $game_variables[902] > 0 ? $game_variables[902] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv4"
        if item.tags[0].include?("lv4")
          $game_variables[903] > 0 ? $game_variables[903] -= 1 : empty = true
        end
      end
      if @actor.id == 2
        # Checks for Skill Tag "Lv1"
        if item.tags[0].include?("lv1")
          $game_variables[904] > 0 ? $game_variables[904] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv2"
        if item.tags[0].include?("lv2")
          $game_variables[905] > 0 ? $game_variables[905] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv3"
        if item.tags[0].include?("lv3")
          $game_variables[906] > 0 ? $game_variables[906] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv4"
        if item.tags[0].include?("lv4")
          $game_variables[907] > 0 ? $game_variables[907] -= 1 : empty = true
        end
      end
      if @actor.id == 3
        # Checks for Skill Tag "Lv1"
        if item.tags[0].include?("lv1")
          $game_variables[908] > 0 ? $game_variables[908] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv2"
        if item.tags[0].include?("lv2")
          $game_variables[909] > 0 ? $game_variables[909] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv3"
        if item.tags[0].include?("lv3")
          $game_variables[910] > 0 ? $game_variables[910] -= 1 : empty = true
        end
        # Checks for Skill Tag "Lv4"
        if item.tags[0].include?("lv4")
          $game_variables[911] > 0 ? $game_variables[911] -= 1 : empty = true
        end
      end
      if empty == true
        Sound.play_buzzer
      else
        use_item
        @item_window.refresh
      end
    else
      Sound.play_buzzer
    end
  end

end

No worries. I understand where you were coming from. Just wanted to make my stance understood. I will take a look at this soon.

Taking a skim at it though, looks correct. Definitely appreciate this. Will let you know.

*Looks to work as intended. I will now look to clean the script up and will probably re-post the script if anyone else wants to have a look.
 
Last edited:

Latest Threads

Latest Profile Posts

Two NPCs blinking animations in VNMaker and two to go. Some progress!
Fun Fact: My last two projects (Fursona and A Postmortem Nation) were released before I could do post-completion playtesting because I got so excited and happy I released them on the spot. Sometimes I have rubbish impulse control. smh
Circle, circle, dot, dot... I got my first COVID shot! And I barely felt it, which shocked me. Usually having Autism causes my sense of touch to be amplified! I go for my second dose in June.
Another update, this time on moving. I got the keys to my apartment today, but it was poorly cleaned/repaired. They're working on it, don't worry!
:kaojoy:I just saw 2 players reached 10 hours.
The game is totally not for cult recruitment. As of yet, we have not summoned Cthulhu.
Unfortunately, besides that, many issues still need to be fixed for more common fellows.
To at least pretend everything is normal here. :kaoswt2:

Forum statistics

Threads
111,308
Messages
1,060,079
Members
144,629
Latest member
petebooh
Top