xScal Scaleform API 0.4.34

Game

Player data read from the game's own structures, as JSON strings. These calls take no arguments and work while the Pip-Boy is closed.

They return {"status":"inactive"} while the provider is disabled, and {"status":"pending","reason":"<reason>"} while the data cannot be read yet, for example on the main menu. Each entry lists its pending reason. A delivered value that cannot be returned produces {"status":"error","reason":"invalid_request"}.

Game.Clock

Alias of xsGetTimeData

__SFCodeObj.call("Game.Clock"):String

No arguments.

Returns String (JSON)

Same as xsGetTimeData.

Game.GetAS3Object 0.4.34+

Result of a Game.* call as an ActionScript object

__SFCodeObj.call("Game.GetAS3Object", name:String):Object

Arguments

NameTypeDescription
nameStringOne of Game.Clock, Game.GetCollections, Game.GetInventory, Game.GetPerks, Game.GetPlayerInfo, Game.GetQuests, Game.GetSpecial or Game.GetStatus.

Returns Object

The JSON that name returns, already decoded: the same fields, and the same status objects while the provider is inactive or pending. Integers that fit an int are int, other numbers are Number.

Returns undefined for any other name. While the provider returns the same JSON, each call returns the same object without decoding it again, so treat the object as read-only: a change made to it is seen by later calls. To detect a change, compare the values you read, not the object reference. Each movie gets its own objects.

Example

var status:Object = __SFCodeObj.call("Game.GetAS3Object", "Game.GetStatus");
if (status != null && status.status == null) {
    trace(status.HP.cur, status.HP.max);
}

Game.GetSpecial

Current SPECIAL values (Steam only)

__SFCodeObj.call("Game.GetSpecial"):String

No arguments.

Returns String (JSON)

FieldTypeDescription
Sint
Pint
Eint
Cint
Iint
Aint
Lint
detailsArray
details[].nameString
details[].valueint
details[].bonusint
details[].descriptionString

Sample result

{"S":10,"P":4,"E":5,"C":3,"I":6,"A":15,"L":13,"details":[{"name":"Strength","value":10,"bonus":0,"description":"..."}]}

Values include buffs and debuffs, truncated toward zero as the Pip-Boy shows them. Works while the Pip-Boy is closed. Pending reason special before a local player exists.

Game.GetStatus

Player vitals from the Pip-Boy header and STAT page

__SFCodeObj.call("Game.GetStatus"):String

No arguments.

Returns String (JSON)

FieldTypeDescription
HPObject
HP.curNumber
HP.maxNumber
APObject
AP.curNumber
AP.maxNumber
radsNumber
hungerNumber
thirstNumber
carryWeightObject
carryWeight.curNumber
carryWeight.maxNumber
carryWeight.limitNumber or nullnull when there is no absolute limit.
capsint
limbsObjectCurrent condition; 0 is crippled.
limbs.headNumber
limbs.leftArmNumber
limbs.rightArmNumber
limbs.leftLegNumber
limbs.rightLegNumber
flagsObject
flags.headCrippledBoolean
flags.leftArmCrippledBoolean
flags.rightArmCrippledBoolean
flags.leftLegCrippledBoolean
flags.rightLegCrippledBoolean
flags.irradiatedBoolean
flags.ghoulBoolean
flags.pipBoyLightOn 0.4.34+Booleantrue while the Pip-Boy light is on.
flags.isFemale 0.4.35+Booleantrue when the character's sex is female, as the game's GetIsSex condition reads it.
resistObjectSummed the way the STAT page sums them.
resist.damageint
resist.poisonint
resist.fireint
resist.energyint
resist.cryoint
resist.radiationint
dateObject or nullThe game's calendar, or null before it exists.
date.yearint
date.monthint
date.dayint
date.hourint
date.minuteint
weaponDamageArray or nullDamage rows of the equipped weapons; null while the inventory is changing.
weaponDamage[].typeintGame damage type id. 7 is a timed effect.
weaponDamage[].valueNumber
weaponDamage[].durationNumberSeconds, for timed effects.

Sample result

{"HP":{"cur":210.5,"max":275},"AP":{"cur":90,"max":120},"rads":45,"hunger":80,"thirst":65,"carryWeight":{"cur":180,"max":240,"limit":1740},"caps":3271}

HP.max is the radiation-reduced maximum. AP.max is the current AP with damage removed. hunger and thirst are the game's Food and Water values. irradiated is set at 60% of the lethal rads setting. Pending reason: status.

Game.GetPlayerInfo

Name, level and XP

__SFCodeObj.call("Game.GetPlayerInfo"):String

No arguments.

Returns String (JSON)

FieldTypeDescription
nameString
levelint
xpObject
xp.totalintCumulative experience.
xp.currentintExperience into the current level.
xp.nextintExperience the level needs.
progressNumberFraction the HUD bar shows. 0 to 1.

Sample result

{"name":"...","level":42,"xp":{"total":51234,"current":1234,"next":5000},"progress":0.25}

name can be empty. Pending reason: player_info.

Game.GetPerks

Perk cards

__SFCodeObj.call("Game.GetPerks"):String

No arguments.

Returns String (JSON)

FieldTypeDescription
perksArray
perks[].nameString
perks[].perkIdint
perks[].uniqueIdint
perks[].rankint
perks[].maxRankint
perks[].pointCostint
perks[].levelRequirementint
perks[].raceRestrictionint0 any race, 1 non-ghouls only, 2 ghouls only.
perks[].gameModeint1 for Nuclear Winter cards.
perks[].specialString or null
perks[].equippedBoolean
perks[].animatedBoolean
perks[].descriptionString
perks[].flavorTextString

Pending reason: perks.

Game.GetQuests

Quest objectives the Pip-Boy lists

__SFCodeObj.call("Game.GetQuests"):String

No arguments.

Returns String (JSON)

FieldTypeDescription
questsArray
quests[].nameString
quests[].formIdint
quests[].typeint
quests[].swfFileString
quests[].activeBoolean
quests[].enabledBoolean
quests[].completedBoolean
quests[].canBeRejectedBoolean
quests[].objectivesArray
quests[].objectives[].indexint
quests[].objectives[].textString
quests[].objectives[].completedBoolean
quests[].objectives[].failedBoolean
quests[].objectives[].orWithPreviousBoolean

type is the game's quest type byte, which picks the Pip-Boy tab. Objective text has its tags expanded as in the Pip-Boy. Objectives are sorted by index. Pending reason: quests.

Game.GetInventory

Carried items

__SFCodeObj.call("Game.GetInventory"):String

No arguments.

Returns String (JSON)

FieldTypeDescription
itemsArray
items[].nameString
items[].handleint
items[].countint
items[].weightNumber
items[].valueNumber
items[].equipStateintOne of 0, 1.
items[].filterFlagint
items[].legendaryStarsint
items[].itemLevelint
items[].durabilityNumber
items[].currentHealthNumber
items[].maximumHealthNumber
items[].favoriteBoolean
items[].legendaryBoolean
items[].transferLockedBoolean
items[].canBeTransferLockedBoolean
items[].questItemBoolean
items[].canFavoriteBoolean
items[].taggedForSearchBoolean
items[].canDropBoolean
items[].canDestroyBoolean
items[].hasUniqueEffectBoolean
items[].damageArrayWeapons only. Zero rows are left out.
items[].damage[].typeintGame damage type id. 7 is a timed effect.
items[].damage[].valueNumber
items[].damage[].durationNumberSeconds, for timed effects.
items[].rateOfFireNumber or null
items[].rangeNumber or null
items[].accuracyNumber or null
items[].apCostNumber
items[].resistArrayArmor only.
items[].resist[].typeintGame damage type id. 7 is a timed effect.
items[].resist[].valueNumber
items[].resist[].durationNumberSeconds, for timed effects.
items[].weaponTypeintWeapons only. 255 and 0 to 6 melee, 7 to 9 ranged, 10 grenade or thrown, 11 mine.
items[].armorSlotsuintArmor only. Biped slot mask of the base form; bit n is slot n+30, for example bit 11 torso, 12 left arm, 13 right arm, 14 left leg, 15 right leg.
items[].keywordsArrayWeapons and armor only. Form IDs of the base form's keywords, for example 0x0004A0A0 WeaponTypePistol or 0x0004D8A1 ArmorTypePower.

weight and value are per unit. handle is the server item handle. filterFlag is the Pip-Boy filter bitmask. Weapons also have damage, rateOfFire, range, accuracy (null for weapon types whose item card omits them), apCost and weaponType; armor has resist.

armorSlots and keywords need Address Library IDs 326 to 332; with an older database they are left out. keywords lists the base form's keywords and those of its parent keyword forms, not keywords that modifications add, so a pistol that a stock mod turns into a rifle keeps WeaponTypePistol. The slot mask also comes from the base form only.

While the game is changing the inventory, the previous list is returned. While the stored item list is unchanged, the previous result is returned for up to one second, so condition and perk-adjusted values can be up to one second old. Pending reason: inventory.

Game.GetCollections

Collectibles the STAT page lists

__SFCodeObj.call("Game.GetCollections"):String

No arguments.

Returns String (JSON)

FieldTypeDescription
collectionsArray
collections[].nameString
collections[].formIdint
collections[].ownedint
collections[].capacityint
collections[].descriptionString

Sample result

{"collections":[{"name":"Bobblehead: Luck","formId":4097,"owned":3,"capacity":0,"description":"..."}]}

capacity 0 means no limit. Pending reason: collections.