Object

Nearly all things you can see in the game, and even some things you can’t see, like spawn points or trigger regions, are derived from this type.

Variables

Position (Vector)
The objects x, y, z position.
Orientation (Matrix)
A 3x3 matrix which describes the orientation of the object. Consists of a right vector, up vector, and forward vector.
Child (Object)
Pointer to one of the objects children. Is nil if it has no children.
ChildNext (Object)
Shortcut for Self.Child.FlaggedNext. Is nil if no children
ChildPrevious (Object)
Shortcut for Self.Child.FlaggedPrevious. Is nil if no children.
AttachInfo (AttachInfoData)
Data about how this object is attached to other objects if applicable. May be nil if it is not.
HavokHandle (unsigned int)
This may be the handle for the objects havok rigid body (unconfirmed). This handle is different from an object handle as havok rigid bodies are not objects.
ContactInfo (ObjectContactInfo)
Data about all objects this object is in contact with.
ObjFlags (ObjectFlags)
A set of flags used to track object behavior and state.
CheckingReset (int)
Unknown purpose.
NameIndex (int16)
Used by the game to access to the objects name on a as of yet unlocated list of object names.
FlaggedNext (Object)
Pointer to another object, forming a doubly linked list of “flagged” objects. It’s unknown what is meant by them being flagged. May be nil.
FlaggedPrevious (Object)
Pointer to the previous flagged object. May be nil.
Handle (unsigned int)
The objects handle. Handles are often used in place of a pointer to the object all across the game. Use rfg.GetObjectByHandle to gain access to the object who matches that handle.
Parent (unsigned int)
The handle of the objects parent object if it has one.
BPOHandle (HavokBPO)
Contains state data used by havok physics engine. May be nil.
AllIndex (int16)
The index of the object on rfg.ActiveWorld.AllObjects
TypeIndex (int16)
Used by the game to track the objects type. Exact usage/purpose unknown.
SubtypeIndex (int16)
Used by the game to track the objects subtype. Exact usage/purpose unknown.
Type (char)
The objects type. Should match one of the values in rfg.ObjectTypes a table of object types and their corresponding integer values.
SubType (char)
The objects subtype. Should match one of the values in rfg.ObjectSubTypes a table of object subtypes and their corresponding integer values.
LastKnownBMin (Vector)
One corner of the objects bounding box. A 3D point.
LastKnownBMax (Vector)
The other corner of the objects bounding box. A 3D point.
SRID (unsigned int)
Exact purpose unknown. Might to be a unique integer identifying the object (unconfirmed).

Functions

Warning

Be sure to check an objects type before casting it to avoid having garbage values or unintentionally changing adjacent memory. For example, if you are casting an object to Human, double check that Self.Type == rfg.ObjectTypes.Human is true before casting it.

GetName (Object Self)
Returns the objects name if it has one. Objects almost never have a name.
IsPlayer (Object Self)
Returns a `bool`_ (true or false) for if this object is the player.
CastToHuman (Object Self)
Returns this object as a Human.
CastToPlayer (Object Self)
Returns this object as a Player.
CastToZone (Object Self)
Returns this object as a WorldZone.
CastToVehicle (Object Self)
Returns this object as a Vehicle.
CastToFlyer (Object Self)
Returns this object as a Flyer.