Fallout 4 Specific Features
PaperScript has support for all the new features added to Papyrus with Fallout 4.
New Function Flags
DebugOnly
BetaOnly
New Property Flags
Const
Mandatory
New Variable Flags
Const
New Script Flags
Native
Const
Property Groups
A property group makes the properties it contains show up in a visually separated group in Creation Kit. They have no other purpose.
group SomeGroup {
auto property PlayerREF: Actor
auto property Gold001: MiscItem
}
Namespaces
Namespaces can be used to differentiate between different scripts with the same name. In PaperScript, the namespace separator is a double colon (::
). You can "import" namespaces to use their members without typing the whole namespace every time.
script SomeNamespace::DemoScript : ScriptObject {}
// ...
import SomeNamespace
DemoScript.SomeMethod()
Structs
A struct
is a container of variables that acts like a type.
// Define a struct
struct Point {
x: Int
y: Int
}
// Initialize a struct
point1: Point = new Point
point1.x = 1
point1.y = 2
// or you can use the more concise struct initializer
point1: Point = { x: 1, y: 2 }
The `Is` operator
The is
operator can be used to check if a variable is of a particular type.
var1: Int = 0
if var1 is Int {
// true
}
The is
operator can be used in Skyrim PaperScript as well! It translates into a cast and a null check internally.
The `var` variable type
var1: Var = 123
Last updated