Left 4 Dead 2
Left 4 Dead 2 is a single-player and multiplayer co-operative survival horror FPS game.
VSLib Developer Guide - Entity & Player Class
4,782
Entity class
The Entity class wraps Valve's entity object and adds a couple of new features. Here's how you can utilize VSLib's entity class:
// You can find an entity by targetname
yourVariableNameHere <- Entity ( "targetname here" );

// You can find an entity by classname
yourVariableNameHere <- Entity ( "classname here" );

// You can find an entity by index; below, we are finding Player 1
yourVariableNameHere <- Entity ( 1 );

// You can find an entity by its filter
yourVariableNameHere <- Entity ( "!ellis" );

// You can set the entity by passing in a Valve CBaseEntity object
yourVariableNameHere <- Entity ( ent );
Once you have the Entity object, you can access any of the functions in the link below.
Available Entity Functions and Their Descriptions
Player class
The Player class builds on the Entity class and provides many more functions for Survivor and Special Infected entities. All the functions that are available on the Entity class also works on the Player class, so please see that function list too!
// You can find a player by index; below, we are finding Player 1.
// Players 1-4 are usually the survivors, and 4-64 can be valid infected.
yourVariableNameHere <- Player ( 1 );

// You can find a player by filter
yourVariableNameHere <- Player ( "!ellis" );

// You can set the player by passing in a Valve CTerrorPlayer object
yourVariableNameHere <- Player ( ent );
Once you have the Player object, you can access any of the functions below, as well as all of the Entity class functions.
Available Player Functions and Their Descriptions
I found this article helpful
I did not find this article helpful
What people are saying...
You must be logged in to post a comment.
There are no comments yet for this guide.