PlayerData.lua contains a host of variables and functions related to data that is stored in the Save game.
PlayerData
The Following Properties are accessible through tes3.player.data.KBProgression.* (ex. tes3.player.data.KBProgression.xp will return the Players current Experience total) You should not write directly to this table, doing so could potentially break features of the mod:

  • .xp - returns the players current total xp
  • .xpReq - OBSOLETE Abandoned property from early in development. Not present in 1.1.7 onwards. use playerData.calcXPReq() to get the player's xp requirement
  • .levelPoints - Table of the players attribute, skill and perk points
.atr - Attribute points.prk - Perk points
.mjr - Major Skill Points
.mnr - Minor Skill Points
.msc - Misc Skill Points
  • .perks - a table of all perks the player has acquired. Uses perkID as a key and stores a boolean value. Don't use this to add/remove perks, use the functions listed further down
  • .activatedPerks - a table of all perks that are activated on the player. Similar to with .perks, you shouldn't write directly to this table
  • .incPoints - table of additive skill point bonuses. The values here are added to the levelPoints table every time the player levels up. uses the same keys as levelPoints
  • .pntMult - a table of attribute/skill/perk point multipliers. these values are multiplied by the MCM defined points per interval settings when determining how many points you gain at level up. Defaults to 1, but can be modified by scripts. uses the same keys as levelPoints
  • wrldCellsVisited - a table of named exterior cells the player has visited. Keyed to cell Editor Ids, with boolean return values.
  • questsCompleted - a table of all quests the player has completed with the mod installed. Keyed to the quest topic's editor ID, with boolean values

Functions
These functions are accessible through interop.lua under playerData.*
  • getAttributePoints() - returns the player's current attribute points
  • getPerkPoints() - returns the player's current perk point total
  • getMajorSkillPoints() - returns the player's major skill point total
  • getMinorSkillPoints() - returns the player's minor skill point total
  • getMiscSkillPoints()- returns the player's misc skill point total
  • hasPerk(perkID) - returns true if the player has the perk corresponding to the provided ID, and false if they do not
  • giveXP(i) - grants i number of experience points to the player
  • advanceLevel() - forces the player to level up, even if they would not otherwise have enough XP
  • giveAttributePoints(i) - grants i number of Attribute Points to the player
  • givePerkPoints(i) - grants i number of perk points to the player
  • giveMajorSkillPoints(i) - grants i number of major skill points to the player
  • giveMinorSkillPoints(i) - grants i number of minor skill points to the player
  • giveMiscSkillPoints(i) - grants i number of misc skill points to the player
  • modPntMult(typ, mod) - modifies pntMult[typ] (see above) by mod (a number)
  • modIncPoints(typ, mod) - modifies incPoints[typ] (see above) by mod (a number)
  • grantPerk(id) - grants the perk registered to id to the player
  • removePerk(id) - removes the perk registered to id from the player
  • getCellVisited(id) - returns true if the cell name is found in wrldCellsVisited (see above)
  • calcXPReq(level) - calculates what the xp requirement would be for the given level and returns it
  • updatePerkList() - forces the perk list in the stats menu to update

Article information

Added on

Written by

KirbonatedBeverage

0 comments