xScal Scaleform API 0.4.34

Providers

Live HUD and Pip-Boy data as JSON strings, under the xsGet* names. These calls take no arguments.

The effects, time and map position calls return {"status":"inactive"} while the provider is disabled, and {"status":"pending","reason":"<reason>"} while the data cannot be read yet. The enemy and stealth calls use the data sentinels "notarget" and "unavailable" instead. A delivered value that cannot be returned produces {"status":"error","reason":"invalid_request"}.

xsGetEnemyMeterData

Target shown by the HUD enemy meter

__SFCodeObj.call("xsGetEnemyMeterData"):String

No arguments.

Returns String (JSON)

FieldTypeDescription
data"notarget" or Object
data.nameString
data.levelint or null
data.healthNumber or null
data.hostileBoolean
data.friendlyBoolean
data.kind"enemy" | "friendly" | "neutral"
data.bosstypeint
data.resistancesObjectPresent when native resistance collection succeeds.
data.resistances.damageNumber
data.resistances.energyNumber
data.resistances.radiationNumber
data.resistances.fireNumber
data.resistances.poisonNumber
data.resistances.cryoNumber
data.resistances.immuneObjectPresent when at least one immunity is set. Same keys, Boolean values.

Example

var enemy:Object = JSON.parse(__SFCodeObj.call("xsGetEnemyMeterData"));
if (enemy.data is Object) {
    trace(enemy.data.name, enemy.data.health);
}

xsGetStealthMeterData

Stealth meter state

__SFCodeObj.call("xsGetStealthMeterData"):String

No arguments.

Returns String (JSON)

FieldTypeDescription
data"unavailable" or Object
data.visibleBoolean
data.state"hidden" | "detected" | "caution" | "danger"
data.textString
data.percentNumberDisplayed, interpolated stealth percentage. 0 to 100.

xsGetPipboySTATSEffects

Visible Pip-Boy status effects

__SFCodeObj.call("xsGetPipboySTATSEffects"):String

No arguments.

Returns String (JSON)

FieldTypeDescription
EffectsAArray
EffectsA[].NameString
EffectsA[].EffectEntriesAArray
EffectsA[].EffectEntriesA[].textString
EffectsA[].EffectEntriesA[].durationNumber
EffectsA[].EffectEntriesA[].elapsedNumber
EffectsA[].EffectEntriesA[].remainingNumber
EffectsA[].EffectEntriesA[].magnitudeNumber
EffectsA[].EffectEntriesA[].isPercentageBoolean
EffectsA[].EffectEntriesA[].isStackedBoolean

An empty EffectsA array is valid. Pending reason: snapshot. Each effect entry has the text, duration, elapsed and remaining time, magnitude, a percentage flag and a stacked flag.

Example

var payload:Object = JSON.parse(__SFCodeObj.call("xsGetPipboySTATSEffects"));
for each (var effect:Object in payload.EffectsA) {
    trace(effect.Name);
}

xsGetTimeData

In-game clock

__SFCodeObj.call("xsGetTimeData"):String

No arguments.

Returns String (JSON)

FieldTypeDescription
TimeHourint0 to 23.
TimeMinint0 to 59.

Sample result

{"TimeHour":14,"TimeMin":5}

Game.Clock is the same callback. Pending reason: time_data.

xsGetPlayerMapPosition

Player position on the Pip-Boy map

__SFCodeObj.call("xsGetPlayerMapPosition"):String

No arguments.

Returns String (JSON)

FieldTypeDescription
MapXNumber
MapYNumber

Normalized Pip-Boy map coordinates, the same space as the x/y of the PlayerLocal marker in MapMenuData.MarkerData. Inside the map they are usually 0 to 1. In interiors, in worldspaces without map data, or before the game sets the map bounds, it returns pending with reason player_map_position.