reckfellENGINE

ReckfellObject

The reflected base object with methods, properties, signals and notifications.

On this page
class ReckfellObjectReckfellSharp

ReckfellObject does not imply a level object or automatic memory ownership. Entity uses hierarchical/explicit native deletion; RefCounted/Resource have a different reference model. A non-null C# variable does not guarantee a live native object: use IsInstanceValid when needed. InstanceId belongs to the current process, not an asset UID or stable gameplay ID.

_Notification receives an event code. Prefer _EnterTree/_Ready/_ExitTree for ordinary Entity lifecycle. In the checked C# bridge, a RefCounted script does not receive Predelete; it is not a universal Resource cleanup hook. Sending a system notification number does not perform all the work of actual AddChild/RemoveChild.

Practical guide.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

ReckfellObjectConstructor
# ReckfellObject
C#
public ReckfellObject();

Constructs a new ReckfellObject.

Properties1

NativeInstanceProperty
# NativeInstance
C#
public IntPtr NativeInstance { get; }

The pointer to the native instance of this ReckfellObject.

Methods70

AddUserSignalvoid
# AddUserSignal
C#
public void AddUserSignal(string signal, Reckfell.Collections.Array arguments = null);

Adds a dynamic signal to this instance. The name must not conflict with an existing signal/built-in member; this does not register it for every instance of the class.

Parameters
NameTypeDefault
signalstring—
argumentsReckfell.Collections.Arraynull
signal

Exact declared or dynamic signal name.

arguments

Optional signal argument-description dictionaries, including name and type.

Call2 overloads
# Call · 1/2
C#
public Variant Call(StringName method, params Variant[] args);

Dynamically calls an instance method with Variant arguments. Prefer the typed API for known types; use an exact method name and compatible arguments.

Parameters
NameTypeDefault
methodStringName—
argsVariant[]—
method

Exact dynamic method name; set_position for the built-in Entity2D setter.

args

Arguments in declaration order with compatible method/signal types.

Returns Variant

Synchronous method result as Variant.

# Call · 2/2
C#
public Variant Call(StringName method, ReadOnlySpan<Variant> args);

Calls the method on the object and returns the result. This method supports a variable number of arguments, so parameters can be passed as a comma separated list.

C#
var node = new Entity3D();
node.Call(Entity3D.MethodName.Rotate, new Vector3(1f, 0f, 0f), 1.571f);

Note: In C#, method must be in snake_case when referring to built-in Reckfell methods. Prefer using the names exposed in the MethodName class to avoid allocating a new StringName on each call.

Parameters
NameTypeDefault
methodStringName—
argsReadOnlySpan<Variant>—
Returns Variant
CallDeferred2 overloads
# CallDeferred · 1/2
C#
public Variant CallDeferred(StringName method, params Variant[] args);

Queues a method call instead of running it immediately. Processing is not guaranteed to be exactly the next frame; the returned Variant is not the eventual call result.

Parameters
NameTypeDefault
methodStringName—
argsVariant[]—
method

Exact dynamic method name; set_position for the built-in Entity2D setter.

args

Arguments in declaration order with compatible method/signal types.

Returns Variant

Nil; not the eventual queued method result.

# CallDeferred · 2/2
C#
public Variant CallDeferred(StringName method, ReadOnlySpan<Variant> args);

Calls the method on the object during idle time. Always returns null, not the method's result. Idle time happens mainly at the end of process and physics frames. In it, deferred calls will be run until there are none left, which means you can defer calls from other deferred calls and they'll still be run in the current idle time cycle. This means you should not call a method deferred from itself (or from a method called by it), as this causes infinite recursion the same way as if you had called the method directly. This method supports a variable number of arguments, so parameters can be passed as a comma separated list.

C#
var node = new Entity3D();
node.CallDeferred(Entity3D.MethodName.Rotate, new Vector3(1f, 0f, 0f), 1.571f);

For methods that are deferred from the same thread, the order of execution at idle time is identical to the order in which [code skip-lint]call_deferred was called. See also [Callable.CallDeferred](/en/docs/api/callable#member-calldeferred-6eb547e57a). **Note:** In C#, methodmust be in snake_case when referring to built-in Reckfell methods. Prefer using the names exposed in theMethodName class to avoid allocating a new [StringName](/en/docs/api/stringname) on each call. **Note:** If you're looking to delay the function call by a frame, refer to the [EntityTree.ProcessFrame](/en/docs/api/entitytree#member-processframe-42ca8a2523) and [EntityTree.PhysicsFrame`](/en/docs/api/entitytree#member-physicsframe-194dd11175) signals.

Parameters
NameTypeDefault
methodStringName—
argsReadOnlySpan<Variant>—
Returns Variant
CallvVariant
# Callv
C#
public Variant Callv(StringName method, Reckfell.Collections.Array argArray);

Calls the method on the object and returns the result. Unlike ReckfellObject.Call, this method expects all parameters to be contained inside arg_array.

C#
var node = new Entity3D();
node.Callv(Entity3D.MethodName.Rotate, [new Vector3(1f, 0f, 0f), 1.571f]);

Note: In C#, method must be in snake_case when referring to built-in Reckfell methods. Prefer using the names exposed in the MethodName class to avoid allocating a new StringName on each call.

Parameters
NameTypeDefault
methodStringName—
argArrayReckfell.Collections.Array—
Returns Variant
CanTranslateMessagesbool
# CanTranslateMessages
C#
public bool CanTranslateMessages();

Returns true if the object is allowed to translate messages with ReckfellObject.Tr and ReckfellObject.TrN. See also ReckfellObject.SetMessageTranslation.

Returns bool
CancelFreevoid
# CancelFree
C#
public void CancelFree();

If this method is called during ReckfellObject.NotificationPredelete, this object will reject being freed and will remain allocated. This is mostly an internal function used for error handling to avoid the user from freeing objects when they are not intended to.

ConnectError
# Connect
C#
public Error Connect(StringName signal, Callable callable, uint flags = 0);

Connects a Callable to the signal using the flags. Normal delivery is synchronous; Deferred queues the callback and OneShot disconnects after its first call. Retain the Callable for later disconnection.

Parameters
NameTypeDefault
signalStringName—
callableCallable—
flagsuint0
signal

Exact declared or dynamic signal name.

callable

Callable with a compatible signature; retain its identity.

flags

ConnectFlags bitmask; 0 means a normal connection.

Returns Error

Error.Ok on successful connection, otherwise an error code.

Disconnectvoid
# Disconnect
C#
public void Disconnect(StringName signal, Callable callable);

Disconnects an existing connection with the same Callable. Check IsConnected when needed; an unrelated new lambda does not replace the retained callback.

Parameters
NameTypeDefault
signalStringName—
callableCallable—
signal

Exact declared or dynamic signal name.

callable

Callable with a compatible signature; retain its identity.

Disposevoid
# Dispose
C#
public void Dispose();

Disposes of this ReckfellObject.

EmitSignal2 overloads
# EmitSignal · 1/2
C#
public Error EmitSignal(StringName signal, params Variant[] args);

Emits a signal with arguments matching its declaration. Normal connections are invoked immediately; successful emission does not prove each callback logic is correct.

Parameters
NameTypeDefault
signalStringName—
argsVariant[]—
signal

Exact declared or dynamic signal name.

args

Arguments in declaration order with compatible method/signal types.

Returns Error

Error.Ok on successful emission, otherwise an error code.

# EmitSignal · 2/2
C#
public Error EmitSignal(StringName signal, ReadOnlySpan<Variant> args);

Emits the given signal by name. The signal must exist, so it should be a built-in signal of this class or one of its inherited classes, or a user-defined signal (see ReckfellObject.AddUserSignal). This method supports a variable number of arguments, so parameters can be passed as a comma separated list. Returns ERR_UNAVAILABLE if signal does not exist or the parameters are invalid.

C#
EmitSignal(SignalName.Hit, "sword", 100);
EmitSignal(SignalName.GameOver);

Note: In C#, signal must be in snake_case when referring to built-in Reckfell signals. Prefer using the names exposed in the SignalName class to avoid allocating a new StringName on each call.

Parameters
NameTypeDefault
signalStringName—
argsReadOnlySpan<Variant>—
Returns Error
Freevoid
# Free
C#
public void Free();

Deletes the object from memory. Pre-existing references to the object become invalid, and any attempt to access them will result in a runtime error. Checking the references with @GlobalScope.is_instance_valid will return false. This is equivalent to the memdelete function in ReckfellExtension C++.

GetVariant
# Get
C#
public Variant Get(StringName property);

Reads an instance property by its native/script name. This is a dynamic Variant value, not reflection of every CLR property; use GetPropertyList and the object contract.

Parameters
NameTypeDefault
propertyStringName—
property

Instance property name, such as position.

Returns Variant

Property value as Variant.

GetClassstring
# GetClass
C#
public string GetClass();

Returns the native class name, such as Entity2D, not the attached C# script managed type name. Use GetType for the CLR type.

Returns string

Native object type name.

GetIncomingConnectionsReckfell.Collections.Array<Reckfell.Collections.Dictionary>
# GetIncomingConnections
C#
public Reckfell.Collections.Array<Reckfell.Collections.Dictionary> GetIncomingConnections();

Returns an Reckfell.Collections.Array of signal connections received by this object. Each connection is represented as a Reckfell.Collections.Dictionary that contains three entries:

Returns Reckfell.Collections.Array<Reckfell.Collections.Dictionary>
GetIndexedVariant
# GetIndexed
C#
public Variant GetIndexed(EntityPath propertyPath);

Reads a nested property component through EntityPath, such as position:x. This is a property path, not a child Entity lookup.

Parameters
NameTypeDefault
propertyPathEntityPath—
propertyPath

Property/component EntityPath, such as position:x.

Returns Variant

Value of the specified nested component.

GetInstanceIdulong
# GetInstanceId
C#
public ulong GetInstanceId();

Returns a live object transient identifier for InstanceFromId lookup. Does not extend object lifetime or provide a persistent save-file ID.

Returns ulong

Current object identifier as ulong.

GetMetaVariant
# GetMeta
C#
public Variant GetMeta(StringName name, Variant @default = default);

Reads metadata. For an absent name use HasMeta or an explicit non-Nil default; a missing entry with default=Nil reports an error instead of silently probing presence.

Parameters
NameTypeDefault
nameStringName—
defaultVariantdefault
name

Exact case-sensitive metadata identifier.

default

Non-Nil fallback when a missing entry is permitted.

Returns Variant

Entry value, or the explicit fallback when absent.

GetMetaListReckfell.Collections.Array<StringName>
# GetMetaList
C#
public Reckfell.Collections.Array<StringName> GetMetaList();

Returns current metadata names, including entries hidden from normal Inspector display. This is not a class property list.

Returns Reckfell.Collections.Array<StringName>

Collection of current metadata names.

GetMethodArgumentCountint
# GetMethodArgumentCount
C#
public int GetMethodArgumentCount(StringName method);

Returns the number of arguments of the given method by name. Note: In C#, method must be in snake_case when referring to built-in Reckfell methods. Prefer using the names exposed in the MethodName class to avoid allocating a new StringName on each call.

Parameters
NameTypeDefault
methodStringName—
Returns int
GetMethodListReckfell.Collections.Array<Reckfell.Collections.Dictionary>
# GetMethodList
C#
public Reckfell.Collections.Array<Reckfell.Collections.Dictionary> GetMethodList();

Returns instance method metadata, including its supported script context. This is not a universal list of every special language-wrapper operation.

Returns Reckfell.Collections.Array<Reckfell.Collections.Dictionary>

Collection of instance method metadata dictionaries.

GetPropertyListReckfell.Collections.Array<Reckfell.Collections.Dictionary>
# GetPropertyList
C#
public Reckfell.Collections.Array<Reckfell.Collections.Dictionary> GetPropertyList();

Returns property metadata dictionaries for this instance, including supported native and dynamic/script declarations. Describes the object API, not an arbitrary CLR graph.

Returns Reckfell.Collections.Array<Reckfell.Collections.Dictionary>

Collection of instance property metadata dictionaries.

GetScriptVariant
# GetScript
C#
public Variant GetScript();

Returns the object's Script instance, or null if no script is attached.

Returns Variant
GetSignalConnectionListReckfell.Collections.Array<Reckfell.Collections.Dictionary>
# GetSignalConnectionList
C#
public Reckfell.Collections.Array<Reckfell.Collections.Dictionary> GetSignalConnectionList(StringName signal);

Returns an Reckfell.Collections.Array of connections for the given signal name. Each connection is represented as a Reckfell.Collections.Dictionary that contains three entries:

Parameters
NameTypeDefault
signalStringName—
Returns Reckfell.Collections.Array<Reckfell.Collections.Dictionary>
GetSignalListReckfell.Collections.Array<Reckfell.Collections.Dictionary>
# GetSignalList
C#
public Reckfell.Collections.Array<Reckfell.Collections.Dictionary> GetSignalList();

Returns metadata for instance signals, including those added by AddUserSignal. Distinct from a registered-class-only list.

Returns Reckfell.Collections.Array<Reckfell.Collections.Dictionary>

Collection of instance signal metadata dictionaries.

GetTranslationDomainStringName
# GetTranslationDomain
C#
public StringName GetTranslationDomain();

Returns the name of the translation domain used by ReckfellObject.Tr and ReckfellObject.TrN. See also TranslationServer.

Returns StringName
HasConnectionsbool
# HasConnections
C#
public bool HasConnections(StringName signal);

Returns true if any connection exists on the given signal name. Note: In C#, signal must be in snake_case when referring to built-in Reckfell methods. Prefer using the names exposed in the SignalName class to avoid allocating a new StringName on each call.

Parameters
NameTypeDefault
signalStringName—
Returns bool
HasMetabool
# HasMeta
C#
public bool HasMeta(StringName name);

Tests metadata presence without reading a missing value. After SetMeta with Nil the entry is absent.

Parameters
NameTypeDefault
nameStringName—
name

Exact case-sensitive metadata identifier.

Returns bool

True when the entry exists.

HasMethodbool
# HasMethod
C#
public bool HasMethod(StringName method);

Checks method availability on this instance, including its script context. Built-in string names are case-sensitive: set_position is not SetPosition.

Parameters
NameTypeDefault
methodStringName—
method

Exact dynamic method name; set_position for the built-in Entity2D setter.

Returns bool

True when the method is available on the instance.

HasSignalbool
# HasSignal
C#
public bool HasSignal(StringName signal);

Tests signal availability on the instance, including inherited and supported dynamic declarations.

Parameters
NameTypeDefault
signalStringName—
signal

Exact declared or dynamic signal name.

Returns bool

True when the signal is available.

HasUserSignalbool
# HasUserSignal
C#
public bool HasUserSignal(StringName signal);

Tests an instance dynamic user signal, distinguishing it from a regular inherited class declaration.

Parameters
NameTypeDefault
signalStringName—
signal

Exact declared or dynamic signal name.

Returns bool

True for a dynamic user signal.

InstanceFromIdReckfellObject
# InstanceFromId
C#
public static ReckfellObject? InstanceFromId(ulong instanceId);

Resolves a current ID to an object, or null after destruction. An ID does not retain an Entity or replace current lifetime validation.

Parameters
NameTypeDefault
instanceIdulong—
instanceId

Previously obtained current ID, not an identifier from another run.

Returns ReckfellObject

Live object, or null.

IsBlockingSignalsbool
# IsBlockingSignals
C#
public bool IsBlockingSignals();

Returns true if the object is blocking its signals from being emitted. See ReckfellObject.SetBlockSignals.

Returns bool
IsClass2 overloads
# IsClass · 1/2
C#
public bool IsClass(StringName @class);

Checks the native type and its base classes by exact ClassDB name. Does not test an arbitrary CLR class or the object tree position.

Parameters
NameTypeDefault
classStringName—
class

Exact native ClassDB class name.

Returns bool

True for the native type itself or its ancestor.

# IsClass · 2/2
C#
public bool IsClass(string @class);

Checks the native type and its base classes by exact ClassDB name. Does not test an arbitrary CLR class or the object tree position.

Parameters
NameTypeDefault
classstring—
class

Exact native ClassDB class name.

Returns bool

True for the native type itself or its ancestor.

IsConnectedbool
# IsConnected
C#
public bool IsConnected(StringName signal, Callable callable);

Tests the specific signal/Callable pair, not merely whether any listener exists.

Parameters
NameTypeDefault
signalStringName—
callableCallable—
signal

Exact declared or dynamic signal name.

callable

Callable with a compatible signature; retain its identity.

Returns bool

True when this pair is connected.

IsInstanceIdValidbool
# IsInstanceIdValid
C#
public static bool IsInstanceIdValid(ulong id);

Returns true if the ReckfellObject that corresponds to id is a valid object (e.g. has not been deleted from memory). All Objects have a unique instance ID.

Parameters
NameTypeDefault
idulong—
id

The Object ID to check.

Returns bool

If the instance with the given ID is a valid object.

IsInstanceValidbool
# IsInstanceValid
C#
public static bool IsInstanceValid(ReckfellObject? instance);

Tests whether the wrapper has a valid native object; null or a freed wrapper returns false. An Entity already marked QueueFree can remain valid until deletion.

Parameters
NameTypeDefault
instanceReckfellObject—
instance

Object wrapper to test, or null.

Returns bool

True for a valid native object.

IsQueuedForDeletionbool
# IsQueuedForDeletion
C#
public bool IsQueuedForDeletion();

Returns true if the methods Entity.QueueFree or EntityTree.QueueDelete was called for the object. Note: This method does not return true on children of the node that Entity.QueueFree has been called on, even though they will be freed together with the parent.

Returns bool
Notificationvoid
# Notification
C#
public void Notification(int what, bool reversed = false);

Delivers a notification number. Sending a system number does not perform the complete object attachment/deletion protocol.

Parameters
NameTypeDefault
whatint—
reversedboolfalse
NotifyPropertyListChangedvoid
# NotifyPropertyListChanged
C#
public void NotifyPropertyListChanged();

Emits the ReckfellObject.PropertyListChanged signal. This is mainly used to refresh the editor, so that the Inspector and editor plugins are properly updated.

PropertyCanRevertbool
# PropertyCanRevert
C#
public bool PropertyCanRevert(StringName property);

Override this method to customize the given property's revert behavior. Should return true if the property has a custom default value and is revertible in the Inspector dock. Use ReckfellObject.PropertyGetRevert to specify the property's default value. Note: This method must return consistently, regardless of the current value of the property. Note: Unlike other virtual methods, this method is called automatically for every script that overrides it. This means that the base implementation should not be called via super in C# or its equivalents in other languages. The bottom-most sub-class will be called first, with subsequent calls ascending the class hierarchy. The call chain will stop on the first class that returns true.

Parameters
NameTypeDefault
propertyStringName—
Returns bool
PropertyGetRevertVariant
# PropertyGetRevert
C#
public Variant PropertyGetRevert(StringName property);

Override this method to customize the given property's revert behavior. Should return the default value for the property. If the default value differs from the property's current value, a revert icon is displayed in the Inspector dock. Note: ReckfellObject.PropertyCanRevert must also be overridden for this method to be called. Note: Unlike other virtual methods, this method is called automatically for every script that overrides it. This means that the base implementation should not be called via super in C# or its equivalents in other languages. The bottom-most sub-class will be called first, with subsequent calls ascending the class hierarchy. The call chain will stop on the first class that returns a non-null value.

Parameters
NameTypeDefault
propertyStringName—
Returns Variant
RemoveMetavoid
# RemoveMeta
C#
public void RemoveMeta(StringName name);

Removes the named metadata entry. Corresponds to SetMeta with Nil and does not change the native class definition.

Parameters
NameTypeDefault
nameStringName—
name

Exact case-sensitive metadata identifier.

RemoveUserSignalvoid
# RemoveUserSignal
C#
public void RemoveUserSignal(StringName signal);

Removes the given user signal signal from the object. See also ReckfellObject.AddUserSignal and ReckfellObject.HasUserSignal.

Parameters
NameTypeDefault
signalStringName—
Setvoid
# Set
C#
public void Set(StringName property, Variant value);

Writes an instance property through its dynamic setter. Name and type must match the object; position addresses the native Entity2D property.

Parameters
NameTypeDefault
propertyStringName—
valueVariant—
property

Instance property name, such as position.

value

Compatible Variant value; Nil removes metadata in SetMeta.

SetBlockSignalsvoid
# SetBlockSignals
C#
public void SetBlockSignals(bool enable);

If set to true, the object becomes unable to emit signals. As such, ReckfellObject.EmitSignal and signal connections will not work, until it is set to false.

Parameters
NameTypeDefault
enablebool—
SetDeferredvoid
# SetDeferred
C#
public void SetDeferred(StringName property, Variant value);

Queues a property assignment. The current value need not change inline; this does not promise a specific following frame number.

Parameters
NameTypeDefault
propertyStringName—
valueVariant—
property

Instance property name, such as position.

value

Compatible Variant value; Nil removes metadata in SetMeta.

SetIndexedvoid
# SetIndexed
C#
public void SetIndexed(EntityPath propertyPath, Variant value);

Writes a nested property component through EntityPath while updating the original value. In the checked position:x case X changes and Y is preserved.

Parameters
NameTypeDefault
propertyPathEntityPath—
valueVariant—
propertyPath

Property/component EntityPath, such as position:x.

value

Compatible Variant value; Nil removes metadata in SetMeta.

SetMessageTranslationvoid
# SetMessageTranslation
C#
public void SetMessageTranslation(bool enable);

If set to true, allows the object to translate messages with ReckfellObject.Tr and ReckfellObject.TrN. Enabled by default. See also ReckfellObject.CanTranslateMessages.

Parameters
NameTypeDefault
enablebool—
SetMetavoid
# SetMeta
C#
public void SetMeta(StringName name, Variant value);

Sets a named metadata Variant; Nil removes the entry. The name must be a valid identifier. A leading underscore hides it from normal Inspector display, not from code.

Parameters
NameTypeDefault
nameStringName—
valueVariant—
name

Exact case-sensitive metadata identifier.

value

Compatible Variant value; Nil removes metadata in SetMeta.

SetScriptvoid
# SetScript
C#
public void SetScript(Variant script);

Attaches script to the object, and instantiates it. As a result, the script's _init is called. A Script is used to extend the object's functionality. If a script already exists, its instance is detached, and its property values and state are lost. Built-in property values are still kept.

Parameters
NameTypeDefault
scriptVariant—
SetTranslationDomainvoid
# SetTranslationDomain
C#
public void SetTranslationDomain(StringName domain);

Sets the name of the translation domain used by ReckfellObject.Tr and ReckfellObject.TrN. See also TranslationServer.

Parameters
NameTypeDefault
domainStringName—
ToSignalSignalAwaiter
# ToSignal
C#
public SignalAwaiter ToSignal(ReckfellObject source, StringName signal);

Returns a new SignalAwaiter awaiter configured to complete when the instance source emits the signal specified by the signal parameter.

Parameters
NameTypeDefault
sourceReckfellObject—
signalStringName—
source

The instance the awaiter will be listening to.

signal

The signal the awaiter will be waiting for.

Returns SignalAwaiter

A SignalAwaiter that completes when source emits the signal.

ToStringstring
# ToString
C#
public override string ToString();

Override this method to customize the return value of ReckfellObject.ToString, and therefore the object's representation as a string.

Returns string

A string representation of this object.

Trstring
# Tr
C#
public string Tr(StringName message, StringName context = null);

Translates a message, using the translation catalogs configured in the Project Settings. Further context can be specified to help with the translation. Note that most Control nodes automatically translate their strings, so this method is mostly useful for formatted strings or custom drawn text. If ReckfellObject.CanTranslateMessages is false, or no translation is available, this method returns the message without changes. See ReckfellObject.SetMessageTranslation. For detailed examples, see Internationalizing games. Note: This method can't be used without an ReckfellObject instance, as it requires the ReckfellObject.CanTranslateMessages method. To translate strings in a static context, use TranslationServer.Translate.

Parameters
NameTypeDefault
messageStringName—
contextStringNamenull
Returns string
TrNstring
# TrN
C#
public string TrN(StringName message, StringName pluralMessage, int n, StringName context = null);

Translates a message or plural_message, using the translation catalogs configured in the Project Settings. Further context can be specified to help with the translation. If ReckfellObject.CanTranslateMessages is false, or no translation is available, this method returns message or plural_message, without changes. See ReckfellObject.SetMessageTranslation. The n is the number, or amount, of the message's subject. It is used by the translation system to fetch the correct plural form for the current language. For detailed examples, see Localization using gettext. Note: Negative and ReckfellObject.Tr. Note: This method can't be used without an ReckfellObject instance, as it requires the ReckfellObject.CanTranslateMessages method. To translate strings in a static context, use TranslationServer.TranslatePlural.

Parameters
NameTypeDefault
messageStringName—
pluralMessageStringName—
nint—
contextStringNamenull
Returns string
WeakRefWeakRef
# WeakRef
C#
public static WeakRef? WeakRef(ReckfellObject? obj);

Returns a weak reference to an object, or null if the argument is invalid. A weak reference to an object is not enough to keep the object alive: when the only remaining references to a referent are weak references, garbage collection is free to destroy the referent and reuse its memory for something else. However, until the object is actually destroyed the weak reference may return the object even if there are no strong references to it.

Parameters
NameTypeDefault
objReckfellObject—
obj

The object.

Returns WeakRef

The WeakRef reference to the object or null.

_GetVariant
# _Get
C#
public virtual Variant _Get(StringName property);

Override this method to customize the behavior of ReckfellObject.Get. Should return the given property's value, or null if the property should be handled normally. Combined with ReckfellObject.Set and ReckfellObject.GetPropertyList, this method allows defining custom properties, which is particularly useful for editor plugins. Note: This method is not called when getting built-in properties of an object, including properties defined with [annotation @C#.@export].

C#
public override Variant _Get(StringName property)
{
    if (property == "FakeProperty")
    {
        ReckfellApi.Print("Getting my property!");
        return 4;
    }
    return default;
}

public override Reckfell.Collections.Array<Reckfell.Collections.Dictionary> _GetPropertyList()
{
    return
    [
        new Reckfell.Collections.Dictionary()
        {
            { "name", "FakeProperty" },
            { "type", (int)Variant.Type.Int },
        },
    ];
}

Note: Unlike other virtual methods, this method is called automatically for every script that overrides it. This means that the base implementation should not be called via super in C# or its equivalents in other languages. The bottom-most sub-class will be called first, with subsequent calls ascending the class hierarchy. The call chain will stop on the first class that returns a non-null value. Warning: This method must be thread-safe if overridden. Otherwise, the engine may crash when trying to save a resource containing the object.

Parameters
NameTypeDefault
propertyStringName—
Returns Variant
_GetPropertyListReckfell.Collections.Array<Reckfell.Collections.Dictionary>
# _GetPropertyList
C#
public virtual Reckfell.Collections.Array<Reckfell.Collections.Dictionary> _GetPropertyList();

Override this method to provide a custom list of additional properties to handle by the engine. Should return a property list, as an Reckfell.Collections.Array of dictionaries. The result is added to the array of ReckfellObject.GetPropertyList, and should be formatted in the same way. Each Reckfell.Collections.Dictionary must at least contain the name and type entries. You can use ReckfellObject.PropertyCanRevert and ReckfellObject.PropertyGetRevert to customize the default values of the properties added by this method. The example below displays a list of numbers shown as words going from ZERO to FIVE, with number_count controlling the size of the list:

C#
[Tool]
public partial class MyNode : Entity
{
    private int _numberCount;

    [Export]
    public int NumberCount
    {
        get => _numberCount;
        set
        {
            _numberCount = value;
            _numbers.Resize(_numberCount);
            NotifyPropertyListChanged();
        }
    }

    private Reckfell.Collections.Array<int> _numbers = [];

    public override Reckfell.Collections.Array<Reckfell.Collections.Dictionary> _GetPropertyList()
    {
        Reckfell.Collections.Array<Reckfell.Collections.Dictionary> properties = [];

        for (int i = 0; i < _numberCount; i++)
        {
            properties.Add(new Reckfell.Collections.Dictionary()
            {
                { "name", $"number_{i}" },
                { "type", (int)Variant.Type.Int },
                { "hint", (int)PropertyHint.Enum },
                { "hint_string", "Zero,One,Two,Three,Four,Five" },
            });
        }

        return properties;
    }

    public override Variant _Get(StringName property)
    {
        string propertyName = property.ToString();
        if (propertyName.StartsWith("number_"))
        {
            int index = int.Parse(propertyName.Substring("number_".Length));
            return _numbers[index];
        }
        return default;
    }

    public override bool _Set(StringName property, Variant value)
    {
        string propertyName = property.ToString();
        if (propertyName.StartsWith("number_"))
        {
            int index = int.Parse(propertyName.Substring("number_".Length));
            _numbers[index] = value.As<int>();
            return true;
        }
        return false;
    }
}

Note: This method is intended for advanced purposes. For most common use cases, the scripting languages offer easier ways to handle properties. See ReckfellObject._ValidateProperty. Note: If the object's script is not [annotation @C#.@tool], this method will not be called in the editor. Note: Unlike other virtual methods, this method is called automatically for every script that overrides it. This means that the base implementation should not be called via super in C# or its equivalents in other languages. The bottom-most sub-class will be called first, with subsequent calls ascending the class hierarchy. Warning: This method must be thread-safe if overridden. Otherwise, the engine may crash when trying to save a resource containing the object.

Returns Reckfell.Collections.Array<Reckfell.Collections.Dictionary>
_IterGetVariant
# _IterGet
C#
public virtual Variant _IterGet(Variant iter);

Returns the current iterable value. iter stores the iteration state, but unlike ReckfellObject._IterInit and ReckfellObject._IterNext the state is supposed to be read-only, so there is no Reckfell.Collections.Array wrapper. Tip: In C#, you can use a subtype of Variant as the return type for ReckfellObject._IterGet. The specified type will be used to set the type of the iterator variable in for loops, enhancing type safety.

Parameters
NameTypeDefault
iterVariant—
Returns Variant
_IterInitbool
# _IterInit
C#
public virtual bool _IterInit(Reckfell.Collections.Array iter);

Initializes the iterator. iter stores the iteration state. Since C# does not support passing arguments by reference, a single-element array is used as a wrapper. This array should not be resized. Returns true so long as the iterator has not reached the end.

Note: Avoid storing iterator state in a member variable, use the iter parameter instead. Otherwise, you won't be able to reuse the same iterator instance in nested loops. See also online docs.

Parameters
NameTypeDefault
iterReckfell.Collections.Array—
Returns bool
_IterNextbool
# _IterNext
C#
public virtual bool _IterNext(Reckfell.Collections.Array iter);

Moves the iterator to the next iteration. iter stores the iteration state. Since C# does not support passing arguments by reference, a single-element array is used as a wrapper. This array should not be resized. Returns true so long as the iterator has not reached the end.

Parameters
NameTypeDefault
iterReckfell.Collections.Array—
Returns bool
_Notificationvoid
# _Notification
C#
public virtual void _Notification(int what);

Handles an event code. Prefer dedicated Entity lifecycle callbacks when appropriate. In the checked bridge C# RefCounted scripts do not receive Predelete.

Parameters
NameTypeDefault
whatint—
_PropertyCanRevertbool
# _PropertyCanRevert
C#
public virtual bool _PropertyCanRevert(StringName property);

Override this method to customize the given property's revert behavior. Should return true if the property has a custom default value and is revertible in the Inspector dock. Use ReckfellObject.PropertyGetRevert to specify the property's default value. Note: This method must return consistently, regardless of the current value of the property. Note: Unlike other virtual methods, this method is called automatically for every script that overrides it. This means that the base implementation should not be called via super in C# or its equivalents in other languages. The bottom-most sub-class will be called first, with subsequent calls ascending the class hierarchy. The call chain will stop on the first class that returns true.

Parameters
NameTypeDefault
propertyStringName—
Returns bool
_PropertyGetRevertVariant
# _PropertyGetRevert
C#
public virtual Variant _PropertyGetRevert(StringName property);

Override this method to customize the given property's revert behavior. Should return the default value for the property. If the default value differs from the property's current value, a revert icon is displayed in the Inspector dock. Note: ReckfellObject.PropertyCanRevert must also be overridden for this method to be called. Note: Unlike other virtual methods, this method is called automatically for every script that overrides it. This means that the base implementation should not be called via super in C# or its equivalents in other languages. The bottom-most sub-class will be called first, with subsequent calls ascending the class hierarchy. The call chain will stop on the first class that returns a non-null value.

Parameters
NameTypeDefault
propertyStringName—
Returns Variant
_Setbool
# _Set
C#
public virtual bool _Set(StringName property, Variant value);

Override this method to customize the behavior of ReckfellObject.Set. Should set the property to value and return true, or false if the property should be handled normally. The exact way to set the property is up to this method's implementation. Combined with ReckfellObject.Get and ReckfellObject.GetPropertyList, this method allows defining custom properties, which is particularly useful for editor plugins. Note: This method is not called when setting built-in properties of an object, including properties defined with [annotation @C#.@export].

C#
private Reckfell.Collections.Dictionary _internalData = new Reckfell.Collections.Dictionary();

public override bool _Set(StringName property, Variant value)
{
    if (property == "FakeProperty")
    {
        // Storing the value in the fake property.
        _internalData["FakeProperty"] = value;
        return true;
    }

    return false;
}

public override Reckfell.Collections.Array<Reckfell.Collections.Dictionary> _GetPropertyList()
{
    return
    [
        new Reckfell.Collections.Dictionary()
        {
            { "name", "FakeProperty" },
            { "type", (int)Variant.Type.Int },
        },
    ];
}

Note: Unlike other virtual methods, this method is called automatically for every script that overrides it. This means that the base implementation should not be called via super in C# or its equivalents in other languages. The bottom-most sub-class will be called first, with subsequent calls ascending the class hierarchy. The call chain will stop on the first class that returns true.

Parameters
NameTypeDefault
propertyStringName—
valueVariant—
Returns bool
_ValidatePropertyvoid
# _ValidateProperty
C#
public virtual void _ValidateProperty(Reckfell.Collections.Dictionary property);

Override this method to customize existing properties. Every property info goes through this method, except properties added with ReckfellObject.GetPropertyList. The dictionary contents is the same as in ReckfellObject.GetPropertyList.

C#
[Tool]
public partial class MyNode : Entity
{
    private bool _isNumberEditable;

    [Export]
    public bool IsNumberEditable
    {
        get => _isNumberEditable;
        set
        {
            _isNumberEditable = value;
            NotifyPropertyListChanged();
        }
    }

    [Export]
    public int Number { get; set; }

    public override void _ValidateProperty(Reckfell.Collections.Dictionary property)
    {
        if (property["name"].AsStringName() == PropertyName.Number && !IsNumberEditable)
        {
            var usage = property["usage"].As<PropertyUsageFlags>() | PropertyUsageFlags.ReadOnly;
            property["usage"] = (int)usage;
        }
    }
}
Parameters
NameTypeDefault
propertyReckfell.Collections.Dictionary—

Signals and events2

PropertyListChangedEvent
# PropertyListChanged
C#
public event Action PropertyListChanged;

Emitted when ReckfellObject.NotifyPropertyListChanged is called.

ScriptChangedEvent
# ScriptChanged
C#
public event Action ScriptChanged;

Emitted when the object's script is changed. Note: When this signal is emitted, the new script is not initialized yet. If you need to access the new script, defer connections to this signal with ReckfellObject.ConnectFlags.Deferred.

Fields and constants3

NotificationExtensionReloadedField
# NotificationExtensionReloaded
C#
public const long NotificationExtensionReloaded = 2;

Notification received when the object finishes hot reloading. This notification is only sent for extensions classes and derived.

NotificationPostinitializeField
# NotificationPostinitialize
C#
public const long NotificationPostinitialize = 0;

Notification received when the object is initialized, before its script is attached. Used internally.

NotificationPredeleteField
# NotificationPredelete
C#
public const long NotificationPredelete = 1;

Notification received when the object is about to be deleted. Can be used like destructors in object-oriented programming languages. This notification is sent in reversed order.

ReckfellObject.ConnectFlags

ValueDescription
AppendSourceObject = 16

On signal emission, the source object is automatically appended after the original arguments of the signal, regardless of the connected Callable's unbinds which affect only the original arguments of the signal (see Callable.unbind, Callable.get_unbound_arguments_count).

Deferred = 1

Deferred connections trigger their Callables on idle time (at the end of the frame), rather than instantly.

OneShot = 4

One-shot connections disconnect themselves after emission.

Persist = 2

Persisting connections are stored when the object is serialized (such as when using PackedEntity.Pack). In the editor, connections created through the Signals dock are always persisting. Note: Connections to lambda functions (that is, when the function code is embedded in the ReckfellObject.Connect call) cannot be made persistent.

ReferenceCounted = 8

Reference-counted connections can be assigned to the same Callable multiple times. Each disconnection decreases the internal counter. The signal fully disconnects only when the counter reaches 0.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.