Meta Tables
MetaTables
Meta tables allow you to add functions to all classes in the game at the same time.
For example, adding a function to "Entity" meta table like so:
Will allow you to use it on ALL entities like so:
However adding a function like this:
Will not allow you to use that function on any other entity BUT Entity( 1 )
A list of type meta tables that can be retrieved with FindMetaTable can be found on TYPE enum.
Derived Metatables
In GMod, any C class that is derived from another has the field MetaBaseClass defined in the metatable, which points at the derived metatable.
An example for this would be:
It seems like this was once intended to allow a class to have a chain of derived classes (example:
SpecialWeapon -> Weapon -> Entity), though it was never completed?
Garry's Mod
Rust
Steamworks
Wiki Help