0 of 0

File information

Last updated

Original upload

Created by

utf8x

Uploaded by

utf8x

Virus scan

Safe to use

About this mod

PaperScript is a modern scripting language that compiles into Papyrus and is generally more modern and comfortable than Papyrus.

Permissions and credits
Mirrors
Donations
This project is an alpha proof of concept stage at the moment. Any feedback is greatly appreciated

You can follow me on Bluesky for real-time updates. You can also send me feedback there.

You can now submit feedback, ask questions and discuss PaperScript on the Discord Server!

PaperScript is a modern alternative to Papyrus that transpiles into valid Papyrus code.

New Documentation Site

Source Code

Changelog
  • v1.0.1-alpha.1 ==> Added support for switch blocks.
  • v1.0.2-alpha.1 ==> Property, Function, Script and Variable Flags, Get/Set Properties
  • v1.0.3-alpha.1 ==> states support - imports, multiline comments, elseif, negative ints and floats, casts, increment / decrement
  • v1.0.4-alpha.1 ==> full Fallout 4 support
  • v1.0.5-alpha.1 ==> added Array and Struct initializers
  • v1.0.6-alpha.1 ==> Fixed the void return, using reserved keywords as variable names throws an error


Support the Project
I'm mostly doing this for fun at the moment so I'm not comfortable with asking for donations. That being said, I would like to add Starfield support as well but I don't care for starfield enough to justify spending 70 euros on it so if somebody felt like gifting me copy on Steam, I would really appreciate that... My steam username is jac0bas

Why PaperScript?

Because Papyrus is annoying. It's not the worst language out there, but it's missing a lot of quality-of-life features and tends to be overly verbose.

For example, Papyrus doesn't support foreach or even for loops—just while. So something as simple as iterating over an array is tedious:


; Papyrus "foreach"
Int[] numbers = new Int[10]
Int numberIndex = 0
While numberIndex < numbers.Length
    Int number = numbers[numberIndex]
    DoSomething(number)
    numberIndex += 1
EndWhile


With PaperScript, you can write:


numbers: Int[] = new Int[10]

range number in numbers {
    DoSomething(number)
}


PaperScript transpiles that into the while loop for you—clean, readable, and less error-prone. More quality of life features, such as a switch are coming...

What Makes It Easy to Use?
From day one, PaperScript was designed to stay out of your way.

The transpiler doesn't just convert PaperScript to Papyrus—it also compiles it for you. When running in Project Mode, you configure the paths to your game's script source directory and the Papyrus compiler just once. After that, PaperScript takes care of the rest.

Whenever you update a .pps file, PaperScript automatically:

  • Transpiles it to Papyrus (.psc)
  • Copies it to your game’s script source folder
  • Runs the Papyrus compiler to produce the final .pex file

This means you can keep your PaperScript sources in a clean, organized Git repo—anywhere you like. PaperScript handles deployment and compilation behind the scenes, so you can focus on writing code instead of managing build steps.

In fact, it’s more convenient than writing Papyrus directly.

How It Works
The transpiler is built using C# and ANTLR4. This setup is great for rapid prototyping and early development, but the current version behaves more like a "Google Translate for code" than a full compiler.

This makes some features harder to implement and error reporting less helpful. For example, a simple typo like autso instead of auto might result in a confusing error:


syntax error at line 1, column 0: mismatched input 'property' expecting ':

In v2, the plan is to implement a proper recursive descent parser that builds an AST (Abstract Syntax Tree) and generates Papyrus from that. It'll be more robust, easier to extend, and allow for better error messages.

How to Use It

There are two main modes: single file and project.

🗃️ Project Mode (recommended)
Create a project.yaml file by running:


paperscript.exe init

Then compile all scripts in a folder by running:


paperscript.exe build

The project.yaml file contains paths to your skyrim script folder path. If you run init as admin, it will configure it automatically.

📄 Single File Mode
Transpile one .pps file at a time:


paperscript.exe transpile [file_name]

For syntax reference and more detailed documentation, please see the GitHub repo.