⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qc-enty.htm

📁 Quake 的 各 种 文 档 格 式 说 明
💻 HTM
📖 第 1 页 / 共 2 页
字号:

<h5>Player/Monster stats and damage status</h5>
<p><pre>
float   <b><a name="dot_deadflag">deadflag</a></b>;               // tells if an <a href="qc-defs.htm#d_deadflag" target="content">entity is dead</a>.
float   <b><a name="dot_health">health</a></b>;                 // health level
float   <b><a name="dot_max_health">max_health</a></b>;             // players maximum health is stored here
float   <b><a name="dot_takedamage">takedamage</a></b>;             // <a href="qc-defs.htm#d_damage" target="content">indicates</a> if entity can be damaged
float   <b><a name="dot_dmg_take">dmg_take</a></b>;               // damage is accumulated through a frame. and sent as one single
float   <b><a name="dot_dmg_save">dmg_save</a></b>;               // message, so the super shotgun doesn't generate huge messages
entity  <b><a name="dot_dmg_inflictor">dmg_inflictor</a></b>;          // entity that inflicted the damage (player, monster, missile, door)
</pre> 


<h5>Player inventory</h5>
<p><pre>
float   <b><a name="dot_items">items</a></b>;                  // bit flags
float   <b><a name="dot_armortype">armortype</a></b>;              // fraction of damage absorbed by armor
float   <b><a name="dot_armorvalue">armorvalue</a></b>;             // armor level
float   <b><a name="dot_weapon">weapon</a></b>;                 // one of the IT_SHOTGUN, etc flags
string  <b><a name="dot_weaponmodel">weaponmodel</a></b>;            // entity model for weapon
float   <b><a name="dot_weaponframe">weaponframe</a></b>;            // frame for weapon model
float   <b><a name="dot_currentammo">currentammo</a></b>;            // ammo for current weapon
float   <b><a name="dot_ammo_shells">ammo_shells</a></b>;            // remaining shells
float   <b><a name="dot_ammo_nails">ammo_nails</a></b>;             // remaining nails
float   <b><a name="dot_ammo_rockets">ammo_rockets</a></b>;           // remaining rockets and grenades
float   <b><a name="dot_ammo_cells">ammo_cells</a></b>;             // remaining lightning bolts
</pre>
</p>
<p><pre>
float   <b><a name="dot_impulse">impulse</a></b>;                // weapon changes
</pre>
When set to <b>0</b>, the player's weapon doesn't change.
When different from zero, this field is interpreted by the Quake-C impulse command
as a request to change weapon (see <a href="weapons.htm#ImpulseCommand">ImpulseCommand</a>).
</p>



<h5> Player Fight</h5>
<pre>
entity  <b><a name="dot_owner">owner</a></b>;                  // Entity that owns this one (missiles, bubbles are owned by the player)
entity  <b><a name="dot_enemy">enemy</a></b>;                  // personal enemy (only for monster entities)
float   <b><a name="dot_button0">button0</a></b>;                // fire
float   <b><a name="dot_button1">button1</a></b>;                // use
float   <b><a name="dot_button2">button2</a></b>;                // jump
vector  <b><a name="dot_view_ofs">view_ofs</a></b>;               // position of player eye, relative to origin
float   <b><a name="dot_fixangle">fixangle</a></b>;               // set to 1 if you want <a href="qc-enty.htm#dot_angles" target="content">angles</a> to change now
vector  <b><a name="dot_v_angle">v_angle</a></b>;                // view or targeting angle for players
float   <b><a name="dot_idealpitch">idealpitch</a></b>;             // calculated pitch angle for lookup up slopes
entity  <b><a name="dot_aiment">aiment</a></b>;                 // aimed antity?
</pre>

<h5>Deathmatch</h5>
<pre>
float   <b><a name="dot_frags">frags</a></b>;                  // number of frags
string  <b><a name="dot_netname">netname</a></b>;                // name, in network play
float   <b><a name="dot_colormap">colormap</a></b>;               // colors of shirt and pants
float   <b><a name="dot_team">team</a></b>;                   // team number
float   <b><a name="dot_flags">flags</a></b>;                  // ?
</pre>



<h3>Fields used only by Quake-C (User defined)</h3>

<p>These entity fields are used only by Quake-C programs, and are never 
referenced by the C code of Quake.exe. So you can do whatever you want
with the values, so long as it's compatible with what other Quake-C
modules do.</p>

<p>If the fields defined here are not suitable for you, you can define
new <a href="qc-types.htm#fieldtypes" target="content">fields</a>, by adding them at the
end of the defintion of fields.
As a matter of fact, the number of fields in an entity (hence the size of 
all the instances of entity objects) is determined by Quake-C:
in the <b>PROGS.DAT</b> header, a value named <b>entityfields</b> indicates
to Quake.exe the size of the entity object.
</p>
<p>Beware however that the more field you add, the more <b>each entity</b>
will suck memory. Add just one float (4 bytes) and it will take, in memory,
4 bytes time the number of entity.
</p>
<p>The best is to share fields between distinct classes of entities, by
reusing the same position for another kind of field. If the Quake C Compiler
was a real object-oriented compiler, that would be done very safely by
single-inheritance (multiple-inheritance would be a deadly mistake).
You will also notice that id software has made quite a lousy usage
of most of the fields, defining much more than were actually needed,
since they are only used by a few entities.</p>


<h5>World fields</h5>

<pre>
string <b><a name="dot_wad">wad</a></b>;                      // name of WAD file with misc graphics  
string <b><a name="dot_map">map</a></b>;                      // name of the map being played
float  <b><a name="dot_worldtype">worldtype</a></b>;                // see below
</pre>
<p><b>worldtype</b> is <b>0</b> for a medieval setting,  <b>1</b> for metal,
and <b>2</b> for a base setting.<br>
These fields might soon become global variables, so don't rely too much on them.
</p>

<h5>Quake Ed fields</h5>

<pre>
string <b><a name="dot_killtarget">killtarget</a></b>;
float <b><a name="dot_light_lev">light_lev</a></b>;                 // not used by game, but parsed by light util
float <b><a name="dot_style">style</a></b>;
</pre>

<h5>Monster Behaviour</h5>

<p>
Those functions are called when these specific events happen:
<pre>
void() <b><a name="dot_th_stand">th_stand</a></b>;            // when stands iddle
void() <b><a name="dot_th_walk">th_walk</a></b>;             // when is walking
void() <b><a name="dot_th_run">th_run</a></b>;              // when is running
void() <b><a name="dot_th_missile">th_missile</a></b>;          // when a missile comes
void() <b><a name="dot_th_melee">th_melee</a></b>;            // when fighting in melee
void() <b><a name="dot_th_die">th_die</a></b>;              // when dies
</pre>
</p>
<p><pre>
void(entity <i>attacker</i>, float <i>damage</i>) <b><a name="dot_th_pain">th_pain</a></b>;
</pre>
That function is executed when the monster takes a certain amount of <i>damage</i>
from an <i>attacker</i> (a player, or another monster). Will usually cause the
monster to turn against the <i>attacker</i>.
</p>
 
<h5>Monster state variables</h5>
 
<pre>
entity <b><a name="dot_oldenemy">oldenemy</a></b>;            // mad at this player before taking damage
float  <b><a name="dot_speed">speed</a></b>;               //
float  <b><a name="dot_lefty">lefty</a></b>;               //
float  <b><a name="dot_search_time">search_time</a></b>;         //
float  <b><a name="dot_attack_state">attack_state</a></b>;        //
</pre>
<pre>
float   <b><a name="dot_pausetime">pausetime</a></b>;
entity  <b><a name="dot_movetarget">movetarget</a></b>;
</pre>


<h5>Player Only</h5>
<pre>
float   <b><a name="dot_walkframe">walkframe</a></b>;
float   <b><a name="dot_attack_finished">attack_finished</a></b>;
float   <b><a name="dot_pain_finished">pain_finished</a></b>;         // time when pain sound is finished
float   <b><a name="dot_invincible_finished">invincible_finished</a></b>;
float   <b><a name="dot_invisible_finished">invisible_finished</a></b>;
float   <b><a name="dot_super_damage_finished">super_damage_finished</a></b>;
float   <b><a name="dot_radsuit_finished">radsuit_finished</a></b>;
float   <b><a name="dot_invincible_time">invincible_time</a></b>;       // time when player cease to be invincible
float   <b><a name="dot_invincible_sound">invincible_sound</a></b>;
float   <b><a name="dot_invisible_time">invisible_time</a></b>;        // time when player cease to be invisible
float   <b><a name="dot_invisible_sound">invisible_sound</a></b>;
float   <b><a name="dot_super_time">super_time</a></b>;            // time when quad shot expires?
float   <b><a name="dot_super_sound">super_sound</a></b>;
float   <b><a name="dot_rad_time">rad_time</a></b>;
float   <b><a name="dot_fly_sound">fly_sound</a></b>;
float   <b><a name="dot_axhitme">axhitme</a></b>;               // TRUE if hit by axe
float   <b><a name="dot_show_hostile<">show_hostile</a></b>;          // set to time+0.2 whenever a client fires a
                               // weapon or takes damage.  Used to alert
                               // monsters that otherwise would let the player go
float   <b><a name="dot_jump_flag">jump_flag</a></b>;             // player jump flag
float   <b><a name="dot_swim_flag">swim_flag</a></b>;             // player swimming sound flag
float   <b><a name="dot_air_finished">air_finished</a></b>;          // when time &gt; air_finished, start drowning
float   <b><a name="dot_bubble_count">bubble_count</a></b>;          // keeps track of the number of bubbles
string  <b><a name="dot_deathtype">deathtype</a></b>;             // keeps track of how the player died
</pre>

<h5>Object stuff</h5> 
<pre>
string  <b><a name="dot_mdl">mdl</a></b>;                    // model name?
vector  <b><a name="dot_mangle">mangle</a></b>;                 // angle at start. 'pitch roll yaw'
vector  <b><a name="dot_oldorigin">oldorigin</a></b>;              // only used by secret door
float   <b><a name="dot_t_length">t_length</a></b>;
float   <b><a name="dot_t_width">t_width</a></b>;
</pre>

<h5>Doors</h5>
<pre>
vector  <b><a name="dot_dest">dest</a></b>;
vector  <b><a name="dot_dest1">dest1</a></b>;
vector  <b><a name="dot_dest2">dest2</a></b>;
float   <b><a name="dot_wait">wait</a></b>;                   // time from firing to restarting
float   <b><a name="dot_delay">delay</a></b>;                  // time from activation to firing
entity  <b><a name="dot_trigger_field">trigger_field</a></b>;          // door's trigger entity
string  <b><a name="dot_noise4">noise4</a></b>;
float   <b><a name="dot_aflag">aflag</a></b>;
float   <b><a name="dot_dmg">dmg</a></b>;                    // damage done by door when hit
</pre>



<h5>Miscellaneous</h5>
<pre>
float   <b><a name="dot_cnt">cnt</a></b>;                    // counter
void()  <b><a name="dot_think1">think1</a></b>;
vector  <b><a name="dot_finaldest">finaldest</a></b>;
vector  <b><a name="dot_finalangle">finalangle</a></b>;
//
// triggers
//
float   <b><a name="dot_count">count</a></b>;                  // for counting triggers
//
// plats / doors / buttons
//
float   <b><a name="dot_lip">lip</a></b>;
float   <b><a name="dot_state">state</a></b>;
vector  <b><a name="dot_pos1">pos1</a></b>;
vector  <b><a name="dot_pos2">pos2</a></b>;                   // top and bottom positions
float   <b><a name="dot_height">height</a></b>;
//
// sounds 
//
float   <b><a name="dot_waitmin">waitmin</a></b>;
float   <b><a name="dot_waitmax">waitmax</a></b>;
float   <b><a name="dot_distance">distance</a></b>;
float   <b><a name="dot_volume">volume</a></b>;
</pre>



<hr>

</BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -