Skip to content

Console Commands

FrostSource edited this page Sep 18, 2024 · 10 revisions

Parameters wrapped in square brackets are [optional] Parameters with 3 dots mean you can supply as many as you want...

print_all_ents

Syntax: print_all_ents [propertyPattern...]

Prints all entities in the map, along with any supplied property patterns.

A property pattern is the name or name-part that the command will search for on each entity to get its value. The property must be a variable or function which takes no arguments and returns a value.

'SetOrigin' is invalid because it takes an argument and does not return a value. 'GetContext' is invalid because it takes an argument. 'GetOrigin' is valid because it takes no arguments and returns a printable value.

A name-part is a segment of the name that the command will search for, if you don't know the full name or just want to reduce typing.

For example, a pattern of 'name' might find 'GetName' or 'GetClassname' depending on which it finds first.

Child entities display their parent as an index number and classname so you can easily find it in the list.

This command also works for any variables and functions added to entities through scripts, including the AlyxLib entity classes.

Example usage:

print_all_ents
print_all_ents getname getorigin
print_all_ents Gethealth CustomVariable

Example output: image

print_diff_ents

Syntax: print_diff_ents [propertyPattern...]

Prints all new entities in the map since print_all_ents was last called, along with any supplied property patterns (see print_all_ents for a description of property patterns).

This command can be used to quickly check which entities have been spawned since print_all_ents was called, as long as they are still alive.

print_nearby_ents

Syntax: `print_nearby_ents [radius] [propertyPattern...]

Prints all entities within a given radius around the player, along with any supplied property patterns (see print_all_ents for a description of property patterns).

If no radius is supplied a default value of 256 is used.

Example usage:

print_nearby_ents
print_nearby_ents 100
print_nearby_ents 2000 getname getorigin

print_ents

Syntax: print_ents pattern [propertyPattern...]

Prints any entities whose name, class or model name contain the pattern parameter, along with any supplied property patterns (see print_all_ents for a description of property patterns).

For example, a pattern of "physics" might match all 'prop_physics', 'prop_physics_override' and any entity with "physics" in the name.

Example usage:

print_ents grenade_frag getname getorigin
print_ents "my model.vmdl" getclass

ent_show

Syntax: ent_show pattern

Shows the position of an entity in the world by drawing a line to it from the player, if its name, class or model name contain the pattern parameter.

ent_mass

Syntax: ent_mass pattern

Prints the mass of the entity to the console, if its name, class or model name contain the pattern parameter.

sphere

Syntax: sphere [x] [y] [z] [radius]

Draws a sphere in the game world at given position with a given size.

print_ent_criteria

Syntax: print_ent_criteria pattern

Prints all criteria for an entity, if its name, class or model name contain the pattern parameter. These are the same values you would get by doing ent:GatherCriteria()

print_ent_base_criteria

Syntax: print_ent_base_criteria pattern

Prints all base criteria for an entity, if its name, class or model name contain the pattern parameter. Base criteria is any criteria which was not added by the Storage library when saving. This helps reduce clutter when checking for a specific criteria value.

healme

Syntax: healme amount

Heals the player by the amount given, as an inverse function for hurtme.

ent_find_by_address

Syntax: ent_find_by_address "table"/address [":"] [address]

Finds an entity by its "table address" which is the value shown when turning it

Clone this wiki locally