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.
ScreenshotsInstructions 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
#==============================================================================
# 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
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.
This script by
modern algebra is licensed under a
Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.