Info
How will a Primary Stat be calculated?
Primary Stat Value = DefaultValue + (Level - 1) * AddValuePerLevel + Primary Points * AddValuePerPrimaryStatPoint + SP8_GetAdditionPrimaryStatValue (BPI)
How will a Secondary Stat be calculated?
Secondary Stat Value = DefaultValue + (Level - 1) * AddValuePerLevel + SP8_GetAdditionSecondaryStatValue (BPI) +
Add Value Per Primary Stat
Add Value Per Primary Stat = Primary Stat Value * AddValuePerPrimaryStat-Value
How does Regeneration for Custom Stats work?
Example Health:
If Health will go under the Max Health, the Regeneration is going to start.
After the Health Regeneration Duration the Health will be regenerated by <AMOUNT>.
This will continue till the Health is the same as Max Health again.
<AMOUNT> = (DefaultAmount * (HealthRegenerationStat + 100)) / 100
If Potion used: * Potion Regeneration Multiplier
SP8_StatComponent
Option | Description |
Primary Stat Info | Create new Primary Stat. Example: Key: Gameplay Tag of the Stat Default Value: Default Value of that Primary Stat Add Value Per Level: How much Value will be added per Level Max Primary Stat Points: How many Primary Stat Points can be added to the Primary Stat Add Value Per Primary Stat Point: How much Value will be added per Primary Stat Point Text Format: Format of the Stat at the Widgets. {VALUE} will be replaced with the current Value of the Stat |
Secondary Stat Info | Create new Secondary Stat. Example: Key: Gameplay Tag of the Stat Default Value: Default Value of that Secondary Stat Add Value Per Level: How much Value will be added per Level Add Value Per Primary Stat: Key = Primary Stat Type Value = How much Value will be added per Primary Stat Value Text Format: Format of the Stat at the Widgets. {VALUE} will be replaced with the current Value of the Stat |
Add Primary Stat Points Per Level | How many Points the Player will get if he reaches a new Level. |
XP Curve | Set the XP needed for the next Level. |
On Death Reduce XP | Percentage of XP needed for next Level, if XP would be 0. Reduces on Death the XP by this Amount. |
Health Stat Type | Set the Stat Type |
Health Regeneration Stat Type | Set the Stat Type - Value of 10 means 10% faster Regeneration. |
Health Regeneration Duration | Interval of Seconds when the Regeneration will be called. |
Health Potion Regeneration Multiplier | How much faster will the Regeneration be, if the Potion is used |
Health Regeneration Default Amount | Default Regeneration Amount |
Custom Stat | Similiar to Health, just the Player can not die. Example: Key: Select StatType (for example Mana) RegenerationStatType: StatType of the Regeneration (Leave empty if not use) Value of 10 means 10% faster Regeneration. PotionRegenerationMultiplier: How much faster will the Regeneration be, if the Potion is used. RegenerationDefaultAmount: Default Regeneration Amount. setToMaxOnRevive: Should the Value be set to max on revive? |
Custom Stat Regeneration Duration | In what Interval should the Custom Stats regenerate. |
Stat Logging | Customize Logs Example: Key: Select LogType Type: Can be left empty if not needed SubType: Can be left empty if not needed (Sometimes it will be overwritten with different Values) Message: What should be printed to the Chat Box. OnlyOnDebug: If true, the Message will be only shown, if the “Stat Logging Debug” is set to true. |
Stat Logging Debug | If set to true, every Log of the Stat Component will be shown in the Chat. |
Function | Callable | Description | Default Use-Case |
getStatFormat | Server & Client | Get the Format of a Stat | Call whenever the Stat will be shown to the Player |
getCurrentPrimaryPoints | Server & Client | Get the available Primary Points, which can be added to Primary Stats. | To show the Player how many Points he can use |
AddPointToPrimaryStat | Server & Client | Add a Point to a Primary Stat. | When the Player wants to add a Point to a Primary Stat |
getStatValue | Server & Client | Get the Value of a Primary or Secondary Stat. | Showing Stats to the Player or for Damage Calculations |
getCurrentPointsOnPrimaryStat | Server & Client | Get the current Points of a Primary Stat. | To show the Player how many Points are on the Primary Stat |
StatsChanged | Server | Will recalculate all Primary and Secondary Stats. | Example: If you have a Pet with Stats and those are changing you can call it |
Revive | Server | Set the Health to max (Mana, Stamina depends on Options). | To revive the Player (Only changing the Custom Stats and not anything to the Movement Component) |
getCurrentCustomStat | Server & Client | Get the current Value of a Custom Stat. Works with Health as well. | For displaying the Stamina to the Player |
getCurrentCustomStatWithPotion | Server & Client | Get the current Value of a Custom Stat with Potion. Works with Health as well. | For displaying the Stamina to the Player |
reduceCustomStat | Server | Reduce the current Value of a Custom Stat. Works with Health as well. | On Damage, if a Magic was used or by running. |
usePotion | Server | Regenerate Custom Stat Value faster. Works with Health as well. | If a Consumable Potion was used and removed. |
canUsePotion | Server & Client | Check if a Potion can be used. | Before removing the Item, to check if it’s going to work. |
getMaxXP | Server & Client | Get the XP needed for the next Level, if the XP would be 0. | For displaying to the Player |
addXP | Server | Add XP to the Player. | After killing a Monster |
getXP | Server & Client | Get the current XP. | For displaying to the Player |
getLevel | Server & Client | Get the current Level. | For displaying to the Player and maybe Damage calculations |
getMaxLevel | Server & Client | Get the highest Level a Player can achieve. | |
reduceXP | Server | Reduce XP of the Player. | |
setLevel | Server | Set the Level of the Player. | For Admins |
ChangeSecondaryStat | Server | Change the Value of a secondary Stat. This Function is made, for changing the Stat for a limited time. | For example the Stat Change Area. |
Undo_ChangeSecondaryStat | Server | Undo the change of the secondary Stat. | For example the Stat Change Area. |
Initialize | Server | If you are using your own Save System, you can use this Function to set the Informations, which this Component needs. | Only if you do not call Load! |
Load | Server | Load all variables | Should be called on start. |
Save | Server | Save all variables |
Dispatcher | Called | Description | Default Use-Case |
currentXP_Changed | Server & Client | Called if XP changed | Change the XP on a Widget and for example making an Effect |
currentLevelChanged | Server & Client | Called if Level changed | Change the Level on a Widget and for example making an Effect |
PrimaryStatChanged | Server & Client | Called if Primary Stat Value changed | Change the Stat Value on a Widget |
SecondaryStatChanged | Server & Client | Called if Secondary Stat Value changed | Change the Stat Value on a Widget |
currentPrimaryPointsChanged | Server & Client | Called if Primary Points changed | Change the Amount on a Widget |
onDeathStatChange | Server & Client | Called if Death State changed | Change the Player State |
currentCustomStatChanged | Server & Client | Called if a Custom Stat changed | Change the Health, Mana, Stamina on a Widget and show some effect |
currentCustomStatWithPotionChanged | Server & Client | Called if a Custom Stat with Potion changed | Change the Health, Mana, Stamina on a Widget |
PotionUsed | Server & Client | Called if Potion was used | Show some effect |
Initialized | Client | Called if all Variables are set and the Component can be used | Initialize all Widgets and stop loading Screen if all Components are initialized. |
SP8_BPI_Stats (Only if you are not using SP8_PlayerTemplate)
Function | Called | Description | When is it called? |
SP8_getAdditionalPrimaryStatValue | Server | Get Additional Primary Stat Value For Example: If you have a Pet with Stats you can add the Value to the return Node. | on Stats Changed |
SP8_getAdditionalSecondaryStatValue | Server | Get Additional Secondary Stat Value For Example: If you have a Pet with Stats you can add the Value to the return Node. | on Stats Changed |
Stat LogTypes
LogType | Description |
Info_Initialized | Called on Initialized. |
Error_StatFormatNotSet | Stat could not be found inside Primary or Secondary Stat Info. |
Error_AddPointToPrimaryStat_AmountToHigh | Called, if the Amount which the Player tries to Add is higher then Amount he currently has. |
Error_PrimaryStatNotFound | Primary Stat could not be found. |
Info_MaxPrimaryPointsExceeded | Called, if the Amount which the Player tries to Add plus the current Amount on the Primary Stat is higher then the Max Primary Stat Points Variable inside the Primary Stat Info. |
Error_CustomStatTypeNotValid | Called if the Stat Type on CanUsePotion could not be found. |
Info_AddXPFailedBecauseMaxLevelReached | Called if addXP failed, because the Max Level was reached. |
Info_XPAdded | Called if XP was added. Overwrite SubType with Adding XP. |
Info_LevelChanged | Called if Level changed. Overwrite SubType with new Level. |
Error_NotEnoughXP | Called if Player has not enough XP to reduce it. |
Error_NotCallableOnClient | Called Function can be only called on Server. |
Info_XPReduced | Called if XP was reduced. Overwrite SubType with Reducing XP. |