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.
Show Variable-Based Stats in Status Screen

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 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best 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
Show Variable-Based Stats
Version: 1.0
Author: modern algebra
Date: August 1, 2009

Version History


  • <Version 1.0> 08.01.2009 - Original Release

Description


This script allows you to display the values of variable-based stats in the status menu of an actor. Thus, if you assign, say, a luck stat to each actor that determines how often they win the lotto, and you save this stat in a variable, then this script allows you to show that stat right below the other parameters the actor has, such as ATK, DEF, AGI, and SPI.

Features

  • Allows you to show variable-based stats in the Status Screen
  • Can give whatever names you want to the new stats and can show the value of those variables in the Status Menu
  • Very easy setup, and easy to control the values of the new stats
  • Can have as many as will fit in the Status Screen.

Screenshots



Instructions

Place this script above Main and below Materials. Read the descriptions in the EDITABLE REGION starting at line 34 for instructions on how to configure the script.

Script


Code: [Select]
#==============================================================================
#    Show Variable-Based Stats
#    Version: 1.0
#    Author: modern algebra (rmrk.net)
#    Date: August 1, 2009
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This script allows you to display the values of variable-based stats in
#   the status menu of an actor. Thus, if you assign, say, a luck stat
#   to each actor that determines how often they win the lotto, and you save
#   this stat in a variable, then this script allows you to show that stat
#   right below the other parameters the actor has, such as ATK, DEF, AGI,
#   and SPI.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Place this script above Main and below Materials.
#
#    Read the descriptions in the EDITABLE REGION starting at line 34 for
#   instructions on how to configure the script.
#==============================================================================

#==============================================================================
#  *** ModernAlgebra
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  This module holds configuration data for my scripts
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new constants - SVS_PARAMETER_BASE_VARIABLES, SVP_PARAMETER_NAMES
#==============================================================================

module ModernAlgebra
  #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  #  EDITABLE REGION
  #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  # SVP_PARAMETER_BASE_VARIABLES holds the base variables for each stat.
  #  What that means is it should be the ID of the variable that tracks that
  #  parameter for the actor with ID 1 (Ralph by default). The script then
  #  assumes that the variables that track that stat increases in succession.
  #  So if Variable 18 tracks the stat for Ralph, then Variable 19 will track
  #  it for Ulrika, Variable 20 will track it for Bennett and so on until all
  #  actors are accounted for.
  SVP_PARAMETER_BASE_VARIABLES = [14, 34]
  # SVP_PARAMETER_NAMES holds the names you are giving each new stat, and the
  #  indices should correspond exactly to the position of its base variable in
  #  SVP_PARAMETER_BASE_VARIABLES
  SVP_PARAMETER_NAMES = ["LUK", "CHA"]
  #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  #  END EDITABLE REGION
  #//////////////////////////////////////////////////////////////////////////
end

#==============================================================================
# ** Window Status
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - draw_parameters
#==============================================================================

class Window_Status
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Parameters
  #     x : Draw spot X coordinate
  #     y : Draw spot Y coordinate
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mdrnalg_shwvrblestts_drwprms_7bx2 draw_parameters
  def draw_parameters(x, y, *args)
    # Run Original Method
    mdrnalg_shwvrblestts_drwprms_7bx2 (x, y, *args)
    y += 4*WLH
    # Draw all Variable-based stats
    for i in 0...ModernAlgebra::SVP_PARAMETER_BASE_VARIABLES.size
      # Draw Parameter Name
      contents.font.color = system_color
      contents.draw_text (x, y, 120, WLH, ModernAlgebra::SVP_PARAMETER_NAMES[i])
      # Get Variable Stat
      var_id = ModernAlgebra::SVP_PARAMETER_BASE_VARIABLES[i] + @actor.id - 1
      # Draw Stat
      contents.font.color = normal_color
      contents.draw_text (x + 120, y, 36, WLH, $game_variables[var_id].to_s, 2)
      # Advance y
      y += WLH
    end
  end
end

Credit


  • modern algebra

Support


Please post in this topic if you have any questions or encounter any problems with this script.

Known Compatibility Issues

It won't work with many exotic Status Scenes.

Demo


Not necessary, as it is self-explanatory from the screenshot.


Creative Commons License
This script by modern algebra is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.
« Last Edit: August 07, 2010, 02:35:36 PM by modern algebra »

*
A Random Custom Title
Rep:
Level 96
wah
COOL. These are always nice to have because you might have a mini-game or something that deals with, like, another type of currency and yeah. idk. You could go crazy with this. :O