the-elder-scrolls-v-skyrim – How to Save All Global Variables to a Text File in Skyrim

the-elder-scrolls-v-skyrim

There is a console command,

showglobalvars

that shows all global variables. Instead of getting that displayed in a console I want the output to be written in a text file.

I've heard about the command

SetConsoleOutputFilename 

However, it doesn't work properly, since using

scof "c:\temp\output.txt"

will output

SetConsoleOutputFilename  >>  "c:\temp\output.txt"

but no such file is created.

How do I successfully print all global variables in a text file?

Best Answer

In the comments, you indicate that you "just want to see [what] all the global variables are." In general, the easiest way to do this is to open the various ESP/ESM files in xEdit, which is a third-party modding tool. Although it is designed for modifying these files, it will give a very prominent warning before it actually lets you change anything, so it's perfectly usable as a viewer as well.

Once you've loaded Skyrim.esm and the DLC into xEdit, you can expand each of the ESP/ESM files in the panel on the left, which will show a list of categories. Expanding a category shows a list of individual records:

Screenshot of the xEdit interface.

This image is showing Fallout 3, but the same app also works on Skyrim's plugin files. Under the "Global Variables" category, there will be one record for each global variable. Clicking a record will display it in the area to the right of the navigation tree. For a global variable, it will tell you the name of that variable and the value it has at the start of the game. For other records, you will usually see a much larger amount of information. Clicking the "Referenced By" tab at the bottom will also tell you about all the places where other records use the global variable in some way.

If you don't want to download third-party software, you can instead use the official Creation Kit (install via Steam under "Tools" for the original Skyrim, or from the Bethesda Launcher for the Special Edition). It also organizes data into categories and records. You'll find the list of global variables under Miscellaneous / Global. Unfortunately, running the CK is a bit tricky for multiple reasons:

  1. It won't let you load multiple files.
  2. It won't let you load DLC, because that requires loading both the DLC file and Skyrim.esm.
  3. It crashes if you look at it funny.
  4. Depending on your setup, various bits of functionality might be broken (particularly related to Papyrus scripting). You probably don't need to care about this just to look at the list of globals.

These problems are fixable; see particularly this mod and this thread on Nexusmods. In short, you need to fiddle around with skyrimeditor.ini because its default values are (in many places) incorrect or otherwise problematic.