Misc

Miscellaneous functions useful for debugging (print to console, dump type information) and getting special objects and info.

Debug functions

print

Prints one or more objects to the CET console. Multiple objects will be printed separated by a space.

print("Hey", "there", 1, 2, true)

Dump

Dump(obj: GameDataType, detailed: bool) -> string

Returns a JSON-ish string with details about the members of obj:

  • Type name

  • Instance functions

  • Static functions

  • Properties

The listed functions include their signatures.

If detailed is true, function descriptions will include the function's full name hash, short name, and short name hash.

circle-info

obj must be an instance of a wrapped game type, such as PlayerPuppet which is returned by Game.GetPlayer(). DumpAllTypeNames will dump the names of all such types.

GameDump

GameDump(obj: GameDataType) -> string

Returns the game's internal debug string for the given object. This string displays the object's properties and their values.

circle-exclamation

DumpType

DumpType(typeName: string, detailed: boolean) -> string

Like Dump, but takes a type name rather than an object instance. Use DumpAllTypeNames to get a list of all types.

DumpAllTypeNames

DumpAllTypeNames() -> nil

Dump all type names to cyber_engine_tweaks/cyber_engine_tweaks.log and print to the console the number of types dumped.

Getters

GetDisplayResolution

GetDisplayResolution() -> float, float

Returns the width and height (respectively) of the game window in pixels.

GetMod

GetMod(modName: string) -> object

Returns the return value of the mod with the given name.

circle-exclamation

GetSingleton

GetSingleton(singletonTypeName: string) -> SingletonReference | nil

Returns the singleton for the given type name if it exists, otherwisenil.

circle-info

A singleton is the sole instance of a type, often used for global operations.

GetVersion

GetVersion() -> string

Returns the current CET build's commit hash.

Last updated