Fieldname

From WolfWiki
Jump to: navigation, search

Entity Fieldnames

List of fields supported by et.gentity_get() and et.gentity_set() functions

fieldtypeaccess
activatorentityRO
chainentityRW
classnamestringRW
client.inactivityTimeintegerRW
client.inactivityWarningqbooleanRW
clipmaskinteger?
closespeedfloatRW
countintegerRW
count2integerRW
damageintegerRW
deathTypemeansOfDeath_tRW
delayfloatRW
dl_attenintegerRW
dl_colorvec3RW
dl_shaderstringRO
dl_stylestringstringRO
durationfloatRW
end_sizeintegerRW
enemyentityRW
flagsbitflagRO
harcfloatRW
healthintegerRW
inuseqbooleanRO
isPropqbooleanRO
itemstringRW
keyintegerRW
messagestringRW
methodOfDeathintegerRW
mg42BaseEntintegerRW
missionLevelintegerRW
modelstringRO
model2stringRO
nextTrainentityRW
noise_indexintegerRW
originvec3RW
pers.connectedconnected_t?
pers.netnamestring?
pers.localClientqboolean?
pers.initialSpawnqboolean?
pers.enterTimeinteger?
pers.connectTimeinteger?
pers.teamState.stateteamstatestate_t?
pers.voteCountinteger?
pers.teamVoteCountinteger?
pers.complaintsinteger?
pers.complaintClientinteger?
pers.complaintEndTimeinteger?
pers.lastReinforceTimeinteger?
pers.applicationClientinteger?
pers.applicationEndTimeinteger?
pers.invitationClientinteger?
pers.invitationEndTimeinteger?
pers.propositionClientinteger?
pers.propositionClient2integer?
pers.propositionEndTimeinteger?
pers.autofireteamEndTimeinteger?
pers.autofireteamCreateEndTimeinteger?
pers.autofireteamJoinEndTimeinteger?
pers.lastSpawnTimeinteger?
pers.readyqboolean?
prevTrainentityRW
props_frame_stateintegerRO
ps.statsinteger arrayRW
ps.persistantinteger arrayRW
ps.pinginteger?
ps.powerupsinteger arrayRW
ps.ammointeger arrayRW
ps.ammoclipinteger arrayRW
r.absmaxvec3RO
r.absminvec3RO
r.bmodelqbooleanRO
r.contentsintegerRW
r.currentAnglesvec3RW
r.currentOriginvec3RW
r.eventTimeintegerRW
r.linkcountintegerRO
r.linkedqbooleanRO
r.maxsvec3RW
r.minsvec3RW
r.ownerNumintegerRW
r.singleClientintegerRW
r.svFlagsintegerRW
r.worldflagsintegerRO
radiusintegerRW
randomfloatRW
rotatevec3RW
s.anglesvec3RW
s.angles2vec3RW
s.apostrajectoryRW
s.clientNumintegerRW
s.constantLightintegerRW
s.densityintegerRW
s.dl_intensityintegerRW
s.dmgFlagsintegerRW
s.eFlagsintegerRW
s.eTypeinteger?
s.effect1TimeintegerRW
s.effect2TimeintegerRW
s.effect3TimeintegerRW
s.frameintegerRW
s.groundEntityNumintegerRO
s.loopSoundintegerRW
s.modelindexintegerRW
s.modelindex2integerRW
s.numberintegerRO
s.onFireEndintegerRW
s.onFireStartintegerRW
s.originvec3?
s.origin2vec3?
s.postrajectoryRW
s.powerupsintegerRO
s.solidintegerRW
s.teamNumintegerRW
s.timeintegerRW
s.time2integerRW
s.weaponintegerRO
scriptNamestringRO
sess.sessionTeamteam_tRW
sess.spectatorTimeintegerRW
sess.spectatorStatespectatorState_tRW
sess.spectatorCliententityRW
sess.latchSpectatorClientintegerRW
sess.playerTypeintegerRW
sess.playerWeaponintegerRW
sess.playerWeapon2integerRW
sess.spawnObjectiveIndexintegerRW
sess.latchPlayerTypeintegerRW
sess.latchPlayerWeaponintegerRW
sess.latchPlayerWeapon2integerRW
sess.damage_givenintegerRW
sess.damage_receivedintegerRW
sess.deathsintegerRW
sess.game_pointsintegerRW
sess.gibsintegerRW
sess.killsintegerRW
sess.medalsinteger arrayRW
sess.mutedqbooleanRW
sess.rankintegerRW
sess.refereeintegerRW
sess.roundsintegerRW
sess.semiadminintegerRW
sess.skillinteger arrayRW
sess.spec_inviteintegerRW
sess.spec_teamintegerRW
sess.suicidesintegerRW
sess.team_damageintegerRW
sess.team_killsintegerRW
sess.team_receivedintegerRW
sess.aWeaponStatsweapon_stat_tRW
spawnflagsintegerRO
spawnitemstringRO
speedfloatRW
splashDamageintegerRW
splashMethodOfDeathintegerRW
splashRadiusintegerRW
start_sizeintegerRW
tagNamestringRO
tagParententityRW
takedamagebooleanRW
tankLinkentityRW
targetstringRW
TargetAnglesvec3RW
TargetFlagintegerRO
targetnamestringRO
teamchainentityRW
teammasterentityRW
trackstringRO
varcfloatRW
waitfloatRW
waterlevelintegerRO
watertypeintegerRO
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
numbertypediscription
1TR_STATIONARY 
2TR_INTERPOLATEnon-parametric, but interpolate between snapshots
3TR_LINEAR 
4TR_LINEAR_STOP 
5TR_LINEAR_STOP_BACKreverse movement can be different than forward
6TR_SINEvalue = base + sin( time / duration ) * delta
7TR_GRAVITY 
8TR_GRAVITY_LOW 
9TR_GRAVITY_FLOATsuper low grav with no gravity acceleration
10TR_GRAVITY_PAUSEDhas stopped, but trace to see if it should be switched back to TR_GRAVITY
11TR_ACCELERATE 
12TR_DECCELERATE 
13TR_SPLINE 
14TR_LINEAR_PATH 



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.