xScal Scaleform API
Version 0.4.34
Functions xScal installs on the Scaleform code object, __SFCodeObj, in Fallout 76 menus. SWF mods call them from ActionScript 3.
The SWF creates the object, usually as this.stage.__SFCodeObj = {}. When the SWF first uses it, xScal installs three members on it:
| Member | Use |
|---|---|
call(name, ...args) | Calls one of the functions below by name and returns its result. |
version | Object with the runtime name, version and platform. |
modStorage | Per-mod JSON storage: save, load, register. |
Results described as String (JSON) are Strings; parse them with JSON.parse before use. The field tables list the parsed object.
Wrap xScal access in try/catch so the mod keeps working when xScal is missing or the game build is not supported:
try {
var result:* = __SFCodeObj.call("someFunctionName");
} catch (error:Error) {
// xScal is missing or the function is not available.
}Reference
Version
Runtime name, version and platform.
version | Runtime name, version and platform |
GetXSRuntimeInfo | Runtime information as JSON |
GetZFERuntimeInfo | Alias of GetXSRuntimeInfo |
Mod storage
One JSON document per name in Data/modsdata/<name>.json, through __SFCodeObj.modStorage.
modStorage.save | Save a named JSON document |
modStorage.load | Load a named JSON document |
modStorage.register | Bind the movie to one storage name (legacy) |
Input: keyboard
Windows virtual-key codes 1 to 255. A key must be registered before Input.IsKeyPressed reports it; unregistered keys return false. Polling a few keys once per frame is cheap.
Input.RegisterKey | Register a virtual key for polling |
Input.IsKeyPressed | Is a registered key held |
Input.UnregisterKey | Unregister one key |
Input.ClearKeys | Unregister every key |
Input.SuppressKey | Hide a key from Fallout 76 |
Input.UnsuppressKey | Stop hiding one key |
Input.ClearKeySuppressions | Stop hiding every key |
Input: gamepad
XInput digital button masks (1 to 65535) and an optional controller index (0 to 3, default 0). Combine buttons with bitwise OR. Extra held buttons do not stop a registered chord from matching.
Input.RegisterGamepadButtons | Register a button mask for polling |
Input.AreGamepadButtonsPressed | Are all buttons of a registered mask held |
Input.UnregisterGamepadButtons | Unregister one mask for one controller |
Input.ClearGamepadButtons | Unregister every mask on all four controllers |
Input.PollGamepad | Read buttons, triggers and sticks of one controller |
Input.SuppressGamepadButtons | Hide buttons from Fallout 76 |
Input.UnsuppressGamepadButtons | Stop hiding buttons |
Input.SuppressGamepadAnalog | Zero triggers and sticks for Fallout 76 |
Input.UnsuppressGamepadAnalog | Pass triggers and sticks to Fallout 76 again |
Input.ClearGamepadSuppressions | End every button and analog suppression |
Input: mouse
Mouse capture. While captured, raw-input mouse records are added to the totals Input.PollMouse returns and are not passed to Fallout 76.
Input.BeginMouseCapture | Start capturing mouse input |
Input.PollMouse | Read and reset mouse totals |
Input.EndMouseCapture | Stop capturing mouse input |
Input: text
One owned text-input session at a time. While a session exists, xScal consumes keyboard key, character and raw-input messages before Fallout 76 gets them; mouse raw input still reaches the game. The native buffer holds at most 512 UTF-16 code units. A key still held when the session ends stays consumed until its key-up message.
Input.BeginInput | Start the owned text-input session |
Input.PollInput | Read the session's text, cursor and state |
Input.EndInput | Close the session |
Providers
Live HUD and Pip-Boy data as JSON strings, under the xsGet* names. These calls take no arguments.
xsGetEnemyMeterData | Target shown by the HUD enemy meter |
xsGetStealthMeterData | Stealth meter state |
xsGetPipboySTATSEffects | Visible Pip-Boy status effects |
xsGetTimeData | In-game clock |
xsGetPlayerMapPosition | Player position on the Pip-Boy map |
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.
Game.Clock | Alias of xsGetTimeData |
Game.GetAS3Object | Result of a Game.* call as an ActionScript object |
Game.GetSpecial | Current SPECIAL values (Steam only) |
Game.GetStatus | Player vitals from the Pip-Boy header and STAT page |
Game.GetPlayerInfo | Name, level and XP |
Game.GetPerks | Perk cards |
Game.GetQuests | Quest objectives the Pip-Boy lists |
Game.GetInventory | Carried items |
Game.GetCollections | Collectibles the STAT page lists |
Engine graphics
Published by the Fallout76 NX plugin (Fallout76_DLSSFrameGen.dll) through xScal's plugin callback ABI. If the plugin is missing or rejected, these names do not exist. Setters return false when the feature cannot be enabled in the active renderer session.
Engine.EnableDLSSFrameGen | Enable DLSS frame generation |
Engine.DisableDLSSFrameGen | Disable DLSS frame generation |
Engine.EnableFSRFrameGen | Enable FSR frame generation |
Engine.DisableFSRFrameGen | Disable FSR frame generation |
Engine.EnableReflex | Save Reflex On |
Engine.DisableReflex | Save Reflex Off |
Engine.AvailableUpscalers | Providers the active renderer supports |
Engine.GetUpscalerState | Requested frame-generation backend and applied Reflex mode |
Engine.SetFramegenProvider | Save the frame-generation backend for the next session |
Plugin options
Options that loaded xScal plugins publish, for in-game settings menus.
xsGetPluginOptions | Options of every active plugin |
xsSetPluginOption | Change one plugin option |
SFE legacy
Old callback names kept so existing mods work without changes.
log | FCM diagnostic log |
writeBuffDataFile | Replace Data\BuffData.ini |
writeChallengeDataFile | Replace Data\ChallengeData.ini |
writePerksFile | Replace Data\perkloadoutmanager.ini |
writeSaveEverythingFile | Replace Data\saveeverything.ini |
writeItemsModFile | Replace Data\itemsmod.ini |
writeLegendaryModsFile | Replace Data\LegendaryMods.ini |
writeVendorLogFile | Append to Data\vendorlog.txt |
writeDPSMeterFile | Replace Data\DPSMeter.txt |
writeCampSearchConfigFile | Replace Data\CAMPSearch.ini |
writeBlockFile | Replace Data\configuration\blocklist.ini |
writeCampDataFile | Replace Data\CampData.ini |
writeCharacterDataFile | Replace Data\CharacterData.ini |