API Reference GE Extensions career modules Career Player Attributes Module M.dependencies = {'career_career'}
M. dependencies = { 'career_career' }
Central attribute store for career mode. Tracks money, BeamXP, vouchers, and per-branch XP values. Every change is logged with reason/tags for the logbook financial and gameplay history views.
Field Type Description M.logAttributeChangevaries Assigned as logAttributeChange
Function Signature Description M.addAttributes(change, reason)Adds/subtracts attribute values with tagged reason; clamps to min/max M.setAttributes(newValues, reason)Sets absolute values (internally computes delta and calls addAttributes) M.getAttribute(attributeName) → tableReturns full attribute object {value, gains, losses, min, max} M.getAttributeValue(attributeName) → numberReturns just the current numeric value (0 if missing) M.getAllAttributes() → tableReturns entire attributes table M.getAttributeLog() → tableReturns the full change history array
Hook Purpose M.onExtensionLoadedLoads attributes + log from save; handles version migration M.onSaveCurrentSaveSlotPersists playerAttributes.json and attributeLog.json M.onCareerModulesActivatedCreates reputation attributes for all organizations M.onLogbookGetEntriesGenerates Financial History and Rewards History logbook cards
career_career - active check, tutorial state
career_saveSystem - save slot paths
career_branches - branch definitions, attribute key ordering
career_modules_reputation - min/max reputation bounds
career_modules_log - internal log entries
freeroam_organizations - organization list for reputation attributes
attribute = {
value = 5000 , -- current value
gains = {all = 8000 , gameplay = 3000 , selling = 5000 },
losses = {all = - 3000 , buying = - 3000 },
min = nil , -- optional floor (e.g. reputation)
max = nil , -- optional ceiling
}
reason = {
label = "Sold 3 Parts." ,
tags = { "partsSold" , "selling" }, -- converted to LUT internally
}
Attribute Description moneyIn-game currency (starts at 10000, +3500 if tutorial disabled) beamXPGeneral experience points vouchersBonus stars for fast repairs <branchId>XPPer-branch progression XP <orgId>ReputationPer-organization reputation (clamped -50 to 700)
-- Award money + XP
career_modules_playerAttributes. addAttributes (
{money = 500 , beamXP = 50 },
{label = "Completed delivery" , tags = { "gameplay" , "delivery" }}
)
-- Check balance
local money = career_modules_playerAttributes. getAttributeValue ( "money" )
Hook Data onPlayerAttributesChanged(change, reason) - notifies all systems of attribute mutations