Skip to content

entity

Due to FC2 solutions pre-parsing netvars (Source) and schemas (Source2), the read function is the main utility for this class. In previous solutions, there were more already pre-made functions. Just use read. It does everything you need.

Alternatively, you can use lib_players. It has functions like is_alive, get_team, get_eye_position, get_eye_angles, get_origin, etc. That library has a handful of entity related functions.

The write function will not work on blacklisted games.

address

Type

userdata


read

Type

function

Parameters

  • MEM_ type
  • number address
  • number size (only if MEM_STRING specified)

Returns

  • MEM_ value

Example

Lua
-- get valve source engine module
local valve_source = fantasy.engine.source( )

-- get entity list
local entity_list = fantasy.engine.entity_list( )

-- get localplayer
local localplayer = entity_list:get_localplayer()
if not localplayer then return end

local crosshair_id = localplayer:read( MEM_INT, valve_source:get_netvar( "DT_CSPlayer", "m_iCrosshairID" )

write

Type

function

Description

This method does not allow you to write memory to blacklisted games. This restriction cannot be removed. Any game that is officially supported by constelia.ai (fantasy.cat) is considered blacklisted (CS, TF2, etc). This restriction is applied on both FC2 Windows and FC2 Linux.

Parameters

  • MEM_ type
  • number address
  • number/string value
  • number size (only if MEM_STRING specified)

Returns

  • MEM_ value

write

Type

function

Parameters

  • MEM_ type
  • number address
  • value

is_dormant

Type

function

Returns

  • boolean

Exception

This only works for Constellation4.


get_box_dimensions

Type

function

Returns

  • table
    • number left
    • number top
    • number right
    • number bottom

Exception

This only works for Constellation4.


get_class

Type

function

Returns

  • number
  • string

Exception

This only works for Constellation4.


get_index

Type

function

Returns

  • number

get_bone

Type

function

Description

This works in CS2, CS:GO, TF2, CSS and any other support title. Note that not all bones are the same in each game.

Parameters

  • number bone_id

Returns

  • number

get_pawn

Type

function

Description

This only works for Source2 games.

Returns

  • address

new

Type

function

Description

Creates a new entity class.

Parameters

  • number/userdata address

Returns

  • entity