Difference between revisions of "Papyrus Compiler Errors"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Terra Nova2
m (Note about max length for script filename.)
imported>Cdcooley
(Add the two most common errors when Scripts.rar hasn't been unpacked properly.)
 
Line 9: Line 9:
== Confusing Error Messages ==
== Confusing Error Messages ==
Most error messages should be relatively self-explanatory, but some may confuse people. Potentially confusing errors are explained below:
Most error messages should be relatively self-explanatory, but some may confuse people. Potentially confusing errors are explained below:
=== "Unable to find flags file: TESV_Papyrus_Flags.flg" ===
The source files and that flag file are distributed in the Skyrim\Data\Scripts.rar archive. You must extract that file and the .psc files into the Skyrim\Data\Scripts\Source folder.
=== "The extends script does not exist, please pick one that does" ===
The script type your script is trying to extend does not exist. It could be because you have not extracted all of the source scripts from the Skyrim\Data\Scripts.rar archive.


=== "Missing X at 'Y'" ===  
=== "Missing X at 'Y'" ===  
Line 16: Line 22:
A common variation of the above.  The literal '''EOF''' refers to a missing '''E'''vent '''O'''r '''F'''unction.  This is the result of the compiler finding code statements outside of the scope of a function block.
A common variation of the above.  The literal '''EOF''' refers to a missing '''E'''vent '''O'''r '''F'''unction.  This is the result of the compiler finding code statements outside of the scope of a function block.


=== "Mismatched (input/character) 'X' expecting Y ===  
=== "Mismatched (input/character) 'X' expecting Y" ===  
The compiler expected Y, but found X instead. This is usually the result of a malformed line or misspelled keyword.
The compiler expected Y, but found X instead. This is usually the result of a malformed line or misspelled keyword.


=== "No viable alternative at input 'X' ===  
=== "No viable alternative at input 'X'" ===  
The compiler didn't expect X, and so cannot compile the element. Usually the result of a malformed line or missing parts.
The compiler didn't expect X, and so cannot compile the element. Usually the result of a malformed line or missing parts.



Latest revision as of 16:26, 22 June 2016

Format of a Compiler Error[edit | edit source]

A Papyrus compiler error is structured as follows:

<file>(<line>:<column>): <error>

Every error line starts with a full path to the file being examined. This is followed by the line and column where the error was detected. Note that this is not necessarily the exact line and character where the mistake is, but it is in the point at which the compiler detected the error. The actual error may be a few characters or even a line or two away.

Note that the compiler tries to recover from each error as it goes by faking a repair (usually by inserting what it expects, or ignoring some piece) and continuing on. This may lead to more errors. If you're having trouble figuring out what is causing an error that is in the middle of a list of errors, it may simply be a result of the compiler's attempted fix of an error it has previously reported. Try fixing the other errors in the file and compiling again.

Confusing Error Messages[edit | edit source]

Most error messages should be relatively self-explanatory, but some may confuse people. Potentially confusing errors are explained below:

"Unable to find flags file: TESV_Papyrus_Flags.flg"[edit | edit source]

The source files and that flag file are distributed in the Skyrim\Data\Scripts.rar archive. You must extract that file and the .psc files into the Skyrim\Data\Scripts\Source folder.

"The extends script does not exist, please pick one that does"[edit | edit source]

The script type your script is trying to extend does not exist. It could be because you have not extracted all of the source scripts from the Skyrim\Data\Scripts.rar archive.

"Missing X at 'Y'"[edit | edit source]

The compiler expected X, but found Y instead. This can usually be the result of a misspelled keyword, or malformed line.

"Missing EOF at 'Y'"[edit | edit source]

A common variation of the above. The literal EOF refers to a missing Event Or Function. This is the result of the compiler finding code statements outside of the scope of a function block.

"Mismatched (input/character) 'X' expecting Y"[edit | edit source]

The compiler expected Y, but found X instead. This is usually the result of a malformed line or misspelled keyword.

"No viable alternative at input 'X'"[edit | edit source]

The compiler didn't expect X, and so cannot compile the element. Usually the result of a malformed line or missing parts.

"Required (...)+ loop did not match anything at input 'X'"[edit | edit source]

The compiler expected a list of things, but got confused when it encountered X. You may be missing a comma somewhere, misspelled something, or have excess text at the end of a line.

"Error while attempting to read script X: <message>"[edit | edit source]

This is an internal compiler error that is usually the result of a failed error recovery mechanism. Try fixing any errors reported before this one.

Notes[edit | edit source]

  • The maximum amount of characters allowed for a filename with the compiler is 38 characters. Anything more than this and the compiler will complain regardless if the script itself is correct line by line.


Language: English  • français