Fieldname
From WolfWiki
Contents |
Entity Fieldnames
List of fields supported by et.gentity_get() and et.gentity_set() functions
|
- note: all the sess.* fields will return nil unless the entity is associated with client slot < sv_maxclients.
- note: all array variables need to be get or set with an additional parameter.
ET variable types
qboolean
- a qboolean is a boolean value.
- 0 is represented by the lua value false
- 1 is represented by the lua value true
vec3
- a vec3_t is a 3-element array of numbers (C definition: typedef float vec3_t[3];). It is usually used to store and process coordinates in 3D space.
- In etpro-lua a vector is an array (table indexed by integers) containing 3 numbers. It can be accessed by
- doing:
origin = et.gentity_get(entNum,"r.currentOrigin") --a vec3 value x,y,z = origin[1],origin[2],origin[3]
array
- The fields listed as having type array represent an entity value which is an array. Individual elements of the array are accessed by passing the desired index in the arrayindex argument to the et.gentity_get and et.gentity_set functions. Valid array indexes are integers from 0 up to some field specific maximum. The arrayindex argument is required when accessing array type fields, so only one element of an array can be accessed in a given call to the gentity_* functions.
trajectory
- a trajectory is returned as a lua table described below
{
trDuration = <number>, --- int
trTime = <number>, -- int
trType = <number>, -- see below for allowed values
trBase = <vec3_t>, -- vec3, as described above
trDelta = <vec3_t> -- also a vec3
}
- the allowed values for trType (along with the enum names and original comments from the ET source), are as follows. Note
- that not all values make sense for all entity types
|
entity
- The fields listed as having type enitity return an entity number or nil. Entity numbers are integers from 0 through 1023. Some of the entity numbers have special meanings:
- 0 - (sv_privateclients - 1) are reserved for clients who connect with the private slot password
- 0 - 63 are reserved for clients. A client's entity number is also its client number (as shown by /players for example)
- 1022 is the worldspawn entity
- 1023 is ENTITYNUM_NONE which is used instead of null in C under some circumstances to indicate no entity. This is needed where an entity number will be passed over the network.
- Note: Some other fields not listed as type 'entity' may take an entity number value. mg42BaseEnt and s.number are examples.
meansOfDeath
- a meansOfDeath_t is a number indicating the Method of Death Click here for a list with possible value's
Field details
WARNING The following are incomplete, and likely contain errors. Also be aware that the meaning of many fields depends on which entity the field belongs to. "damage" on one entity may have a completely different meaning on another. When in doubt, consult the ET source. ETPro may differ slightly, but the majority of entity fields are the same. The full meaning of a given field can ONLY be obtained from the source.
classname
Entity class name.
- nil if entity is not in use
- player for game client
- team_WOLF_objective for objective entity
etc.
client.inactivityTime
Timestamp of when the client was last active. Seems to be 44000000 + server uptime in ms.
damage
Probably related to damage entity deals (e.g. fire, barbed wire). 2 for player entity.
health
Health of the entity (e.g. player's health for a client, damage needed to disable stationary MG for stationary MG etc.)
inuse
Indicates whether the entity number is used. Specially for entity numbers reserved for clients, indicates whether client slot is used.
message
Message associated with the entity (e.g. "Side door" for side door objective entity). nil for player entities.
origin
- for living player and some visible entities (like tank), position in map
- dosen't work for spectating player
s.origin
- for spectator in freelook, the spectator's position
pers.netname
For player, their nickname.
ps.ammo
Array. For each weapon, tells how many bullets/whatever the player has in spare clips.
ps.ammoclip
Array. For each weapon, tells how many bullets/whatever the player has in current clip.
sess.sessionTeam
Player's team:
- 1 = red
- 2 = blue
- 3 = spectator
sess.spectatorState
- 1 = free spectator
- 2 = spectator following another player
sess.spectatorClient
Entity number of player the spectator is following.
Categories: ETPro | Lua | ETPro:Mods
