07-04-2024, 08:03 PM
(This post was last modified: 07-04-2024, 09:48 PM by DerVVulfman.)
(07-03-2024, 05:10 PM)DerVVulfman Wrote: Meanwhile, I've been a little busy. There have been a number of scripts that let the player spend 'points' to improve their stats. Gain 5 points, you may be able to improve your hero's HP, SP, Strength, Dexterity and Intelligence. OR you may shove all five points into Agility.
Well... Setting up my Character Stat Raising system, I decided to let it branch out and allow for different point bonuses depending upon the character's class. And I had fun making the configuration page.
#==============================================================================
# ** DVV_Stat_Increase
#------------------------------------------------------------------------------
# This module is the configuration module. Please perform changes only within
# this page unless you are an experienced scripter.
#==============================================================================
module DVV_Stat_Increase
#--------------------------------------------------------------------------
STAT_POINTS = {} # Do Not Touch
#--------------------------------------------------------------------------
# POINT SYSTEM TEST
# =================
# Returns an error message at start unless values correctly defined.
# -------------------------------------------------------------------------
#
TEST = true
# CLASS ARRAY USAGE
# =================
# This feature allows the system to have individual point assignements to
# each actor by their character class. Fot it to function, the defined stat
# within the configuration page must have as many parameters/values as the
# project has character classes within the database. If engaged, the system
# will still allow flat-rate and 1 & 2 parameter arrays for variable random
# point generation.
# -------------------------------------------------------------------------
#
CLASS_USE = true
# LEVEL INCREASE POINTS
# =====================
# Points earned per level gained. Points equal number of increases possible
# Non-Array values are flat-rate. Single value arrays are simply randomized
# values. And two-parameter arrays are min-max range arrays.
# -------------------------------------------------------------------------
#
LEVEL_POINTS = [5,25,5,5,5,5,5,5] # Points per level
# STAT ORDER
# ==========
# Essentially, this is a list of the keys for the below statistics in the
# order in which they are normally presented. This should be a mimic to any
# order presented within the additional point-distribution system.
# -------------------------------------------------------------------------
#
STAT_ORDER = [ 'HP', 'SP', 'STR', "DEX", 'AGI', 'INT']
# INDIVIDUAL STAT POINTS
# ======================
# Points applied to a statistic. Each entry is for its own stat, so HP may
# increase higher than SP, or DEX faster than STR. The points defined use
# same standard as LEVEL INCREASE POINTS in regards of flat-rate and random
# value generation.
# -------------------------------------------------------------------------
#
STAT_POINTS['HP'] = [[20],25,20,15,10,10,10,5] # Hit Points per class
STAT_POINTS['SP'] = 20 # Skill Points (flat 20 pts)
STAT_POINTS['STR'] = [5] # Strength (random from 1-5 pts)
STAT_POINTS['DEX'] = [25] # Dexterity (random from 1-25 pts)
STAT_POINTS['AGI'] = [5, 10] # Agility (random from 5-10 pts)
STAT_POINTS['INT'] = 4 # Intelligence (flat 4 pts)
end
# ** DVV_Stat_Increase
#------------------------------------------------------------------------------
# This module is the configuration module. Please perform changes only within
# this page unless you are an experienced scripter.
#==============================================================================
module DVV_Stat_Increase
#--------------------------------------------------------------------------
STAT_POINTS = {} # Do Not Touch
#--------------------------------------------------------------------------
# POINT SYSTEM TEST
# =================
# Returns an error message at start unless values correctly defined.
# -------------------------------------------------------------------------
#
TEST = true
# CLASS ARRAY USAGE
# =================
# This feature allows the system to have individual point assignements to
# each actor by their character class. Fot it to function, the defined stat
# within the configuration page must have as many parameters/values as the
# project has character classes within the database. If engaged, the system
# will still allow flat-rate and 1 & 2 parameter arrays for variable random
# point generation.
# -------------------------------------------------------------------------
#
CLASS_USE = true
# LEVEL INCREASE POINTS
# =====================
# Points earned per level gained. Points equal number of increases possible
# Non-Array values are flat-rate. Single value arrays are simply randomized
# values. And two-parameter arrays are min-max range arrays.
# -------------------------------------------------------------------------
#
LEVEL_POINTS = [5,25,5,5,5,5,5,5] # Points per level
# STAT ORDER
# ==========
# Essentially, this is a list of the keys for the below statistics in the
# order in which they are normally presented. This should be a mimic to any
# order presented within the additional point-distribution system.
# -------------------------------------------------------------------------
#
STAT_ORDER = [ 'HP', 'SP', 'STR', "DEX", 'AGI', 'INT']
# INDIVIDUAL STAT POINTS
# ======================
# Points applied to a statistic. Each entry is for its own stat, so HP may
# increase higher than SP, or DEX faster than STR. The points defined use
# same standard as LEVEL INCREASE POINTS in regards of flat-rate and random
# value generation.
# -------------------------------------------------------------------------
#
STAT_POINTS['HP'] = [[20],25,20,15,10,10,10,5] # Hit Points per class
STAT_POINTS['SP'] = 20 # Skill Points (flat 20 pts)
STAT_POINTS['STR'] = [5] # Strength (random from 1-5 pts)
STAT_POINTS['DEX'] = [25] # Dexterity (random from 1-25 pts)
STAT_POINTS['AGI'] = [5, 10] # Agility (random from 5-10 pts)
STAT_POINTS['INT'] = 4 # Intelligence (flat 4 pts)
end
VERY pleased with the result, the system now permits arrays equal-in-size to the number of character classes in the game/project and extract the proper data based on the character's class ID. But moreso, while the Class using system is engaged, it can run a test to see if the data is itself an array or not, and can identify the single-param/double-param entries that would generate random stat values for the heroes.
And they can be used in tandem.
In the above configuration page, I defined it so everyone gets a mere 5 points to spend on leveling their stats except the NPCs using the 2nd character class. They get a whopping 25 points to spend.
I had even more fun with the HP Stats section, giving each of the eight character classes some variance in flat rate points... except anyone using the 1st character class. Unlike the others, the one using the 1st character class has a randomized HP bonus up to 25pts. But after that, every other stat system works equally among the heroes.
The way I have devised this system, the game developer using it can forego giving points per level, and just use script calls to add the needed points. In a way, you could make this a merit-based system for solving puzzles or special achievements rather than combat. Or you could give points to the player at game start and just not give any more points, the player customizing the heroes rather than forcing fixed character designs.
That's the plan, and I'm sticking with it.
Now the only thing I need to do is re-work my data test system. It works with the older-designed data, determining if the configuration page is screwed up. But now, I have to let it recognize character class-sized arrays, and the content within.
EDIT:
Well, so much for having to work out the data testing system. It works fine and informs me where I need to fix things.