Fieldname: Difference between revisions
Jump to navigation
Jump to search
snapshot 3 fields |
restyled to make room for other entity types |
||
| Line 1: | Line 1: | ||
==Entity Fieldnames== | |||
List of fields supported by [[ETPro:Lua Mod API#entities|et.gentity_get() and et.gentity_set()]] functions<br> | List of fields supported by [[ETPro:Lua Mod API#entities|et.gentity_get() and et.gentity_set()]] functions<br> | ||
<pitatable columns=3 headlines="field;type;access" widths="180;120;60" headerfontcolor="#FFFFFF"> | <pitatable columns=3 headlines="field;type;access" widths="180;120;60" headerfontcolor="#FFFFFF"> | ||
| Line 174: | Line 175: | ||
</pitatable> | </pitatable> | ||
:''note'': all the sess.* fields will return nil unless the entity is associated with client slot < sv_maxclients. | :''note'': all the sess.* fields will return nil unless the entity is associated with client slot < sv_maxclients. | ||
:''note'': all array variables need tobe called or get whit an additional parameter | |||
---- | ---- | ||
==ET variable types== | |||
===vec3=== | |||
:a '''vec3''' is a 3-element array of numbers (C definition: <tt>typedef float vec3_t[3]; | |||
</tt>). It is usually used to store and process coordinates in 3D space.<br> | </tt>). It is usually used to store and process coordinates in 3D space.<br> | ||
In etpro-lua a vector is an array (table indexed by integers) containing 3 numbers. It can be accessed by | In etpro-lua a vector is an array (table indexed by integers) containing 3 numbers. It can be accessed by | ||
| Line 187: | Line 190: | ||
x,y,z = origin[1],origin[2],origin[3]</pre> | x,y,z = origin[1],origin[2],origin[3]</pre> | ||
---- | |||
===trajectory=== | |||
:a '''trajectory''' is returned as a lua table described below | |||
<pre>{ | |||
trDuration = <number>, --- int | trDuration = <number>, --- int | ||
trTime = <number>, -- int | trTime = <number>, -- int | ||
trType = <number>, -- see below for allowed values | trType = <number>, -- see below for allowed values | ||
trBase | trBase = <vec3_t>, -- vec3, as described above | ||
trDelta = <vec3_t> -- also a vec3 | |||
}</pre> | |||
: the allowed values for trType (along with the enum names and original comments from the ET source), are as follows. Note | : 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 | : that not all values make sense for all entity types | ||
< | <pitatable columns=3 headlines="number;type;discription" widths="40;160;450" headerfontcolor="#FFFFFF"> | ||
1;TR_STATIONARY; | |||
2;TR_INTERPOLATE;non-parametric, but interpolate between snapshots; | |||
3;TR_LINEAR; | |||
4;TR_LINEAR_STOP; | |||
5;TR_LINEAR_STOP_BACK;reverse movement can be different than forward; | |||
6;TR_SINE;value = base + sin( time / duration ) * delta; | |||
7;TR_GRAVITY; | |||
8;TR_GRAVITY_LOW; | |||
9;TR_GRAVITY_FLOAT;super low grav with no gravity acceleration; | |||
10;TR_GRAVITY_PAUSED;has stopped, but trace to see if it should be switched back to TR_GRAVITY; | |||
11;TR_ACCELERATE; | |||
12;TR_DECCELERATE; | |||
13;TR_SPLINE; | |||
14;TR_LINEAR_PATH; | |||
</pitatable> | |||
</ | |||
---- | |||
===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 | |||
''Note'': Some other fields not listed as type 'entity' may take an entity number value. '''mg42BaseEnt''' and '''s.number''' are examples.<br> | :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.<br> | |||
[[Category:ETPro]] | [[Category:ETPro]] | ||
[[Category:ETPro:Mods]] | [[Category:ETPro:Mods]] | ||
Revision as of 17:34, 8 March 2006
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 tobe called or get whit an additional parameter
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 = <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.