Table of Contents

Method ToNwObject

Namespace
Anvil.API
Assembly
NWN.Anvil.dll

ToNwObject<T>(Guid)

Attempts to resolve a living active game object from the specified UUID.

public static T? ToNwObject<T>(this Guid objectId) where T : NwObject

Parameters

objectId Guid

The UUID of the object.

Returns

T

The game object with the given UUID, otherwise returns null if it does not exist.

Type Parameters

T

The expected object type.

Exceptions

InvalidCastException

Thrown if the resolved object is not of type T. Use ToNwObjectSafe<T>(Guid) to return null instead of throwing.

ToNwObject(Guid)

Attempts to resolve a living active game object from the specified UUID.

public static NwObject? ToNwObject(this Guid objectId)

Parameters

objectId Guid

The UUID of the object.

Returns

NwObject

The game object with the given UUID, otherwise returns null if it does not exist.