Stat Profile
Scripting with the StatProfile class.
The StatProfile
class can be used to provide stats to any object. This is used by all of Inventool's items.
Fields & Properties
level
The current level. Use LevelUp, LevelDown, or SetLevel to change this value.
int
public
maxLevel
The max level.
int
public
stats
A list of all stats in this profile.
List<Stat>
public
Creating a Stat Profile
Managing Stats
Adding/Removing Stats
To add or removea stat, simply use the Add
or Remove
methods of the stats
field.
Getting Stats
You can get a specific stat in the profile with the stat's ID, name or abbreviation.
Merging Stats
You can merge a list of stats with the MergeStats
method. Stat merging is the process of permanently adding a stat's value to another of the same identity. If the stat cannot be merged with any existing stat in the profile, it will be added as a new stat instead.
Combining/Uncombining Stats
Stat combining is the process of temporarily adding a stat's value to another of the same identity. If the stat cannot be combined with any existing stat in the profile, it will be ignored.
Combining
You can combine a list of stats with the CombineStats
method.
Uncombining
Use the UncombineStats
method to have the opposite effect.
Managing Levels
When setting the level of a StatProfile
, the methods below should be used as they will update all stats in the profile.
Set the Level
Level Up
The LevelUp
method increases the level by 1.
Level Down
The LevelDown
method decreases the level by 1.
Text Interpolation
You can use the GetInterpolatedText method to convert a string with stat text tags to correctly display the stats from a stat profile (e.g. "Character has {stat1_value} {stat1_abbr}" becomes "Character has 100 HP").
Supported Stat Text Tags
{stat0_value}
The value of the stat at the current level without any changes.
{stat0_name}
The name of the stat.
{stat0_abbr}
The abbreviated name of the stat.
{stat0_lvl}
The current level of the stat.
{stat0_mlvl}
The max level of the stat.
{stat0_curr}
The current value of the stat.
{stat0_next}
The value of the stat at the next level.
{stat0_max}
The max value of the stat at the current level.
{stat0_maxed}
The max value of the stat at the max level.
{stat0_scaling}
The scaling of the stat.
{stat0_init}
The initial value of the stat.
Last updated