Starfield Mod:Papyrus Syntax Reference

From Starfield Wiki
Jump to: navigation, search


(Note: This list was extracted from PCompiler.dll 4.7.0.5 and is not complete. )

Syntax Elements in Starfield Papyrus
Token Desc Notes
ScriptName Defines the name of the script.
Function Starts a function block.
EndFunction Ends a function block.
Event Starts an event block.
EndEvent Ends an event block.
CustomEvent Declares a custom event.
Native Marks a function or property as native (defined in engine).
Global Declares a global variable or function.
Const Declares a constant value.
DebugOnly Marks content as for debugging purposes only.
BetaOnly Marks content as for beta builds only.
RequiresGuard Requires a guard for execution.
ProtectsFunctionLogic Protects function logic from certain alterations.
SelfOnly Restricts access to self-context only.
Private Declares a private scope.
Protected Declares a protected scope.
Internal Declares internal access.
Return Exits a function and optionally returns a value.
As Used for typecasting.
Is Compares object type.
If Starts a conditional block.
ElseIf Adds an additional condition to an If block.
Else Specifies the else block for an If statement.
EndIf Ends a conditional block.
Extends Specifies the parent class of the script.
Import Imports another script for use.
Auto Automatically generates getters/setters for a property.
AutoReadOnly Automatically generates a read-only property.
Struct Starts a structure definition.
EndStruct Ends a structure definition.
State Starts a state block.
EndState Ends a state block.
Guard Defines a guard block.
Property Declares a property.
EndProperty Ends a property declaration.
Group Groups multiple Properties
EndGroup Ends a group block.
collapsed group should display as collapsed in CK
While Starts a while loop.
EndWhile Ends a while loop.
LockGuard Starts a lock guard block.
EndLockGuard Ends a lock guard block.
TryLockGuard Starts a try-lock guard block.
ElseTryLockGuard Adds an else clause to a try-lock guard.
EndTryLockGuard Ends a try-lock guard block.
None Represents a null or none value.
New Allocates a new instance of a type.
Bool Boolean data type.
Float Floating-point data type.
String String data type.
Int Integer data type.
( Left parenthesis.
) Right parenthesis.
{ Left brace.
} Right brace.
[ Left bracket.
] Right bracket.
, Comma.
= Assignment or equality operator.
+ Addition operator.
- Subtraction operator.
* Multiplication operator.
/ Division operator.
% Modulus operator.
. Dot operator.
" Quotation mark.
! Negation or not operator.
== Equality comparison operator.
!= Inequality comparison operator.
> Greater-than operator.
< Less-than operator.
>= Greater-than-or-equal operator.
<= Less-than-or-equal operator.
Logical OR operator.
&& Logical AND operator.
: Colon.
+= Addition assignment operator.
-= Subtraction assignment operator.
*= Multiplication assignment operator.
/= Division assignment operator.
%= Modulus assignment operator.
; Comment indicator.
0x Hexadecimal digit.