Inventool Documentation
  • Inventool Documentation
  • đŸ•šī¸Quick Start
    • Installation
    • Start Creating
  • 💡General
    • Running the Demo
    • Menu Options
    • UI Updates
    • UI Customizations
      • uGUI
      • UI Toolkit
    • Custom Item Drops
  • 🎓Tutorials
    • Demo Walkthrough
  • âœī¸Editors
    • Inventool
      • Inventory
      • Equipment
      • Items
      • Currencies
      • Crafting
      • Dismantling
      • Enchanting
      • Stats
        • Stat IDs
        • Attributes
      • Settings
    • Item Type Manager
    • Localization Editor
    • Stats Editor
    • Merchants
      • Shopkeeper
      • Craftsman
      • Enchanter
    • Storage
    • Loot
      • Loot Box
      • Item Pouch
      • Currency Pouch
    • Components
      • Initializer
      • UI
        • uGUI
          • Inventool Window
          • Split UI
            • Inventory Window UGUI
            • Equipment Window UGUI
            • Key Items Window UGUI
            • Crafting Window UGUI
            • Enchanting Window UGUI
            • Storage Window UGUI
            • Shop Window UGUI
            • Selector UGUI
          • Action Menu UGUI
          • Hover Details UGUI
          • Confirm Prompt UGUI
          • Quantity Prompt UGUI
          • Character Viewer Element UGUI
        • UI Toolkit
          • Inventool Window
          • Split UI
            • Inventory Window
            • Equipment Window
            • Key Items Window
            • Crafting Window
            • Enchanting Window
            • Storage Window
            • Shop Window
          • Action Menu
          • Hover Details
          • Confirm Prompt
          • Quantity Prompt
        • Character Viewer
      • Overworld Merchant
      • Storage Keeper
      • Item Drop
      • Item Spawner
      • Input
        • Cross Input Support
        • Cross Input Support UGUI
          • Target Selectable
  • 📄Scripting API
    • Initialization
    • Inventory
    • Equipment
      • Equipment Slot
    • Items
      • Item
      • Item Type
      • Item Stack
      • Item Drop
      • Item Spawner
      • Loot Box
      • Item Pouch
    • Currencies
      • Currency Identity
      • Currency
        • Value
      • Currency Pouch
    • Crafting
      • Craft
      • Crafter
    • Enchanting
      • Enchantment
    • Stats
      • Stat Identity
      • Attribute
      • Stat
        • Stat Value
          • Value
        • Effectiveness
      • Stat Profile
    • Storing
      • Storage
      • Storage Keeper
    • Settings
    • Merchants
      • Shopkeeper
      • Craftsman
      • Enchanter
      • Overworld Merchant
    • UI
      • uGUI
        • Inventool Window UGUI
        • Split UI
          • Draggable Window UGUI
            • Inventory Window UGUI
            • Equipment Window UGUI
            • Key Items Window UGUI
            • Crafting Window UGUI
            • Enchanting Window UGUI
            • Storage Window UGUI
            • Shop Window UGUI
          • Selector UGUI
        • Action Menu UGUI
        • Hover Details UGUI
        • Confirm Prompt UGUI
        • Quantity Prompt UGUI
        • Draggable Element UGUI
          • Equipment Slot Element UGUI
          • Item Slot Element UGUI
          • Item Stack Element UGUI
        • Action Menu Option UGUI
        • Currency Element UGUI
        • Inventory Filter UGUI
        • Inventory Slot UGUI
        • Key Item Element UGUI
        • Shop Item Element UGUI
        • Storage Currency Element UGUI
        • Stat Element UGUI
      • UI Toolkit
        • Inventool Window
        • Split UI
          • Draggable Window
            • Inventory Window
            • Equipment Window
            • Key Items Window
            • Crafting Window
            • Enchanting Window
            • Storage Window
            • Shop Window
        • Action Menu
        • Hover Details
        • Confirm Prompt
        • Quantity Prompt
        • Item Elements
          • Item Stack Element
          • Equipment Slot Element
          • Item Slot Element
          • Shop Item Element
      • Action Menu Option
      • Character Viewer
    • Events
    • Sounds
    • Saving & Loading
      • Inventory & Equipment
      • Storage
    • Input
      • Cross Input Support
      • Cross Input Support UGUI
    • Localization
      • Localization Settings
      • Localizer
  • đŸ› ī¸Support
    • Getting Help
  • 📚Changelogs
    • Latest Releases
    • Future Plans
  • ⭐Rate Me?
Powered by GitBook
On this page
  • Fields & Properties
  • Creating a Stat Profile
  • Managing Stats
  • Adding/Removing Stats
  • Getting Stats
  • Merging Stats
  • Combining/Uncombining Stats
  • Managing Levels
  • Set the Level
  • Level Up
  • Level Down
  • Text Interpolation
  • Supported Stat Text Tags
  1. Scripting API
  2. Stats

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

Name
Description
Type
Access

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

var myStatProfile = new StatProfile();

Managing Stats

Adding/Removing Stats

To add or removea stat, simply use the Add or Remove methods of the stats field.

myStatProfile.stats.Add(myStat);
myStatProfile.stats.Remove(myStat);

Getting Stats

You can get a specific stat in the profile with the stat's ID, name or abbreviation.

var hpStat = myStatProfile.GetStat("HP");

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.

myStatProfile.MergeStats(stat1, stat2); //stat3, etc...

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.

myStatProfile.CombineStats(stat1, stat2); //stat3, etc..

Uncombining

Use the UncombineStats method to have the opposite effect.

myStatProfile.UncombineStats(stat1, stat2); //stat3, etc..

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

myStatProfile.SetLevel(1);

Level Up

The LevelUp method increases the level by 1.

myStatProfile.LevelUp();

Level Down

The LevelDown method decreases the level by 1.

myStatProfile.LevelDown();

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").

string original = "Character has {stat1_value} {stat_abbr}.";
string interpolatedText = myStatProfile.GetInterpolatedText(original);

Supported Stat Text Tags

Tag
Description

{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.

PreviousEffectivenessNextStoring

Last updated 3 months ago

📄