|
|
Line 128: |
Line 128: |
| '''ET variable types''': | | '''ET variable types''': |
| | | |
− | '''vec3''' : a '''vec3''' is an array of 3 ''vectors''. it usualy represend the X Y Z positions of a entity. | + | '''vec3''' : a '''vec3''' is a 3-element array of numbers (C definition: <tt>typedef float vec3_t[3]; |
− | a ''vector'' is a number, '''vec3''' is a table that contains 3 numbers witch van be accessed by | + | </tt>). It is usually used to store and process coordinates in 3D space.<br> |
− | doing:<br> | + | In etpro-lua a vector is a table containing 3 numbers. It can be accessed by |
− | <code>tablevar = {}<br> | + | doing: |
− | tablevar = et.gentity_get() --a vec3 value<br> | + | <pre>tablevar = {} |
− | x = tablevar[1]<br> | + | tablevar = et.gentity_get() --a vec3 value |
− | y = tablevar[2]<br> | + | x = tablevar[1] |
− | z = tablevar[3]</code> | + | y = tablevar[2] |
− | | + | z = tablevar[3]</pre> |
| | | |
| [[Category:ETPro]] | | [[Category:ETPro]] |
Revision as of 13:45, 16 November 2005
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 | RO |
sess.damage_received | integer | RO |
sess.deaths | integer | RO |
sess.game_points | integer | RO |
sess.gibs | integer | RO |
sess.kills | integer | RO |
sess.muted | integer | RO |
sess.referee | integer | RO |
sess.rounds | integer | RO |
sess.semiadmin | integer | RO |
sess.spec_invite | integer | RO |
sess.spec_team | integer | RO |
sess.suicides | integer | RO |
sess.team_damage | integer | RO |
sess.team_kills | integer | RO |
sess.team_received | integer | RO |
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 |
|
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 a table containing 3 numbers. It can be accessed by
doing:
tablevar = {}
tablevar = et.gentity_get() --a vec3 value
x = tablevar[1]
y = tablevar[2]
z = tablevar[3]