This article's documentation is for anything that uses the Source engine. Click here for more information.

Model entity

From Valve Developer Community
Jump to navigation Jump to search

Icon-under construction-blue.png
This is a draft page. It is a work in progress open to editing by anyone.
Remember to check for any notes left by the tagger at this article's talk page.

Entities that use studio model. Every entity using a studio model is almost always a subclass of CBaseAnimating. In FGD they will be defined by @PointClass (or @NPCClass in case of NPCs) and thus in Hammer created via Hammer Entity Tool.

General types of model entities

Prop entities

Prop Entities, are (usually) inanimate objects that use a model for their appearance and function. They can be static, dynamic, or physics. Some more specific props can even have functionality, such as a prop_door_rotating. Examples of common prop entities include prop_static, prop_dynamic, prop_physics and prop_ragdoll.

NPC entities

NPC entities, or "Non-Player Characters" entities, are computer controlled characters and creatures that can interact with the player(s) using their AI coding. NPCs generally fall into two categories, Friendly, NPCs that help, assist, or do not affect the player, and Hostile, NPCs that attack or negatively affect the player. Use ai_relationship to change this.

Weapon entities

Weapon entities represent the various weapons available in the game world that players or NPCs can use. These entities define the behavior, appearance, and functionality of weapons such as guns or melee weapons.

Weapon entities handle actions like firing, reloading, and damage calculation. Examples include weapon_pistol, weapon_smg, or weapon_frag.

They usually have a weapon script in which world model and view model is specified. World model being used when the weapon is lying on the ground. When held by a player the weapon usually becomes invisible and the viewmodel entity used in the given game draws the specified view model of the given weapon.

Other pick-able items

For example ammunition items. Left 4 Dead seriesLeft 4 Dead series has weapon spawn entities which are the weapons that spawn on the ground. When grabbed they give the player a particular weapon entity. For example weapon_smg_spawn gives the player weapon_smg.

Projectiles

Thrown grenades, special attacks by some enemies or shooting certain weapons will result in creation of projectiles.
Examples: molotov_projectile, spitter_projectile, tank_rock, decoy_projectile, tf_projectile_syringe, grenade_launcher_projectile

See also