Class PapyrusSelfAttribute
- Namespace
- SkyrimForge.Papyrus
- Assembly
- SkyrimForge.Game.dll
Marks the first parameter of a method in a PapyrusScriptAttribute class as the form the script is attached to, making the method a non-global native function.
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
public sealed class PapyrusSelfAttribute : Attribute
- Inheritance
-
PapyrusSelfAttribute
- Inherited Members
Examples
[PapyrusScript(Extends = typeof(ObjectReference))]
public sealed class MyModNatives
{
public string Describe([PapyrusSelf] ObjectReference self) => self.GetDisplayFullName();
}
The build writes Scripts\Source\MyModNatives.psc:
Scriptname MyModNatives extends ObjectReference
string Function Describe() native
Remarks
The parameter's type is the class's Extends type. Papyrus passes the form as Self rather than as an argument,
so the .psc declares the function without this parameter, and Papyrus calls it on a form: (target as MyModNatives).Describe().
Constructors
PapyrusSelfAttribute()
public PapyrusSelfAttribute()