Type:RefID: Difference between revisions

From Resonite Wiki
No edit summary
Tag: 2017 source edit
m link to the To String node.
Tag: 2017 source edit
 
Line 12: Line 12:


=== Stringify format ===
=== Stringify format ===
a representation value as hexadecimal followed by a fixed string <code>ID</code>.
A RefID is converted [[ProtoFlux:To String|to string]] which value is hexadecimal representation value followed by a fixed string <code>ID</code>.


Example: <code>IDA1B2C3D4</code>.
Example: <code>IDA1B2C3D4</code>.

Latest revision as of 13:13, 26 April 2025

The RefID type is a wrapper around a ulong value which represents a pointer to a world element. Every Type:IWorldElement stores a unique RefID as its ReferenceID field. It is primarily an internal engine type and is not meant to be used directly.

Internal mechanism

RefIDs use their least significant byte to represent the allocation id of a user who allocated the world element, and the remaining bytes are used to represent which world element it's pointing to.

term

A RefID is considered as "null" if and only if it's representation is equal to 0.

RefIDs are considered as "equal" if and only if their representation is equal.

A RefID is considered as "local" if and only if "user allocation id" is 255.

Stringify format

A RefID is converted to string which value is hexadecimal representation value followed by a fixed string ID.

Example: IDA1B2C3D4.

See also

  • Ref Hacking - unsupported way to achieve flexible operation on components