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
      • Character Stats
  • 📄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
        • Stat Scaling Source
        • Effectiveness
      • Scaling Value
        • Numeric Value
          • Value
        • Scaling Source
      • Stat Profile
      • Character Stats
    • 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
      • Character Stats
    • 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 Scaling Value
  • No Scaling
  • Linear Scaling
  • Curve Scaling
  • Managing Levels
  • Setting the Level
  • Increasing the Level
  • Decreasing the Level
  1. Scripting API
  2. Stats

Scaling Value

Scripting with the ScalingValue class.

The ScalingValue class is a numeric value that can scale with level.

Fields & Properties

Name
Description
Type
Access

numericType

The numeric type.

NumericValue.NumericType

public

value

The current value.

NumericValue

public

excessValue

The last calculated excess value.

NumericValue

protected

scalingSource

The scaling source.

ScalingSource

public

level

The current level.

int

public

maxLevel

The max level.

int

public

lowValue

The low value.

NumericValue

public

HighValue

The value at the current level.

NumericValue

public

NextValue

The high value if leveled up.

NumericValue

public

MaxValue

The high value at the max level.

NumericValue

public

IsLevelMaxed

If the level is maxed.

bool

public

IsLow

If the current value is equal to the low value.

bool

public

IsHigh

If the current value is equal to the high value.

bool

public

Creating a Scaling Value

To create a ScalingValue, you need to define the scaling. This can be done by creating and providing the Scaling Source or by simply providing the appropriate values in the constructor.

The default current level set is 1 and the default max level set is the 'Default Max Level' value that you can set from Settings.

No Scaling

// Parameters: current, intitial
ScalingValue myScalingValue = new ScalingValue(100, 100);

Linear Scaling

// Parameters: current, intitial, increment
ScalingValue myScalingValue = new ScalingValue(100, 100, 10);

Curve Scaling

// Parameters: current, intitial, min, max, animation curve
ScalingValue myScalingValue = new ScalingValue(100, 100, 1, 100, myAnimationCurve);

Managing Levels

Setting the Level

To set the max value, use the SetMaxLevel method.

myScalingValue.SetMaxLevel(100);

The SetLevel will set the current level to a specific value.

myScalingValue.SetLevel(1);

Increasing the Level

Use the LevelUp method to increase the level by a given amount. This method returns the unused excess amount. The level cannot go over the max level.

myScalingValue.LevelUp(1);

Decreasing the Level

Use the LevelDown method to decrease the level by a given amount. This method returns the unused excess amount. The level cannot go lower than 1.

myScalingValue.LevelDown(1);

Optionally, you can use the Deplete method to set the level to 1.

myScalingValue.Deplete();
PreviousEffectivenessNextNumeric Value

Last updated 10 days ago

📄