Skip to content

Debugging

Joel Day edited this page Sep 23, 2019 · 6 revisions

The Papyrus Language extension provides a runtime debugger for Skyrim Special Edition and Fallout 4 which will display live diagnostics on executing scripts and some game information.

The runtime Papyrus debugger is capable of pausing the game's execution at user defined breakpoints within Papyrus source code.

Within VS Code, these breakpoints are represented as solid red dots that are visible next to lines in source code. Breakpoints can be placed in bugged source code to pause the game at a given point.

As the game is running, you may run the attachDebugger command to begin debugging. When a breakpoint is reached the game will pause and begin to communicate with VS Code. While the game is paused you may inspect loaded scripts, navigate the call stack, and view a script's properties & variables.

Table of Contents

Installation

  • Press Control + Shift + P to bring up the command palate.
  • Begin typing papyrus and execute the papyrus.fallout4.installDebuggerSupport command".

Updating

Before the attachDebugger command is run, the Papyrus Language extension will prompt to automatically update the xSE plugin if necessary. Optionally you may run the installDebuggerSupport command to replace the xSE plugin files at any time.

Usage

  • Launch the game.
    • (Optionally) Configure the game for windowed mode to easily change focus between desktop windows.
  • Once the game has launched, attach the VS Code debugger to the game's process. This can be done by one of the following ways.
    • Open the VS Code Debug sidebar and click Start Debugging.
    • Press Control + Shift + P to bring up the command palate and execute papyrus.fallout4.attachDebugger.

If you are debugging scripts that are compiled as part of a .ppj, you will need to add a debugging configuration (launch.json) and specify projectPath as the path to the .ppj file.

Breakpoints

Once the debugger is attached to the game's process you will immediately be able to view any loaded scripts and all currently executing stacks.

Debug View

Commands

The Papyrus Language extension provides some commands for debugger support.

Install Debugger Support

Installs Papyrus debugging support for Fallout 4.

  • Command: papyrus.fallout4.installDebuggerSupport

Attach Debugger

Attaches the Papyrus debugger to Fallout 4.

  • Command: papyrus.fallout4.attachDebugger

See Also

Clone this wiki locally