Table of Contents

Struct PapyrusValue

Namespace
SkyrimForge.Papyrus
Assembly
SkyrimForge.Game.dll

One Papyrus value, read as whichever type is requested: an argument a script passed, a value a function returned, or a property.

public readonly ref struct PapyrusValue
Inherited Members

Remarks

An argument or receiver is valid only for the duration of the PapyrusCall that provided it. Copy a value out to use it after the call.

Properties

Bool

The value as a bool.

public bool Bool { get; }

Property Value

bool

Exceptions

InvalidOperationException

It stores another type.

Float

The value as a float.

public float Float { get; }

Property Value

float

Exceptions

InvalidOperationException

It stores another type.

Form

The value as a form, or null where it is None.

public Form? Form { get; }

Property Value

Form?

Exceptions

InvalidOperationException

It stores a type other than an object.

Int

The value as an int.

public int Int { get; }

Property Value

int

Exceptions

InvalidOperationException

It stores another type.

String

The value as a string, empty where nothing wrote one.

public string String { get; }

Property Value

string

Exceptions

InvalidOperationException

It stores another type.

Methods

Array()

Reads the value as an array.

public PapyrusArray Array()

Returns

PapyrusArray

No entries where the value is None.

Exceptions

InvalidOperationException

It stores a type other than an array.

As<T>()

Reads the value as T, which is int, float, bool, string, a form view, or an array of one of those.

public T? As<T>()

Returns

T

Type Parameters

T

Exceptions

InvalidOperationException

It stores another type, a form that is not a T, an array entry that is not of T's element type, or it is None and T is a non-nullable value type.

TypeInitializationException

Papyrus has no such type, wrapping the NotSupportedException that names it.