Difference between revisions of "Fieldname"

From WolfWiki
Jump to: navigation, search
m (clean up vec3 example. You don't need t = {} before calling a function that returns a table.)
(trajectory, pedantry for vec3, category)
Line 130: Line 130:
 
'''vec3''' : a '''vec3''' is a 3-element array of numbers (C definition: <tt>typedef float vec3_t[3];
 
'''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 a table 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
 
doing:
 
doing:
 
<pre>
 
<pre>
 
origin = et.gentity_get(entNum,"r.currentOrigin") --a vec3 value
 
origin = et.gentity_get(entNum,"r.currentOrigin") --a vec3 value
 
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
 +
{
 +
  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 <tt>
 +
<ol start=0>
 +
<li>TR_STATIONARY</li>
 +
<li>TR_INTERPOLATE // non-parametric, but interpolate between snapshots</li>
 +
<li> TR_LINEAR</li>
 +
<li>TR_LINEAR_STOP</li>
 +
<li>TR_LINEAR_STOP_BACK //----(SA) added.  so reverse movement can be different than forward</li>
 +
<li>TR_SINE // value = base + sin( time / duration ) * delta</li>
 +
<li>TR_GRAVITY</li>
 +
<li>TR_GRAVITY_LOW</li>
 +
<li>TR_GRAVITY_FLOAT // super low grav with no gravity acceleration (floating feathers/fabric/leaves/...)</li>
 +
<li>TR_GRAVITY_PAUSED //----(SA) has stopped, but will still do a short trace to see if it should be switched back to TR_GRAVITY</li>
 +
<li>TR_ACCELERATE</li>
 +
<li>TR_DECCELERATE</li>
 +
<li>TR_SPLINE</li>
 +
<li>TR_LINEAR_PATH</li>
 +
</ol>
 +
</tt>
  
 
[[Category:ETPro]]
 
[[Category:ETPro]]
 +
[[Category:ETPro:Mods]]

Revision as of 00:25, 17 November 2005

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

fieldtypeaccess
activatorentityRO
chainentityRW
classnamestringRW
closespeedfloatRW
countintegerRW
count2integerRW
damageintegerRW
deathTypeintegerRW
delayfloatRW
dl_attenintegerRW
dl_colorvec3RW
dl_shaderstringRO
dl_stylestringstringRO
durationfloatRW
end_sizeintegerRW
enemyentityRW
flagsintegerRO
harcfloatRW
healthintegerRW
inusebooleanRO
isPropbooleanRO
itemstringRW
keyintegerRW
messagestringRW
methodOfDeathintegerRW
mg42BaseEntintegerRW
missionLevelintegerRW
modelstringRO
model2stringRO
nextTrainentityRW
noise_indexintegerRW
originvec3RW
prevTrainentityRW
props_frame_stateintegerRO
r.absmaxvec3RO
r.absminvec3RO
r.bmodelbooleanRO
r.contentsintegerRW
r.currentAnglesvec3RW
r.currentOriginvec3RW
r.eventTimeintegerRW
r.linkcountintegerRO
r.linkedbooleanRO
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.effect1TimeintegerRW
s.effect2TimeintegerRW
s.effect3TimeintegerRW
s.frameintegerRW
s.groundEntityNumintegerRO
s.loopSoundintegerRW
s.modelindexintegerRW
s.modelindex2integerRW
s.numberintegerRO
s.onFireEndintegerRW
s.onFireStartintegerRW
s.postrajectoryRW
s.powerupsintegerRO
s.solidintegerRW
s.teamNumintegerRW
s.timeintegerRW
s.time2integerRW
s.weaponintegerRO
scriptNamestringRO
sess.damage_givenintegerRW
sess.damage_receivedintegerRW
sess.deathsintegerRW
sess.game_pointsintegerRW
sess.gibsintegerRW
sess.killsintegerRW
sess.mutedintegerRW
sess.refereeintegerRW
sess.roundsintegerRW
sess.semiadminintegerRW
sess.spec_inviteintegerRW
sess.spec_teamintegerRW
sess.suicidesintegerRW
sess.team_damageintegerRW
sess.team_killsintegerRW
sess.team_receivedintegerRW
spawnflagsintegerRO
spawnitemstringRO
speedfloatRW
splashDamageintegerRW
splashMethodOfDeathintegerRW
splashRadiusintegerRW
start_sizeintegerRW
tagNamestringRO
tagParententityRW
takedamagebooleanRW
tankLinkentityRW
targetstringRW
TargetAnglesvec3RW
TargetFlagintegerRO
targetnamestringRO
teamchainentityRW
teammasterentityRW
trackstringRO
varcfloatRW
waitfloatRW
waterlevelintegerRO
watertypeintegerRO

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
  1. TR_STATIONARY
  2. TR_INTERPOLATE // non-parametric, but interpolate between snapshots
  3. TR_LINEAR
  4. TR_LINEAR_STOP
  5. TR_LINEAR_STOP_BACK //----(SA) added. so 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 (floating feathers/fabric/leaves/...)
  10. TR_GRAVITY_PAUSED //----(SA) has stopped, but will still do a short 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