Papyrus Runtime Errors
Format of a Runtime ErrorEdit
A Papyrus runtime error will almost always be structured as follows:
(Error/Warning): <error text> stack: <stack trace>
The error text could be one of several errors, of which the most common ones are listed below with explanations. This is followed by a "Stack trace", which is essentially the list of functions that were called (and where) which resulted in the error.
Warning vs. ErrorEdit
A warning is a condition that the game detects that is probably not what the script writer intended, but which is not an actual error itself. An error is something that prevents proper execution of a script, and is something that the script writer should fix.
Stack TracesEdit
Stack traces essentially pinpoint a location in your script, and the functions that were called, in sequence, to get to that location. They have the following format:
<Function A> - "<script file A>" Line A <Function B> - "<script file B>" Line B <Function C> - "<script file C>" Line C
In the above simplification, Function C was the function or event that the game called. That function, in script file C on line C, called function B. Function B then called function A, and function A in script A on line A, had the error happen.
If one of the functions is a native function, the script file will be listed as "<native>" and the line number will be a question mark.
If debug information is not being loaded (turning on debug info), then all line numbers will be question marks.
ExamplesEdit
[AMBDustDropDebris (0001E68C)].Sound.Play() - "<native>" LineĀ ? [FXdustDropRandomACT (000621D5)].fxDustDropRandomSCRIPT.OnLoad() - "fxDustDropRandomSCRIPT.psc" Line 25
In the above stack trace, the error was reported inside the Sound.Play() function, which was called on the AMBDustDropDebris (0001E68C) form. Because this function is a native one, the filename is "<native>" and the line number is "?".
This function was called by fxDustDropRandomSCRIPT.OnLoad() which, being the function at the bottom of the stack trace, is the event that the game called directly. This function can be found in the "fxDustDropRandomSCRIPT.psc" script, and the call to Play happened on line 25.
Common WarningsEdit
Common general runtime warnings follow, with basic explanations as to their causes and possible solutions. Warnings specific to a certain function are not listed here.
"X does not have a property named Y, property skipped."Edit
This warning appears when an instance of script X is being initialized and the masterfile or plugin provides a value for property Y, but that property does not exist. It usually indicates a script that has been changed, and is now out of date with the plugin. The fix is usually as simple as opening the property window for the script in question and OKing the auto-fixed data.
"Property Y on object X is read-only, property skipped."Edit
This warning appears when an instance of script X is being initialized and the masterfile or plugin provides a value for property Y, but that property is flagged as read-only (It does not have a set function). It usually indicates a script that has been changed, and is now out of date with the plugin. The fix is usually as simple as opening the property window for the script in question and OKing the auto-fixed data.
"The type of property Y on object X does not match the passed-in type at creation, property skipped."Edit
This warning appears when an instance of script X is being initialized and the masterfile or plugin provides a value for property Y, but the type of the plugin or masterfile data doesn't match the property type. It usually indicates a script that has been changed, and is now out of date with the plugin. The fix is to open up the property window for the affected property, and make sure the property is set to a valid value.
"Function X.Y.Z in stack frame A in stack B differs from the in-game resource files - using version from save"Edit
This warning can be emitted during the save game load process. It indicates that function X in state Y in script Z was running at the time of the save, and has been changed since the save was made. The game will use the old version of the function in the save until it exits.
"Function X.Y.Z in stack frame A in stack B doesn't exist in the in-game resource files - using version from save"Edit
This warning can be spit out during the save game load process. It indicates that function X in state Y in script Z no longer exists in the script on disc, but the game was in the middle of the function when the save was made. And so the game will use the version of the function recorded in the save until it exits.
"Unable to get type X referenced by the save game. Objects of this type will not be loaded."Edit
This warning can be emitted during the save game load process and indicates that some objects or type X were saved, but script X no longer exists (or failed to load).
"Type of variable X on script Y, which is Z, doesn't match the type loaded in the actual object. This variable will be skipped."Edit
Another warning that is displayed on save game load and indicates that variable X's type changed between when the save was made and when the save was loaded. Any saved value will be tossed out.
"Variable X on script Y loaded from save not found within the actual object. This variable will be skipped."Edit
This warning is displayed on save game load when variable X in the save no longer exists in the compiled script Y. This variable's value will be tossed out on load.
"Count of X stacks is over our warning threshold, dumping stacks:"Edit
This warning is output to the log when Papyrus thinks it is too busy and there may be runaway scripts. It will be followed by a dump of all running script threads. You should look through the dump for any suspicious behavior, such as several instances of the same script showing up a lot.
Common ErrorsEdit
Common general runtime errors follow, with basic explanations as to their causes and possible solutions. Errors specific to a certain function are not listed here.
"Cannot call X() on a None object, aborting function call"Edit
This error appears when function X, which is non-global, is called on an object variable that is None. Since you cannot call a non-global function on nothing, the call is ignored and the error printed out. If the variable is expected to be None, then you should probably check for None before calling the function on it. Otherwise you should inspect what is going on in the script at that time to see why the variable is None in the first place.
"Unable to call X - no native object bound to the script object, or object is of incorrect type"Edit
This error appears when native function X, which is non-global, is called on an object variable which does not point at an actual object in game. This usually happens in ActiveMagicEffect scripts which can have their effect deleted out from under them, or when calling certain functions on objects in containers.
"Cannot open store for class X, missing file?"Edit
This error appears when the game tries to load a requested script, but the file for it cannot be found. Double-check that the pex file is in the appropriate folder (Data/Scripts).
"Cannot divide by zero"Edit
A division by 0 was attempted, the denominator of a division or modulus operation cannot be 0.
"Assigning None to a non-object variable named X"Edit
An attempt was made to assign the value of "None" to a variable that cannot accept that value. This is usually a result of some previous failed function call to a function that returns a non-object variable, as a failed function call will then return None, and then will attempt to cram that value into the return variable. The 'real' error is usually immediately before this one.
"Array index X is out of range (0-Y)"Edit
An attempt was made to access an array element which does not exist. The element that was attempted to be accessed was X, where the valid range of indices is indicated by 0-Y. Make sure the value being used to index the array is within the range of the array.
"Cannot access an element of a None array"Edit
An attempt was made to access an array element of an array variable that is currently None. Make sure you validate the value of the array before attempting to use it.
"Struct does not have a variable with the name X and so it cannot be searched for"Edit
This error usually shows if a struct's members have been modified, but either the script holding the struct or the script doing the searching is out of date. Re-compiling both should reveal the problem.
"Struct type X does not contain a variable named Y"Edit
This error will show if two scripts are out of date with each other due to the struct's members being modified. Re-compiling both scripts should reveal the issue.
"Overridden function X in object Y does not have the same signature as in parent object Z."Edit
This error may appear while loading a script and indicates that function X, as defined in object Y, does not match object Y's parent's definition (in parent Z). In other words, the return type and/or parameters do not match. This usually means either Y or Z is out of date and needs to be re-compiled.
"Class X found more then once in objects derived from Y - circular inheritance isn't allowed."Edit
This error may appear while loading a script and indicates that somewhere in the inheritance between scripts X and Y there is a circular route. This usually means that X, Y, or some object in between is out of date and needs to be recompiled.
"Stack too deep (infinite recursion likely) - aborting call and returning None"Edit
Too many functions have been called without first returning from them. This usually happens due to infinite recursion in a script, but could also appear in highly complicated scripts that have lots of deep function calls. Try simplifying the script, removing the recursion, and making sure that any recursion has a termination condition.