GetCalculatedPerkPoints

From GECK
Jump to: navigation, search


A function added by the ShowOff NVSE Plugin version 1.20.

Description

If the player is not in the Level-Up Menu, returns the amount of Perk points they would get from their next level-up. Otherwise, returns the max amount of Perk points the player can allot from their current level-up.

If specified and set to a non-zero value, the levelOverride optional argument can be used to replace the player's current level in the equation with a theoretical level. Note that if this change is made before the adjustment for not being in the Level-Up menu (which adds +1 level).

Accounts for the iLevelsPerPerk gamesetting.

  • Used to account for lStewieAl's Tweaks's iPerksPerLevel, but the support was scrapped since support for multiple Tweaks ini files was added.
    • As such, this function can only return 1 or 0.

Does NOT account for the reduction that occurs when the player is running out of perks to choose (they receive less Perk points to prevent softlocking).

This function can be used either in a script, or as a Condition.

Syntax

[help]
(perkPoints:int) GetCalculatedPerkPoints levelOverride:int 

Or:

(perkPoints:int) GetCalculatedPerkPointsEarnedPerLevel levelOverride:int

Example

 if MenuMode 1027  ; level-up menu is active
      GetCalculatedPerkPoints
 endif

Returns the total Perk points that the player has received from their current level-up. May be an overestimate; it does not account for the reduction of Perk points when the player is starting to run out of perks to choose.

 if eval !(MenuMode 1027)  ; level-up menu is NOT active
      GetCalculatedPerkPoints
 endif

Returns the total Perk points that the player would receive from their next level up.

See Also