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.
[VXA] State Viewer

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
State Viewer
Version: 1.0b
Author: modern algebra
Date: February 4, 2012

Version History


  • <Version 1.0b> 2012.02.04 - Fixed an oversight where the map would not show up in the background of the scene.
  • <Version 1.0a> 2012.01.12 - Fixed an error where the colour of the label text would not change.
  • <Version 1.0> 2011.12.30 - Original Release

Description


This script allows you to give states descriptions and calls up a scene which has as its sole purpose to describe what each state (and buff, if desired) does. This sscene can be made accessible from the Menu, the Status Scene, or simply by call script in an event.

Features

  • Allows you to show a list of states with descriptions so that the player won't be clueless
  • Scrollable contents if you have more than 14 states
  • Can exclude some states if you don't want them to show in the list
  • Can choose to reveal state descriptions only once they have been inflicted
  • Accessible by call script or through the Status or Menu scenes if you prefer
  • Compatible with most popular CMSes
  • Heavily customizable

Screenshots



Instructions

Paste this script into its own slot in the Script Editor, above Main and below Materials. If you are using a Custom Menu Scene, I recommend that this script be placed below it.

Please see the header for detailed instructions on configuration and use.

Script


Code: [Select]
#==============================================================================
#    State Viewer
#    Version: 1.0b
#    Author: modern algebra (rmrk.net)
#    Date: February 4, 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This script allows you to give states descriptions and calls up a scene
#   which has as its sole purpose to describe what each state (and buff, if
#   desired) does. This sscene can be made accessible from the Menu, the Status
#   Scene, or simply by call script in an event.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Paste this script into its own slot above Main and below Materials. If you
#   are using a menu script and you want this script to add itself to the menu
#   automatically, then this script should be below the custom menu.
#
#    The scene can be called in an event using the following script call:
#      call_stateview
#
#    To set the descriptions for each state, simply use the following code in
#   its notebox:
#      \DESC{x}
#         where x is the description you want. You can use the code \LB to go
#        to another line. Also, you can use any message codes, so if you want
#        to, for instance, change the colour, you could do it with \c[n] - many
#        default commands work and, if you use a custom message system, then
#        some of those codes might work as well.
#
#    EXAMPLE:
#      \DESC{This state drains HP every turn}
#
#    You can exclude some states from showing up in the list with the code:
#      \DESC_HIDE
#
#    You have the option to make it accessible from the menu, status or both at
#   lines 86-93. You can then go on to set whether a label will be shown in the
#   scene and its size, font, color etc... at lines 99-109.
#
#    You can set the script to also show descriptions for the buffs at line 123
#   and you can setup what is shown for each level of a buff at lines 124-175.
#
#    There is an option at line 112 to show all states at all times, but you
#   can also turn that feature off and require that the states (and buffs) be
#   inflicted before they are shown. There is an option at line 118 to have
#   states and buffs be revealed automatically the first time it is inflicted
#   on a party member or else you can reveal them manually using the following
#   codes in an evented script call:
#
#      reveal_state_description(state_id)
#        state_id : the ID of the state, as listed in the database.
#
#      reveal_buff_description(buff_id)
#      reveal_buff_description(buff_id, level)
#        buff_id  : ID of the buff, where 0 = MaxHP; 1 = MaxMP; 2 = Attack;
#                  3 = Defence; 4 = Magic; 5 = Magic Defence; 6 = Agility;
#                  7 = Luck
#        level    : level of the buff, where -1 = Debuff 1; -2 = Debuff 2;
#                  1 = Buff 1; 2 = Buff 2. If you exclude level, then all
#                  levels of the buff will be revealed.
#
#    EXAMPLES:
#
#      reveal_state_description(2)
#        State 2 (Poison) will now be described in the State View scene.
#
#      reveal_buff_description(5, 2)
#        Level 2 of the Magic Defence Buff will now be described in State View
#
#      reveal_buff_description(2)
#        All levels of the Attack Buff will be described in State View
#
#    I reiterate: the above commands are only relevant if you set the option at
#   line 112, MASV_SHOW_ALL_STATES, to false. If you do not and that is true,
#   then all states (and buffs, if included) will be shown right off the bat.
#==============================================================================

$imported = {} unless $imported
$imported[:MA_StateView] = true

#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#  CONFIGURATION
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# Whether the scene should be accessible via the Status Scene
MASV_STATUS_ACCESS = false
  # If accessible by status screen, what button needs to be pressed?
  MASV_STATUS_KEY = :A
# Whether the scene should be accessible via a command in the menu
MASV_MENU_ACCESS = true
  # If accessible via the menu, what index is it in the command list
  MASV_MENU_INDEX = 4
# The Label used to describe the scene in menu and on the screen
MASV_SCENE_LABEL = "State List"
# The amount of horizontal space, in pixels, to draw the name of the state.
MASV_NAME_FIELD_WIDTH = 124
MASV_LABEL_WINDOW = { # <- Do not touch
  # Whether to show the label at the top of the screen when viewing states
  show:     true,
  # The name of the font for the label if shown. Can be a string ("Arial") or
  #  an array of strings. Font.default_name is the basic font
  fontname: Font.default_name,
  # The size of the font if label is shown
  fontsize: 32,
  # The colour of the label if it is shown
  colour:   16,
  # The alignment of the label if shown. 0 => Left; 1 => Centre; 2 => Right
  align:    1
} # <- Do not touch
# Whether to show all non-hidden states immediately
MASV_SHOW_ALL_STATES = true
  # If SHOW_ALL_STATES is false, then turning MASV_AUTOREVEAL_STATES to true
  #  will set it so that the descriptions of states (and buffs) will be shown
  #  once the party first encounters them. If you set this option to false,
  #  then you will need to manually reveal states and buffs via call script in
  #  order for them to show up. See lines 45-62.
  MASV_AUTOREVEAL_STATES = true
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# BUFFS

# When this is true, buffs will also be shown in the scene
MASV_INCLUDE_BUFFS = true
# If you are showing buffs, then you will need to set the name and description
#  of each level of the buff in the array below.
#    They are set in the following way: firstly, there is a hash for each buff,
#   and in that hash you can set a different name and description for every
#   buff level in the following format:
#
#      level => ["name", "description"],
#
#    As with states, you can use \\LB to make a new line and message codes in
#   the description, but note that you need two backslashes (\\) instead of 1.
#   So, it would be \\c[1] to change the colour, not \c[1]
MASV_BUFFS = [ # <- Do not touch
  {   # Max HP                                              Maximum HP
    -1 => ["MaxHP -1", "MaxHP decreased by 25%"],       # Debuff Level 1
    -2 => ["MaxHP -2", "MaxHP decreased by 50%"],       # Debuff Level 2
     1 => ["MaxHP +1", "MaxHP increased by 25%"],       # Buff Level 1
     2 => ["MaxHP +2", "MaxHP increased by 50%"],       # Buff Level 2
  },{ # Max MP                                              Maximum MP
    -1 => ["MaxMP -1", "MaxMP decreased by 25%"],       # Debuff Level 1
    -2 => ["MaxMP -2", "MaxMP decreased by 50%"],       # Debuff Level 2
     1 => ["MaxMP +1", "MaxMP increased by 25%"],       # Buff Level 1
     2 => ["MaxMP +2", "MaxMP increased by 50%"],       # Buff Level 2
  },{ # Attack                                              Attack
    -1 => ["Attack -1", "Attack decreased by 25%"],     # Debuff Level 1
    -2 => ["Attack -2", "Attack decreased by 50%"],     # Debuff Level 2
     1 => ["Attack +1", "Attack increased by 25%"],     # Buff Level 1
     2 => ["Attack +2", "Attack increased by 50%"],     # Buff Level 2
  },{ # Defence                                             Defence
    -1 => ["Defence -1", "Defence decreased by 25%"],   # Debuff Level 1
    -2 => ["Defence -2", "Defence decreased by 50%"],   # Debuff Level 2
     1 => ["Defence +1", "Defence increased by 25%"],   # Buff Level 1
     2 => ["Defence +2", "Defence increased by 50%"],   # Buff Level 2
  },{ # Magic                                               Magic
    -1 => ["Magic -1", "Magic decreased by 25%"],       # Debuff Level 1
    -2 => ["Magic -2", "Magic decreased by 50%"],       # Debuff Level 2
     1 => ["Magic +1", "Magic increased by 25%"],       # Buff Level 1
     2 => ["Magic +2", "Magic increased by 50%"],       # Buff Level 2
  },{ # Magic Defence                                       Magic Defence
    -1 => ["MDefence -1", "MDefence decreased by 25%"], # Debuff Level 1
    -2 => ["MDefence -2", "MDefence decreased by 50%"], # Debuff Level 2
     1 => ["MDefence +1", "MDefence increased by 25%"], # Buff Level 1
     2 => ["MDefence +2", "MDefence increased by 50%"], # Buff Level 2
  },{ # Agility                                             Agility
    -1 => ["Agility -1", "Agility decreased by 25%"],   # Debuff Level 1
    -2 => ["Agility -2", "Agility decreased by 50%"],   # Debuff Level 2
     1 => ["Agility +1", "Agility increased by 25%"],   # Buff Level 1
     2 => ["Agility +2", "Agility increased by 50%"],   # Buff Level 2
  },{ # Luck                                                Luck
    -1 => ["Luck -1", "Luck decreased by 25%"],         # Debuff Level 1
    -2 => ["Luck -2", "Luck decreased by 50%"],         # Debuff Level 2
     1 => ["Luck +1", "Luck increased by 25%"],         # Buff Level 1
     2 => ["Luck +2", "Luck increased by 50%"],         # Buff Level 2
  },
] # <- Do not touch
#``````````````````````````````````````````````````````````````````````````````
#  END CONFIGURATION
#//////////////////////////////////////////////////////////////////////////////
MASV_BUFFS.each {|hash| hash.values.each {|ary| ary[1].gsub!(/\\LB/i, "\n") } }

#==============================================================================
# ** RPG::State
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    overwritten super method - description
#    new method - desc_hide?
#==============================================================================

class RPG::State
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Description
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def description
    if !@masv_description
      @masv_description = self.note[/\\DESC\{(.+?)\}/im].nil? ? "" : $1
      @masv_description.gsub!(/\n/, "")
      @masv_description.gsub!(/\\LB/i, "\n")
    end
    @masv_description
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Excluded?
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def desc_hide?
    @desc_hide = !self.note[/\\DESC_HIDE/i].nil? if !@desc_hide
    @desc_hide
  end
end

#==============================================================================
# *** DataManager
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - extract_save_contents
#==============================================================================

module DataManager
  class << self
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Extract Save Contents
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    alias masv_extrctsvcon_5gh6 extract_save_contents
    def extract_save_contents(contents, *args, &block)
      masv_extrctsvcon_5gh6(contents, *args, &block)
      # Initialize new data if old save file
      $game_system.masv_initialize_statebuff_counters if !$game_system.masv_states_afflicted
    end
  end
end

#==============================================================================
# ** Game_System
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new public instance variables - masv_states_afflicted; masv_buffs_added
#    aliased method - initialize
#    new methods - reveal_state_description; reveal_buff_description
#==============================================================================

class Game_System
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_reader :masv_states_afflicted
  attr_reader :masv_buffs_added
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias molbr_stvw_inze_4rp8 initialize
  def initialize(*args, &block)
    masv_initialize_statebuff_counters
    molbr_stvw_inze_4rp8(*args, &block) # Run Original Method
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Initialize MASV Data
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def masv_initialize_statebuff_counters
    @masv_states_afflicted = []
    @masv_buffs_added = Array.new(MASV_BUFFS.size, [])
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Reveal State Description
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def reveal_state_description(state_id)
    $game_system.masv_states_afflicted.push(state_id) unless $game_system.masv_states_afflicted.include?(state_id)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Reveal Buff Description
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def reveal_buff_description(param_id, lvl = nil)
    return if param_id == 0 || lvl == 0
    $game_system.masv_buffs_added[param_id] = [] unless $game_system.masv_buffs_added[param_id]
    if lvl.nil? # Reveal all levels of a parameter if lvl not specified
      $game_system.masv_buffs_added[param_id] |= MASV_BUFFS[param_id].keys
    else
      $game_system.masv_buffs_added[param_id].push(lvl) unless $game_system.masv_buffs_added[param_id].include?(lvl)
    end
  end
end

#==============================================================================
# ** Game_Battler
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - add_state; add_buff; add_debuff
#==============================================================================

class Game_Battler
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Add State
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias morala_stvw_adstat_5fc1 add_state
  def add_state(state_id, *args, &block)
    # Add the state to the added states counter
    $game_system.reveal_state_description(state_id) if MASV_AUTOREVEAL_STATES && actor? && state_addable?(state_id)
    morala_stvw_adstat_5fc1(state_id, *args, &block) # Run Original Method
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Add Buff
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias masv_adbuff_5tz9 add_buff
  def add_buff(param_id, *args, &block)
    masv_adbuff_5tz9(param_id, *args, &block) # Run Original Method
    # Add the buff level to the added buffs counter
    $game_system.reveal_buff_description(param_id, @buffs[param_id]) if MASV_AUTOREVEAL_STATES && actor?
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Add Debuff
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias masv_debuff_3hj7 add_debuff
  def add_debuff(param_id, *args, &block)
    masv_debuff_3hj7(param_id, *args, &block) # Run Original Method
    # Add the buff level to the added buffs counter
    $game_system.reveal_buff_description(param_id, @buffs[param_id]) if MASV_AUTOREVEAL_STATES && actor?
  end
end

#==============================================================================
# ** Game_Interpreter
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new methods - call_stateview; reveal_state_description;
#      reveal_buff_description
#==============================================================================

class Game_Interpreter
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Call State View Scene
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def call_stateview
    SceneManager.call(Scene_StateView)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Reveal State Description
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  [:reveal_state_description, :reveal_buff_description].each { |sys_meth|
    define_method(sys_meth) do |*args| $game_system.send(sys_meth, *args) end
  }
end

#==============================================================================
# ** Window_StateView
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  This window displays all states and descriptions of their effects
#==============================================================================

class Window_StateView < Window_Selectable
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize(*args)
    @item_max = 1
    super(*args)
    refresh
    activate
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Item Max
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def item_max
    @item_max
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Include State?
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def state_include?(state)
    return false unless state # False if nil
    return false if state.desc_hide?
    return true if MASV_SHOW_ALL_STATES
    return $game_system.masv_states_afflicted.include?(state.id)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Include Buff?
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def buff_include?(param_id, lvl)
    return false unless MASV_BUFFS[param_id] && MASV_BUFFS[param_id][lvl].is_a?(Array)
    return false unless MASV_BUFFS[param_id][lvl][0].is_a?(String) && MASV_BUFFS[param_id][lvl][1].is_a?(String)
    return true
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Make State List
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def make_state_list
    @data = $data_states.compact.select { |state| state_include?(state) }
    @item_max = @data.inject(0) { |r, state| r += state.description.scan(/\n/).size + 1 }
    if MASV_INCLUDE_BUFFS
      for i in 0...MASV_BUFFS.size
        ary = MASV_SHOW_ALL_STATES ? MASV_BUFFS[i].keys : $game_system.masv_buffs_added[i]
        ary.each { |lvl|
          if buff_include?(i, lvl)
            @data.push([i, lvl])
            @item_max += MASV_BUFFS[i][lvl][1].scan(/\n/).size + 1
          end
        }
      end
    end
    @item_max = 1 if @item_max < 1
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Refresh
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def refresh
    make_state_list
    create_contents
    # Draw all states
    y = 0
    @dummy_battler = Game_BattlerBase.new
    for i in 0...@data.size
      y = draw_item(y, i)
    end
    @dummy_battler = nil
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Item
  #    state : RPG::State object that is being drawn
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_item(y, index)
    reset_font_settings
    contents.font.name = Font.default_name
    icon_index, icon_hue, name, description = get_data(index)
    # Draw Icon
    $imported[:MAIcon_Hue] ? draw_icon_with_hue(icon_index, icon_hue, x, y) : draw_icon(icon_index, 0, y)
    # Draw Name
    change_color(system_color)
    draw_text(28, y, MASV_NAME_FIELD_WIDTH, 24, name)
    # Draw Description
    change_color(normal_color)
    draw_text_ex(34 + MASV_NAME_FIELD_WIDTH, y, description)
    return y + (description.scan(/\n/).size + 1)*line_height
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Get the data to draw
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def get_data(index)
    item = @data[index]
    icon_index, icon_hue, name, description = 0, 0, "", ""
    if item.is_a?(RPG::State)
      icon_index, name, description = item.icon_index, item.name, item.description
      icon_hue = $imported[:MAIcon_Hue] ? item.icon_hue : 0
    elsif item.is_a?(Array)
      icon_index = @dummy_battler.buff_icon_index(item[1], item[0]) if @dummy_battler
      name = MASV_BUFFS[item[0]][item[1]][0] rescue ""
      description = MASV_BUFFS[item[0]][item[1]][1] rescue ""
    end
    icon_index = 0 if icon_index.nil?
    return icon_index, icon_hue, name, description
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Cursor Down
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def cursor_down(*args)
    tr = self.top_row
    self.top_row += 1 unless self.bottom_row >= item_max - 1
    Sound.play_cursor if tr != self.top_row
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Cursor Down
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def cursor_up(*args)
    tr = self.top_row
    self.top_row -= 1
    Sound.play_cursor if tr != self.top_row
  end
end

#==============================================================================
# ** Window_StateLabel
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  This window shows the label if desired
#==============================================================================

class Window_StateLabel < Window_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize(*args)
    super(*args)
    refresh
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Refresh
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def refresh
    contents.clear
    settings = MASV_LABEL_WINDOW
    contents.font.name = settings[:fontname]
    contents.font.size = settings[:fontsize]
    change_color(text_color(settings[:colour]))
    contents.fill_rect(0, settings[:fontsize] - 1, contents_width, 2, contents.font.color)
    draw_text(0, 0, contents_width, settings[:fontsize], MASV_SCENE_LABEL, settings[:align])
  end
end

#==============================================================================
# ** Scene_StateView
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  This scene processes the state viewing scene
#==============================================================================

class Scene_StateView < Scene_MenuBase
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Start Processing
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def start
    super
    if MASV_LABEL_WINDOW[:show]
      @label_window = Window_StateLabel.new(0, 0, Graphics.width, Graphics.height)
      swy = ((Graphics.height - MASV_LABEL_WINDOW[:fontsize] - @label_window.padding) / 24)*24
      swy += @label_window.padding
      @states_window = Window_StateView.new(0, Graphics.height - swy, Graphics.width, swy)
      @states_window.opacity = 0
    else
      @states_window = Window_StateView.new(0, 0, Graphics.width, Graphics.height)
    end
    @states_window.set_handler(:ok,     method(:return_scene))
    @states_window.set_handler(:cancel, method(:return_scene))
  end
end

# Status Integration
#==============================================================================
# ** Scene Status (Access from Status)
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - update
#    new method - update_stateview_call
#==============================================================================

class Scene_Status
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Frame Update
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias malsv_updte_2hg1 update
  def update(*args, &block)
    malsv_updte_2hg1(*args, &block) # Run Original Method
    update_stateview_call if MASV_STATUS_ACCESS
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update SceneView Call
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def update_stateview_call
    SceneManager.call(Scene_StateView) if Input.trigger?(MASV_STATUS_KEY)
  end
end

# Menu Integration
if MASV_MENU_ACCESS
unless $imported[:MA_InsertCommand]
# Initialize the Insertion Hash
MA_COMMAND_INSERTS = {}
MA_InsertableMenuCommand = Struct.new(:name, :index, :enable, :scene, :other)

#==============================================================================
# ** Game_System
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new public instance variable - maic_menu_commands
#    aliased method - initialize
#==============================================================================

class Game_System
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Inserted Menu Commands
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def maic_inserted_menu_commands
    # Lazy Instantiation so that old save files are not corrupted
    if !@maic_inserted_menu_commands
      @maic_inserted_menu_commands = MA_COMMAND_INSERTS.keys
      # Sort by index
      @maic_inserted_menu_commands.sort! { |a, b| MA_COMMAND_INSERTS[a].index <=> MA_COMMAND_INSERTS[b].index }
    end
    @maic_inserted_menu_commands
  end
end

#==============================================================================
# ** Window_MenuCommand
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - make_command_list; maic_insert_command
#==============================================================================

class Window_MenuCommand
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Make Command List
  #``````````````````````````````````````````````````````````````````````````
  #  I alias this method instead of add_original_commands because I need to
  # have all commands created before I can insert at the correct index
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias maic_mkcmmndl_6yd2 make_command_list
  def make_command_list(*args, &block)
    maic_mkcmmndl_6yd2(*args, &block) # Run Original Method
    # Insert new commands
    $game_system.maic_inserted_menu_commands.each { |sym| maic_insert_command(sym) }
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Insert Command
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def maic_insert_command(symbol)
    command = MA_COMMAND_INSERTS[symbol]
    # Get the command name
    name = command.name.is_a?(Symbol) ? eval(command.name.to_s) : command.name
    # Check whether enabled
    enabled = case command.enable
    when Integer then command.enable == 0 ? true : $game_switches[command.enable]
    when String then eval(command.enable)
    when Symbol then self.send(command.enable)
    else
      enabled = true
    end
    # Add the command to the list
    add_command(name, symbol, enabled)
    added = @list.pop
    @list.insert([command.index, @list.size].min, added) # Insert at specific index
  end
end

#==============================================================================
# ** Scene_Menu
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - create_command_window; on_personal_ok
#    new methods - maic_set_insert_handler; maic_command_insert
#==============================================================================

class Scene_Menu
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Create Command Window
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias maic_createcndwin_3ey7 create_command_window
  def create_command_window(*args, &block)
    maic_createcndwin_3ey7(*args, &block) # Run Original Method
    # Add handlers for all custom commands
    $game_system.maic_inserted_menu_commands.each { |symbol| maic_set_insert_handler(symbol) }
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Set Inserted Handler
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def maic_set_insert_handler(symbol)
    other = MA_COMMAND_INSERTS[symbol].other
    handler = case other
    when Symbol then method(other)
    when String then lambda { eval(other) }
    when TrueClass then method(:command_personal)
    else
      handler = method(:maic_command_insert)
    end
    @command_window.set_handler(symbol, handler)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Custom Command
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def maic_command_insert
    SceneManager.call(Kernel.const_get(MA_COMMAND_INSERTS[@command_window.current_symbol].scene))
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Personal OK
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias maic_onpok_3ek9 on_personal_ok
  def on_personal_ok(*args, &block)
    if $game_system.maic_inserted_menu_commands.include?(@command_window.current_symbol)
      maic_command_insert
    else
      maic_onpok_3ek9(*args, &block) # Run Original Method
    end
  end
end

$imported[:MA_InsertCommand] = true
end

MA_COMMAND_INSERTS[:stateview] = MA_InsertableMenuCommand.new(MASV_SCENE_LABEL,
MASV_MENU_INDEX, true, :Scene_StateView, false)

end

Credit


  • modern algebra

Thanks

  • Seiryuki, for the request

Support


Please post in this topic at RMRK if you encounter any errors or have any questions regarding this script.
« Last Edit: February 05, 2012, 01:12:22 AM by modern algebra »

**
Rep:
Level 72
RMRK Junior
 ;D ;D ;D
Thank you, thank you, thank you!

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Cool script, MA! I really liked the VX version, and this will definitely come in handy.

Btw, a scripting question, of sorts. What's the difference (assuming Module has already been created) between:
Code: [Select]
module Module
  class << self
    # Whatever
  end
end

and:

Code: [Select]
class << Module
  # whatever
end

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
When accessing the metaclass of a module, I don't know that there is any functional difference between the two expressions so long as the module is defined.

**
Rep:
Level 72
RMRK Junior
I tried to change the LABEL's colour but the underline's colour changed instead.

Plus, is there a way you can make it so that I can change the description's font, font-size, and colour too? Maybe even specify windowskin for the viewer?

Btw, I noticed that in the status screen, the state viewer doesn't close the status screen. Do you know how I can achieve that effect if I call the state viewer using an item from a common event? When I call it from an item, the item scene closes and I'm left with the map as the background. I want the item scene to remain open in the background so that when I exit the viewer, I'm returned to the item.
« Last Edit: January 12, 2012, 09:17:27 PM by Seiryuki »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Fixed the label colour error - you can get the updated script from the first post.

For changing the font name, size, and colour of the description - the script recognizes message codes when drawing the description, so you could use \c[n] to change the colour of the description text just as you could in a message. You could also change the font name and size if you get a script which gives message codes for that, like my ATS: Special Message Codes script. That said, you could not change the font size to be any greater than 24 without overlap. Also, you can't change the font name, size, or colour of the state name. I have no intention of adding any additional features of that nature to the script as configuration settings, but I can tell you what lines to add and where if you want them.

As for the item scene thing, it would be slightly more complicated then it seems, since RMVXA deals with scenes in a slightly different way. You could, for instance, just call Scene_Item directly after in the common event, but then it wouldn't go back to the menu when you closed Scene_Item - you would just go to back to the map.

So I would need to add the menu and status scenes back onto the stack first, which wouldn't be too difficult, but I don't really want to change any expected behaviours like that, and it could open the script up to a whole host of compatibility problems if I don't think it through properly. I would prefer not to do that.

If you aren't doing anything else in the common event aside from opening the State viewer though, then I could add a feature where you just paste something like: \call_stateview in the notebox of an item and it would call the scene. Then it would return to the item scene after with no effort on my part. Would that be OK?
« Last Edit: January 13, 2012, 12:08:21 AM by modern algebra »

**
Rep:
Level 72
RMRK Junior
Thanks for fixing the label colour error.

For the description, I wanted to change the font name specifically. I totally forgot that the script mentioned that I can change the colour, etc. with message codes. But it is really the font alone. It's okay if you're not going to add that. But if you can tell me the lines to do the font change myself, I would appreciate it. I can do without it though; it was just a nice-to-have.

About the item scene, I figure that it may be a RMVXace problem itself. But I was trying to solve it generally with any item I try to call a scene with. Don't bother about the \call_stateview in the item's notebox.
But I was just wondering why the scene_map is called if common_event_reserved (I saw something like that in scene_itembase's last method). I tried to figure out what it means so that maybe I can modify it but I'm thinking that the scene_map needs to be called to run the common event.
I will work around it....it was just strange to me that the scene_map was called.

Thanks for your help and the update. 8)

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
The reason is because all of the architecture for running a common event is in the Map and Battle scenes. If you wanted to do it in other scenes, you would essentially need to create in that scene everything required to show pictures, show messages, etc... - you would need to be able to call everything which is required for an event to run.

Mind you, that is not impossible and it's not the only way to do the function you are asking for, but that is the reason it goes to Scene_Map if the common event is reserved.

**
Rep:
Level 72
RMRK Junior
Ah, I had suspected something like that could've been the reason. I generally try to ask for scripts and stuff that I know, in my mind, would be simple to do. I don't want to go changing up the core architecture of rmvxace.
My game would be simple. If I don't get what I want, I just make do without it (I make the best with the cards I got).

Anyways, thanks for clearing that up.  :blizj:

**
Rep:
Level 72
RMRK Junior
I'm using your ATS - Special Message Codes script with the State Viewer script.

Problems:
1. When the font-name (\fn[name]) is changed in a \desc, it also changes the font for all other state-names and descriptions below it.
2. When the font-size (\fs[number]) is changed in a \desc, it also changes the next state-name's font-size. \b also does this.

I had no problems with \c[number] or \hc[hexcolour] codes.
« Last Edit: January 16, 2012, 12:28:11 AM by Seiryuki »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Just place /fn or /fs or /b, etc... at the end of the description.

Alternatively, you could go to around line 419 in the StateView script and see this:

Code: [Select]
  def draw_item(y, index)
    icon_index, icon_hue, name, description = get_data(index)
    # Draw Icon
    $imported[:MAIcon_Hue] ? draw_icon_with_hue(icon_index, icon_hue, x, y) : draw_icon(icon_index, 0, y)
    # Draw Name
    change_color(system_color)
    draw_text(28, y, MASV_NAME_FIELD_WIDTH, 24, name)
    # Draw Description
    change_color(normal_color)
    draw_text_ex(34 + MASV_NAME_FIELD_WIDTH, y, description)
    return y + (description.scan(/\n/).size + 1)*line_height
  end

Change it to:

Code: [Select]
  def draw_item(y, index)
    reset_font_settings
    contents.font.name = Font.default_name
    icon_index, icon_hue, name, description = get_data(index)
    # Draw Icon
    $imported[:MAIcon_Hue] ? draw_icon_with_hue(icon_index, icon_hue, x, y) : draw_icon(icon_index, 0, y)
    # Draw Name
    change_color(system_color)
    draw_text(28, y, MASV_NAME_FIELD_WIDTH, 24, name)
    # Draw Description
    change_color(normal_color)
    draw_text_ex(34 + MASV_NAME_FIELD_WIDTH, y, description)
    return y + (description.scan(/\n/).size + 1)*line_height
  end
« Last Edit: January 16, 2012, 12:50:08 AM by modern algebra »

**
Rep:
Level 72
RMRK Junior
Thanks, the reset_font_settings worked.

I knew I could've done the /b etc to reset it manually, but I figured that it would be easier with code. Also, I did notice the reset method....I just didn't know where to put it  :lol:

*
Rep: +0/-0Level 34
RMRK Junior
Hi I'm trying to use this state viewer in my menu. I got it to show in menu but when I click it in game I get an error in scene manager. I am using XS menu delux. The script works fine in default menu but I get the error when I try to use it with my XS menu can anybody help?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Best Member2012 Best RPG Maker User (Scripting)2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Try placing the State Viewer script above your Menu script, and change the value of MENU_ACCESS at line 91 to false.

Then just add the State scene to the menu through the mechanism provided in the menu script. Specifically, in the menu script at line 50, you should see:

Code: [Select]
    # MENU_LIST:
    # name, icon_index and custom are optional.
    # If name is empty it will use the corresponding symbol as name instead.
    # To make a command a common event you need to set custom to the common event
    # id you want to run as seen below.
    # symbol => [name, description, icon_index, enabled, personal, custom]
    MENU_LIST = {
      :item      => ["", "Browse through your acquired items.", 4148, true, false],
      :equip     => ["Equipment", "Change your equipment.", 4145, true, true],
      :skill     => ["Spells", "Manage your available skills.", 4147, true, true],
      :status    => ["Stats", "See the current status of the hero.", 4136, true, true],
      :formation => ["", "Change the formation of the party.", 4134, true, false],
      :save      => ["", "Record your progress.", 4139, true, false],
      :load      => ["", "Load your saved progress.", 4165, true, false, Scene_Load],
      :game_end  => ["Quit", "Exit the program.", 4162, true, false],
      :title     => ["", "Return to title.", 4133, true, false, Scene_Title],
      :com_event => ["Camping", "Run common event camping.", 728, true, false, 1]
    } # Don't remove this line!

Add to it the following line wherever you want:

Code: [Select]
      :statelist => ["State List", "Learn about state effects.", 230, true, false, Scene_StateView],

If you want it to be below :com_event though, you will need to add a comma after that line.

Also, feel free to change the name, description, or icon.

*
Rep: +0/-0Level 34
RMRK Junior
  :D thanks it's working. I couldn't figure out how to command it in MENU_LIST.  Plus  I use ace menu engine, so I had to configure it in 2 scripts haha. I knew I was on the right track tho. Thank you a lot. I was worried Noone was going to reply on this forum. Seeing as how this is a couple years old. I am grateful and appreciate your time and help :)

**
Rep: +0/-0Level 51
RMRK Junior
Might I request the ability to sort the states by array?
Like perhaps [4..50, 1..3, 51, 52, 102..107, 53..101]
or maybe just [4,5,6,7,8,9.. (until 50), 1,2,3,51,52 (and so forth).
I have a lot of states, large in number and complexity, which are beyond being able to be re-sorted.
So although they may look disorganized in the database, I would like to have them be organized for
the player, since if it's just a jumble, the player will probably be more overwhelmed than informed.