List of fields supported by et.gentity_get() and et.gentity_set()
field | type | access |
activator | entity | RO |
chain | entity | RW |
classname | string | RW |
closespeed | float | RW |
count | integer | RW |
count2 | integer | RW |
damage | integer | RW |
deathType | integer | RW |
delay | float | RW |
dl_atten | integer | RW |
dl_color | vec3 | RW |
dl_shader | string | RO |
dl_stylestring | string | RO |
duration | float | RW |
end_size | integer | RW |
enemy | entity | RW |
flags | integer | RO |
harc | float | RW |
health | integer | RW |
inuse | boolean | RO |
isProp | boolean | RO |
item | string | RW |
key | integer | RW |
message | string | RW |
methodOfDeath | integer | RW |
mg42BaseEnt | integer | RW |
missionLevel | integer | RW |
model | string | RO |
model2 | string | RO |
nextTrain | entity | RW |
noise_index | integer | RW |
origin | vec3 | RW |
prevTrain | entity | RW |
props_frame_state | integer | RO |
r.absmax | vec3 | RO |
r.absmin | vec3 | RO |
r.bmodel | boolean | RO |
r.contents | integer | RW |
r.currentAngles | vec3 | RW |
r.currentOrigin | vec3 | RW |
r.eventTime | integer | RW |
r.linkcount | integer | RO |
r.linked | boolean | RO |
r.maxs | vec3 | RW |
r.mins | vec3 | RW |
r.ownerNum | integer | RW |
r.singleClient | integer | RW |
r.svFlags | integer | RW |
r.worldflags | integer | RO |
radius | integer | RW |
random | float | RW |
rotate | vec3 | RW |
s.angles | vec3 | RW |
s.angles2 | vec3 | RW |
s.apos | trajectory | RW |
s.clientNum | integer | RW |
s.constantLight | integer | RW |
s.density | integer | RW |
s.dl_intensity | integer | RW |
s.dmgFlags | integer | RW |
s.eFlags | integer | RW |
s.effect1Time | integer | RW |
s.effect2Time | integer | RW |
s.effect3Time | integer | RW |
s.frame | integer | RW |
s.groundEntityNum | integer | RO |
s.loopSound | integer | RW |
s.modelindex | integer | RW |
s.modelindex2 | integer | RW |
s.number | integer | RO |
s.onFireEnd | integer | RW |
s.onFireStart | integer | RW |
s.pos | trajectory | RW |
s.powerups | integer | RO |
s.solid | integer | RW |
s.teamNum | integer | RW |
s.time | integer | RW |
s.time2 | integer | RW |
s.weapon | integer | RO |
scriptName | string | RO |
sess.damage_given | integer | RW |
sess.damage_received | integer | RW |
sess.deaths | integer | RW |
sess.game_points | integer | RW |
sess.gibs | integer | RW |
sess.kills | integer | RW |
sess.muted | integer | RW |
sess.referee | integer | RW |
sess.rounds | integer | RW |
sess.semiadmin | integer | RW |
sess.spec_invite | integer | RW |
sess.spec_team | integer | RW |
sess.suicides | integer | RW |
sess.team_damage | integer | RW |
sess.team_kills | integer | RW |
sess.team_received | integer | RW |
spawnflags | integer | RO |
spawnitem | string | RO |
speed | float | RW |
splashDamage | integer | RW |
splashMethodOfDeath | integer | RW |
splashRadius | integer | RW |
start_size | integer | RW |
tagName | string | RO |
tagParent | entity | RW |
takedamage | boolean | RW |
tankLink | entity | RW |
target | string | RW |
TargetAngles | vec3 | RW |
TargetFlag | integer | RO |
targetname | string | RO |
teamchain | entity | RW |
teammaster | entity | RW |
track | string | RO |
varc | float | RW |
wait | float | RW |
waterlevel | integer | RO |
watertype | integer | RO |
|
- note: all the sess.* fields will return nil unless the entity is associated with client slot < sv_maxclients.
ET variable types:
vec3 : a vec3 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]
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 { -- this is a vec3, as described above
[1] = <number>
[2] = <number>
[3] = <number>
},
trDelta { -- also a vec3
[1] = <number>
[2] = <number>
[3] = <number>
},
}
- 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
- TR_STATIONARY
- TR_INTERPOLATE // non-parametric, but interpolate between snapshots
- TR_LINEAR
- TR_LINEAR_STOP
- TR_LINEAR_STOP_BACK //----(SA) added. so reverse movement can be different than forward
- TR_SINE // value = base + sin( time / duration ) * delta
- TR_GRAVITY
- TR_GRAVITY_LOW
- TR_GRAVITY_FLOAT // super low grav with no gravity acceleration (floating feathers/fabric/leaves/...)
- TR_GRAVITY_PAUSED //----(SA) has stopped, but will still do a short trace to see if it should be switched back to TR_GRAVITY
- TR_ACCELERATE
- TR_DECCELERATE
- TR_SPLINE
- TR_LINEAR_PATH