📜
PaperScript Docs
  • Welcome to PaperScript
  • Quick Start Guide
  • Syntax Reference
  • Feature Matrix
  • Feature Deep Dive
  • VSCode Extension
  • The Preprocessor
  • The project.yaml File
  • PaperScript CLI
    • Installing
    • Usage
  • Fallout 4 Support
  • Proposals
    • Naive Optimizations
  • Miscellaneous
    • Complete Example Scripts
Powered by GitBook
On this page
  • Creating a New Project
  • Write Some Code
  • Compile your Code
  • And that's it!
Edit on GitHub
Export as PDF

Quick Start Guide

This short guide will walk you through setting up PaperScript, initializing a project and building your first script.

Requirements

  • A working install of PaperScript (see Installing)

  • A working copy of Skyrim SE/AE and CreationKit. Make sure to run CK before starting so the script sources get copied.

  • A copy of the Papyrus Compier. This should get installed automatically with CK.

  • A text exitor. We recommend Visual Studio Code with the PaperScript VSCode Extension.

Creating a New Project

Create a folder to store your project and run paperscript init in that folder. This will generate a project.yaml for you.

The project initializer can detect where Skyrim is installed and set all paths automatically but it needs to run as Administrator to do this.

Afterwards, open the project.yaml file, fill in your project name and version and make sure all paths are set correctly.

Write Some Code

Create a file in the src/ directory with a .pps extension and write some PaperScript code. See Syntax Reference for a full reference.

Here is a minimal example:

script HelloWorldQuest : Quest {
  auto property PlayerREF: Auto
  auto property Gold001: MiscItem
  
  event OnInit() {
    RegisterForSingleUpdate()
  }
  
  event OnUpdate() {
    GiveGoldToActor(PlayerREF, 10)
  }
  
  def GiveGoldToActor(actor: Actor, amount: Int) {
    actor.AddItem(Gold001, amount)
  }
}

Compile your Code

For the first run, it's usually a good idea to run a one-off build to make sure everything works correctly. To do so, run paperscript build .

When you're sure everything is configured correctly, you can run PaperScript in watch mode, where it will automatically recompile any changed files in your project. You can run PaperScript in watch mode with paperscript watch.

Watch mode is not implemented yet but it is coming soon.

And that's it!

You should now have a fully functional PaperScript project. Happy coding!

PreviousWelcome to PaperScriptNextSyntax Reference

Last updated 2 days ago