CBaseEntity: Difference between revisions
Jump to navigation
Jump to search
Important:Following Keyvalues / Inputs / Outputs are available for all entities that inherit this class, but may be overridden by game code.
SirYodaJedi (talk | contribs) No edit summary |
mNo edit summary |
||
Line 2: | Line 2: | ||
{{tabs|CBaseEntity|goldsrc=1|source=1|main=source}} | {{tabs|CBaseEntity|goldsrc=1|source=1|main=source}} | ||
{{CD|CBaseEntity|base=IServerEntity|nolink=1|file1=[https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/server/baseentity.cpp baseentity.cpp]}} | {{CD|CBaseEntity|base=IServerEntity|nolink=1|file1=[https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/server/baseentity.cpp baseentity.cpp]}} | ||
{{toc-right}} | |||
The base class for all entities. | The base class for all entities. | ||
Revision as of 12:26, 4 September 2024
![]() |
---|
CBaseEntity |
![]() |
The base class for all entities.

Keyvalues
Todo: Document the other KVs from this class as well.
- Model (model) <string>
- In-game representation of the entity to display. For brush entities, this is a reference to a non-zero bmodel index in the current BSP. For point entities, this is the path to an MDL model or VMT sprite, relative to the game's root directory. Not all entities will actually render the model, and only specific entities will precache the model defined here (non-precached models cannot be displayed).
Inputs
Outputs
To get the class name of an entity, use
entity->edict()->GetClassName();
Asserts
Client
Problem:
// Model could not be found
Assert( !"Model could not be found, index is -1" );
Solution:
- Check your model name three times.
- Precache your model on both server and client.