Misc
Miscellaneous API features which I couldn't categorise anywhere else.
You can get up to date offsets directly from within Orbit. The usage may be a bit tricky, so make sure to pay attention to not mess up something accidentally.
xxxxxxxxxx
GetOffset(string table offset_path, string file)
You first need to define a table of string elements, which reflects the path to the offset. To understand the structure of the offsets, just head over to "AppData/Roaming/Orbit/Offsets". Here you will see the data structure of the generated JSON files. Currently, Orbit only supports accessing "client.dll" and "offsets".
xxxxxxxxxx
local localPlayerControllerPath = {"client.dll", "dwLocalPlayerController"}
local dwLocalPlayerController = GetOffset(localPlayerControllerPath, "offsets")
Sometimes, getting the value of an offset can result in quite a long line of code. Don't worry though, since these paths rarely change from one cs2 update to the next, so that long line will probably feed you the correct offset for a long time.
xxxxxxxxxx
local m_pGameSceneNode = GetOffset({"client.dll", "classes", "C_BaseEntity", "fields", "m_pGameSceneNode"}, "client.dll")
"RayCast" uses the built in VPK Parser in Orbit to perform a visible check based on the arguments, which are 2 Vector3D objects.
The return value is a bool, true if visible, false if not.
xxxxxxxxxx
local Visible = RayCast(Vector3D(0, 0, 0), Vector3D(25, 25, 25))
Print("The two 3D points see eachother: " .. tostring(Visible))