Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

Editing QuakeC Fields

From Quake Wiki

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 11: Line 11:
 
The following fields should be defined in the exact order of this list, otherwise memory offset errors can occur.
 
The following fields should be defined in the exact order of this list, otherwise memory offset errors can occur.
  
*''float'' '''modelindex'''
+
*''float'' '''modelindex''' - The index for the entity's current model within the cache. Setting this to 0 will remove the entity's model. Otherwise this is best set via <code>setmodel()</code>.
:The index for the entity's current model within the cache. Setting this to 0 will remove the entity's model. Otherwise this is best set via <code>setmodel()</code>.
+
*''vector'' '''absmin''' - The world coordinate of the bottom left corner of the entity's axis-aligned bounding box. Both <code>setorigin()</code> and <code>setsize()</code> will set this. For BSP entities, <code>setmodel()</code> will also set this.
*''vector'' '''absmin'''
+
*''vector'' '''absmax''' - The world coordinate of the top right corner of the entity's axis-aligned bounding box. Both <code>setorigin()</code> and <code>setsize()</code> will set this. For BSP entities, <code>setmodel()</code> will also set this.
:The world coordinate of the bottom left corner of the entity's axis-aligned bounding box. Both <code>setorigin()</code> and <code>setsize()</code> will set this. For BSP entities, <code>setmodel()</code> will also set this.
+
*''float'' '''ltime''' - The local time for the entity. This is used in place of the global '''time''' variable if the entity has the move type <code>MOVETYPE_PUSH</code> since BSP entities that get blocked will pause their timer.
*''vector'' '''absmax'''
+
*''float'' '''[[Fields:Movetype|movetype]]''' - The type of movement the entity has. There are special rules for what entities should have what move type.
:The world coordinate of the top right corner of the entity's axis-aligned bounding box. Both <code>setorigin()</code> and <code>setsize()</code> will set this. For BSP entities, <code>setmodel()</code> will also set this.
+
*''float'' '''[[Fields:Solid|solid]]''' - The type of collision the entity has. There are special rules for BSP entities regarding their '''movetype'''.
*''float'' '''ltime'''
+
*''vector'' '''origin''' - The current world coordinate of the entity. Should be set by <code>setorigin()</code> since it involves relinking the entity to the world.
:The local time for the entity. This is used in place of the global '''time''' variable if the entity has the move type <code>MOVETYPE_PUSH</code> since BSP entities that get blocked will pause their timer.
+
*''vector'' '''oldorigin''' - Used with <code>MOVETYPE_WALK</code> to determine if the entity is stuck when moving. Secret door entities also use this to record their spawn position.
*''float'' '''[[Fields:Movetype|movetype]]'''
+
*''vector'' '''velocity''' - The movement direction and speed of the entity measured in map units/second.
:The type of movement the entity has. There are special rules for what entities should have what move type.
+
*''vector'' '''angles''' - The current direction as (pitch, yaw, roll) the entity's model is facing. Players use '''v_angle''' for their camera direction. Note that positive pitch values point up and negative pitch values down within this field. If you wish to pass it directly to <code>makevectors()</code>, you should negate the pitch before doing so. BSP entities should not use this field as their bounding box will not be aligned to their orientation.
*''float'' '''[[Fields:Solid|solid]]'''
+
*''vector'' '''avelocity''' - The angular velocity as (pitch, yaw, roll) of the entity measured in degrees/second. BSP entities should not use this field as their bounding box will not be aligned to their orientation.
:The type of collision the entity has. There are special rules for BSP entities regarding their '''movetype'''.
+
*''vector'' '''punchangle''' - The view angle offset as (pitch, yaw, roll) to apply to the player's camera e.g. weapon recoil.
*''vector'' '''origin'''
+
*''string'' '''classname''' - The type the entity is. Quake uses this to determine what spawn function to call for a given entity when it's first created while loading (the class name will match its spawn function's name).
:The current world coordinate of the entity. Should be set by <code>setorigin()</code> since it involves relinking the entity to the world.
+
*''string'' '''model''' - The name of the entity's current model. Setting this to empty will remove the entity's model. Otherwise this is best set via <code>setmodel()</code>. For BSP entities, this field is automatically populated with the name of their internal BSP model on spawn.
*''vector'' '''oldorigin'''
+
*''float'' '''frame''' - The current frame index for the entity's model.
:Used with <code>MOVETYPE_WALK</code> to determine if the entity is stuck when moving. Secret door entities also use this to record their spawn position.
+
*''float'' '''skin''' - The current skin index for the entity's model.
*''vector'' '''velocity'''
+
*''float'' '''[[Fields:Effects|effects]]''' - Flags that store which effects to apply to an entity e.g. muzzle flash.
:The movement direction and speed of the entity measured in map units/second.
+
*''vector'' '''mins''' - The size of the entity pointing towards its bottom left. These should be negative values. Should be set by <code>setsize()</code> since it involves relinking the entity to the world. For BSP entities this is set by <code>setmodel()</code>.
*''vector'' '''angles'''
+
*''vector'' '''maxs''' - The size of the entity pointing towards its top right. These should be positive values. Should be set by <code>setsize()</code> since it involves relinking the entity to the world. For BSP entities this is set by <code>setmodel()</code>.
:The current direction as (pitch, yaw, roll) the entity's model is facing. Players use '''v_angle''' for their camera direction. Note that positive pitch values point up and negative pitch values down within this field. If you wish to pass it directly to <code>makevectors()</code>, you should negate the pitch before doing so. BSP entities should not use this field as their bounding box will not be aligned to their orientation.
+
*''vector'' '''size''' - The total size of the entity on all 3 axes. Should be set by <code>setsize()</code> since it involves relinking the entity to the world. For BSP entities this is set by <code>setmodel()</code>.
*''vector'' '''avelocity'''
+
*''void()'' '''touch''' - The function to run (if any) when a collision occurs with another entity, both on the collider and collidee respectively. Only runs if the entity is considered a form of solid. If an entity is a trigger only its <code>touch()</code> will be called.
:The angular velocity as (pitch, yaw, roll) of the entity measured in degrees/second. BSP entities should not use this field as their bounding box will not be aligned to their orientation.
+
*''void()'' '''use''' - Unused.
*''vector'' '''punchangle'''
+
*''void()'' '''think''' - The next function to perform on the entity. Only gets called if '''nextthink''' is a positive value.
:The view angle offset as (pitch, yaw, roll) to apply to the player's camera e.g. weapon recoil.
+
*''void()'' '''blocked''' - Function called by BSP entities when they are unable to push an entity out of the way.
*''string'' '''classname'''
+
*''float'' '''nextthink''' - The time stamp for when to perform the next <code>think()</code> action. If a non-positive number, does nothing. After an entity thinks this is automatically set back to 0. For standard entities '''time''' should be used to set the time stamp while for BSP entities the '''ltime''' field should be used instead.
:The type the entity is. Quake uses this to determine what spawn function to call for a given entity when it's first created while loading (the class name will match its spawn function's name).
+
*''entity'' '''groundentity''' - The entity currently being stood on top of, if any. Often used to denote standing on top of a BSP entity.
*''string'' '''model'''
+
*''float'' '''health''' - The current health of the entity. This should use rounded numbers as imprecisions can cause bugs at low health values.
:The name of the entity's current model. Setting this to empty will remove the entity's model. Otherwise this is best set via <code>setmodel()</code>. For BSP entities, this field is automatically populated with the name of their internal BSP model on spawn.
+
*''float'' '''frags''' - The number of kills the player currently has in PvP modes.
*''float'' '''frame'''
+
*''float'' '''weapon''' - The item bit for the player's currently selected weapon.
:The current frame index for the entity's model.
+
*''string'' '''weaponmodel''' - The name of the model to use for the player's HUD weapon.
*''float'' '''skin'''
+
*''float'' '''weaponframe''' - The current frame index for the player's HUD weapon.
:The current skin index for the entity's model.
+
*''float'' '''currentammo''' - The amount of ammo to display in the HUD for the player's currently selected weapon.
*''float'' '''[[Fields:Effects|effects]]'''
+
*''float'' '''ammo_shells''' - The amount of shells the entity currently has.
:Flags that store which effects to apply to an entity e.g. muzzle flash.
+
*''float'' '''ammo_nails''' - The amount of nails the entity currently has.
*''vector'' '''mins'''
+
*''float'' '''ammo_rockets''' - The amount of rockets the entity currently has.
:The size of the entity pointing towards its bottom left. These should be negative values. Should be set by <code>setsize()</code> since it involves relinking the entity to the world. For BSP entities this is set by <code>setmodel()</code>.
+
*''float'' '''ammo_cells''' - The amount of cells the entity currently has.
*''vector'' '''maxs'''
+
*''float'' '''[[Fields:Items|items]]''' - Tracks the items an entity currently has. Usage can vary depending on type of entity, but common usage is for players, backpacks, and locked doors. Note: For players, this has special interactions with the HUD.
:The size of the entity pointing towards its top right. These should be positive values. Should be set by <code>setsize()</code> since it involves relinking the entity to the world. For BSP entities this is set by <code>setmodel()</code>.
+
*''float'' '''takedamage''' - The type of damage the entity is capable of taking. Can be the following:
*''vector'' '''size'''
+
*:<code>DAMAGE_NO</code>
:The total size of the entity on all 3 axes. Should be set by <code>setsize()</code> since it involves relinking the entity to the world. For BSP entities this is set by <code>setmodel()</code>.
+
*:<code>DAMAGE_YES</code>
*''void()'' '''touch'''
+
*:<code>DAMAGE_AIM</code> (signifies that the entity can be autoaimed at)
:The function to run (if any) when a collision occurs with another entity, both on the collider and collidee respectively. Only runs if the entity is considered a form of solid. If an entity is a trigger only its <code>touch()</code> will be called.
+
*''entity'' '''chain''' - Used with <code>findradius()</code> to create a linked list of entities that were found. This should not be used outside this purpose or modified manually. Nested <code>findradius()</code> calls can break this functionality without special precautions.
*''void()'' '''use'''
+
*''float'' '''deadflag''' - Used with players to denote their current respawn state. Can be the following:
:Unused.
 
*''void()'' '''think'''
 
:The next function to perform on the entity. Only gets called if '''nextthink''' is a positive value.
 
*''void()'' '''blocked'''
 
:Function called by BSP entities when they are unable to push an entity out of the way.
 
*''float'' '''nextthink'''
 
:The time stamp for when to perform the next <code>think()</code> action. If a non-positive number, does nothing. After an entity thinks this is automatically set back to 0. For standard entities '''time''' should be used to set the time stamp while for BSP entities the '''ltime''' field should be used instead.
 
*''entity'' '''groundentity'''
 
:The entity currently being stood on top of, if any. Used to denote standing on top of a BSP entity.
 
*''float'' '''health'''
 
:The current health of the entity. This should use rounded numbers as imprecisions can cause bugs at values less than 1.
 
*''float'' '''frags'''
 
:The number of kills the player currently has in PvP modes.
 
*''float'' '''weapon'''
 
:The item bit for the player's currently selected weapon.
 
*''string'' '''weaponmodel'''
 
:The name of the model to use for the player's HUD weapon.
 
*''float'' '''weaponframe'''
 
:The current frame index for the player's HUD weapon.
 
*''float'' '''currentammo'''
 
:The amount of ammo to display in the HUD for the player's currently selected weapon.
 
*''float'' '''ammo_shells'''
 
:The amount of shells the entity currently has.
 
*''float'' '''ammo_nails'''
 
:The amount of nails the entity currently has.
 
*''float'' '''ammo_rockets'''
 
:The amount of rockets the entity currently has.
 
*''float'' '''ammo_cells'''
 
:The amount of cells the entity currently has.
 
*''float'' '''[[Fields:Items|items]]'''
 
:Tracks the items an entity currently has. Usage can vary depending on type of entity, but common usage is for players, backpacks, and locked doors. Note: For players, this has special interactions with the HUD.
 
*''float'' '''takedamage'''
 
:The type of damage the entity is capable of taking. Can be the following:
 
:*<code>DAMAGE_NO</code>
 
:*<code>DAMAGE_YES</code>
 
:*<code>DAMAGE_AIM</code> (Signifies that the entity can be auto aimed at)
 
*''entity'' '''chain'''
 
:Used with <code>findradius()</code> to create a linked list of entities that were found. This should not be used outside this purpose or modified manually. Nested <code>findradius()</code> calls can break this functionality without special precautions.
 
*''float'' '''deadflag'''
 
:Used with players to denote their current respawn state. Can be the following:
 
 
:*<code>DEAD_NO</code>
 
:*<code>DEAD_NO</code>
 
:*<code>DEAD_DYING</code>
 
:*<code>DEAD_DYING</code>
 
:*<code>DEAD_DEAD</code>
 
:*<code>DEAD_DEAD</code>
 
:*<code>DEAD_RESPAWNABLE</code>
 
:*<code>DEAD_RESPAWNABLE</code>
*''vector'' '''view_ofs'''
+
*''vector'' '''view_ofs''' - The amount to shift from the origin of the entity to get its eye point.
:The amount to shift from the origin of the entity to get its eye point.
+
*''float'' '''button0''' - Boolean that determines if the fire button is pressed.
*''float'' '''button0'''
+
*''float'' '''button1''' - Unused.
:Boolean that determines if the fire button is pressed.
+
*''float'' '''button2''' - Boolean that determines if the jump button is pressed.
*''float'' '''button1'''
+
*''float'' '''impulse''' - The command a client is sending to the server. This is used for changing weapons and certain cheats. Only one impulse can be sent at a time.
:Unused.
+
*''float'' '''fixangle''' - If set to <code>TRUE</code>, the player's camera angle is updated instantly based off their '''angles''' field. This is automatically cleared.
*''float'' '''button2'''
+
*''vector'' '''v_angle''' - The direction the player's camera is facing as (pitch, yaw, roll). Negative pitch values point up while positive pitch values point down.
:Boolean that determines if the jump button is pressed.
+
*''float'' '''idealpitch''' - If walking on a slope, the calculated pitch to align the player's camera with it. This is disabled if mouse input is active.
*''float'' '''impulse'''
+
*''string'' '''netname''' - The name of the entity, be it the player's name or a printable name for messages.
:The command a client is sending to the server. This is used for changing weapons and certain cheats. Only one impulse can be sent at a time per player.
+
*''entity'' '''enemy''' - For monsters, the entity it's currently chasing after. This is also the entity floating and swimming monsters will always try to align their height to.
*''float'' '''fixangle'''
+
*''float'' '''[[Fields:Flags|flags]]''' - The flags for the entity.
:If set to <code>TRUE</code>, the player's camera angle is updated instantly based off their '''angles''' field. This is automatically cleared.
+
*''float'' '''colormap''' - The current color map index for the entity's model. This is mostly for player corpses and should match the player number the entity is mimicking.
*''vector'' '''v_angle'''
+
*''float'' '''team''' - What team the player is on in team-based PvP modes.
:The direction the player's camera is facing as (pitch, yaw, roll). Negative pitch values point up while positive pitch values point down.
+
*''float'' '''max_health''' - The maximum amount a player can heal from standard health pickups.
*''float'' '''idealpitch'''
+
*''float'' '''teleport_time''' - If greater than '''time''', ignore movement inputs from the player. This is set immediately after teleporting to make sure the player can't run off into the abyss.
:If walking on a slope, the calculated pitch to align the player's camera with it. This is disabled if mouse input is active.
+
*''float'' '''armortype''' - The fraction of damage to absorb. This only stores up to two decimal places by default.
*''string'' '''netname'''
+
*''float'' '''armorvalue''' - How much armor the entity currently has.
:The name of the entity, be it the player's name or a printable name for messages.
+
*''float'' '''waterlevel''' - The current liquid level of the entity. For players:
*''entity'' '''enemy'''
+
:0 - Out of liquid
:For monsters, the entity it's currently chasing after. This is also the entity floating and swimming monsters will always try to align their height to.
+
:1 - Below waist
*''float'' '''[[Fields:Flags|flags]]'''
+
:2 - Above waist
:The flags for the entity.
+
:3 - Above camera view height
*''float'' '''colormap'''
+
:For other entities, this is only 0 (out of liquid) or 1 (in liquid).
:The current color map index for the entity's model. This is mostly for player corpses and should match the player number the entity is mimicking.
+
*''float'' '''watertype''' - The <code>CONTENT_*</code> type of the liquid the entity is standing in.
*''float'' '''team'''
+
*''float'' '''ideal_yaw''' - For monsters, this is the yaw they want to turn towards.
:What team the player is on in team-based PvP modes.
+
*''float'' '''yaw_speed''' - How quickly the monster should turn towards '''ideal_yaw'''. Measured in degrees per 0.1 seconds by default.
*''float'' '''max_health'''
+
*''entity'' '''aiment''' - Unused.
:The maximum amount a player can heal from standard health pickups.
+
*''entity'' '''goalentity''' - The entity monsters are trying to move towards, usually while patrolling. For floating and swimming monsters, they won't try to put themselves at level with it.
*''float'' '''teleport_time'''
+
*''float'' '''spawnflags''' - The flags set for the entity within the map editor itself. What spawn flags are available differs from entity type to entity type.
:If greater than '''time''', ignore movement inputs from the player. This is set immediately after teleporting to make sure the player can't run off into the abyss.
+
*''string'' '''target''' - The '''targetname''' id that an entity will try and activate when it gets used. Different entity types have different use conditions.
*''float'' '''armortype'''
+
*''string'' '''targetname''' - The id of the entity for use in being activated.
:The fraction of damage to absorb. This only stores up to two decimal places by default.
+
*''float'' '''dmg_take''' - How much modified damage the player took on a given frame.
*''float'' '''armorvalue'''
+
*''float'' '''dmg_save''' - How much damage was mitigated by the player's armor on a given frame.
:How much armor the entity currently has.
+
*''entity'' '''dmg_inflictor''' - The last entity to deal damage to the player on a given frame.
*''float'' '''waterlevel'''
+
*''entity'' '''owner''' - Which entity is considered the owner of this entity. Entities will automatically pass through their '''owner''' instead of colliding with them.
:The current liquid level of the entity. For players:
+
*''vector'' '''movedir''' - Used by various entity types to determine which way to move e.g. doors.
:*<code>0</code> (Out of liquid)
+
*''string'' '''message''' - What message to display when certain entity types are activated.
:*<code>1</code> (Below waist)
+
*''float'' '''sounds''' - What type of sounds an entity uses. Often used for setting sound types on BSP entities from the map editor.
:*<code>2</code> (Above waist)
 
:*<code>3</code> (Above camera view height)
 
:For other entities, this is only <code>0</code> (out of liquid) or <code>1</code> (in liquid).
 
*''float'' '''watertype'''
 
:The <code>CONTENT_*</code> type of the liquid the entity is standing in.
 
*''float'' '''ideal_yaw'''
 
:For monsters, this is the yaw they want to turn towards.
 
*''float'' '''yaw_speed'''
 
:How quickly the monster should turn towards '''ideal_yaw'''. Measured in degrees per 0.1 seconds by default.
 
*''entity'' '''aiment'''
 
:Unused.
 
*''entity'' '''goalentity'''
 
:The entity monsters are trying to move towards, usually while patrolling. For floating and swimming monsters, they won't try to put themselves at level with it.
 
*''float'' '''spawnflags'''
 
:The flags set for the entity within the map editor itself. What spawn flags are available differs from entity type to entity type.
 
*''string'' '''target'''
 
:The '''targetname''' id that an entity will try and activate when it gets used. Different entity types have different use conditions.
 
*''string'' '''targetname'''
 
:The id of the entity for use in being activated.
 
*''float'' '''dmg_take'''
 
:How much modified damage the player took on a given frame.
 
*''float'' '''dmg_save'''
 
:How much damage was mitigated by the player's armor on a given frame.
 
*''entity'' '''dmg_inflictor'''
 
:The last entity to deal damage to the player on a given frame.
 
*''entity'' '''owner'''
 
:Which entity is considered the owner of this entity. Entities will automatically pass through their '''owner''' instead of colliding with them.
 
*''vector'' '''movedir'''
 
:Used by various entity types to determine which way to move e.g. doors. Also used by the player when they're jumping out of a liquid.
 
*''string'' '''message'''
 
:What message to display when certain entity types are activated.
 
*''float'' '''sounds'''
 
:What type of sounds an entity uses. Often used for setting sound types on BSP entities from the map editor.
 
 
*''string'' '''noise'''
 
*''string'' '''noise'''
 
*''string'' '''noise1'''
 
*''string'' '''noise1'''
 
*''string'' '''noise2'''
 
*''string'' '''noise2'''
 
*''string'' '''noise3'''
 
*''string'' '''noise3'''
:Sounds that various BSP entities use to play audio during certain interactions.
+
:- Sound names that various BSP entities use to play audio during certain interactions.
  
 
== Entity Fields ==
 
== Entity Fields ==
 
These can be defined anywhere in any order. Removing or changing them isn't advised since maps use field names to determine what values to set, and any field can be arbitrarily set from the map editor. Modifying these could cause vanilla maps to break due to incorrect initializing.
 
These can be defined anywhere in any order. Removing or changing them isn't advised since maps use field names to determine what values to set, and any field can be arbitrarily set from the map editor. Modifying these could cause vanilla maps to break due to incorrect initializing.
 
 
=== World Fields ===
 
=== World Fields ===
*''float'' '''worldtype'''
+
*''float'' '''worldtype''' - Used across various entity types to determine what type of level it is and what assets should be used e.g. keys.
:Used across various entity types to determine what type of level it is and what assets should be used e.g. keys.
+
*''string'' '''wad''' - Unused.
*''string'' '''wad'''
 
:Unused.
 
 
 
 
=== Map Entity Fields ===
 
=== Map Entity Fields ===
*''string'' '''map'''
+
*''string'' '''map''' - Used by level changing entities to store what the next map to go to is.
:Used by level changing entities to store what the next map to go to is.
+
*''float'' '''style''' - The id of the light style layer to use for the light entity.
*''float'' '''style'''
+
*''float'' '''light_lev''' - The intensity of the light entity.
:The id of the light style layer to use for the light entity. Can be a value from [0, 63].
+
*''float'' '''bubble_count''' - The number of bubbles for a bubble spawner to create.
*''float'' '''light_lev'''
+
*''string'' '''mdl''' - Used by items to store their current model name so it can be reset when respawned.
:The intensity of the light entity.
+
*''float'' '''aflag''' - The amount of ammo an ammo pickup gives.
*''float'' '''bubble_count'''
+
*''float'' '''healamount''' - The amount of health a health pickup restores.
:The number of bubbles for a bubble spawner to create.
+
*''float'' '''healtype''' - The type of pickup a health item is. Can be one of the following:
*''string'' '''mdl'''
+
:0 - Small (15 HP)
:Used by items to store their current model name so it can be reset when respawned.
+
:1 - Standard (25 HP)
*''float'' '''aflag'''
+
:2 - Megahealth (100 HP)
:The amount of ammo an ammo pickup gives.
+
*''vector'' '''dest''' - Unused.
*''float'' '''healamount'''
 
:The amount of health a health pickup restores.
 
*''float'' '''healtype'''
 
:The type of pickup a health item is. Can be one of the following:
 
:*<code>0</code> (Small, 15 HP)
 
:*<code>1</code> (Standard, 25 HP)
 
:*<code>2</code> (Megahealth, 100 HP)
 
*''vector'' '''dest'''
 
:Unused.
 
 
 
 
=== BSP Entity Fields ===
 
=== BSP Entity Fields ===
*''float'' '''speed'''
+
*''float'' '''speed''' - Used by various entity types to determine how fast it moves towards its goal in map units/second.
:Used by various entity types to determine how fast it moves towards its goal in map units/second.
+
*''vector'' '''mangle''' - Used by certain entity types to store their map editor angles before resetting it to <code>VEC_ORIGIN</code>. This is often used to create directional movement.
*''vector'' '''mangle'''
+
*''float'' '''t_width''' - Used by secret door entities to calculate how far to move to get to their first destination. Also used as a time stamp for when the [[Thunderbolt]] can play its sound again.
:Used by certain entity types to store their map editor angles before resetting it to <code>VEC_ORIGIN</code>. This is often used to create directional movement.
+
*''float'' '''t_length''' - Used by secret door entities to calculate how far to move to get to their final destination.
*''float'' '''t_width'''
+
*''vector'' '''dest1''' - Used by secret door entities to record their first destination's position.
:Used by secret door entities to calculate how far to move to get to their first destination. Also used as a time stamp for when the [[Thunderbolt]] can play its sound again.
+
*''vector'' '''dest2''' - Used by secret door entities to record their final destination's position.
*''float'' '''t_length'''
+
*''float'' '''wait''' - Used by various entity types to determine how long to wait before moving again e.g. buttons and doors. Also used by traps to determine their fire rate.
:Used by secret door entities to calculate how far to move to get to their final destination.
+
*''entity'' '''trigger_field''' - Stores the trigger a door uses to open itself.
*''vector'' '''dest1'''
+
*''string'' '''noise4''' - Sound to play for locked doors.
:Used by secret door entities to record their first destination's position.
+
*''float'' '''dmg''' - Stores the amount of damage various entity types do when blocked or triggered. Also stores how much drowning damage to deal to the player.
*''vector'' '''dest2'''
+
*''void()'' '''think1''' - The function to call when an entity reaches its movement or rotation destination.
:Used by secret door entities to record their final destination's position.
+
*''vector'' '''finaldest''' - The final calculated position of the entity's movement.
*''float'' '''wait'''
+
*''vector'' '''finalangle''' - The final calculated angles of the entity's rotation. This shouldn't be used with BSP entities since their bounding box will not match their orientation.
:Used by various entity types to determine how long to wait before moving again e.g. buttons and doors. Also used by traps to determine their fire rate.
+
*''float'' '''count''' - Used by triggers to determine how many more times they must be activated.
*''entity'' '''trigger_field'''
+
*''float'' '''lip''' - Distance in map units that doors and buttons stick out from the wall.
:Stores the trigger a door uses to open itself.
+
*''float'' '''state''' - Stores the current state of various entity types. Can be one of the following:
*''string'' '''noise4'''
+
:<code>STATE_TOP</code>
:Sound to play for locked doors.
+
:<code>STATE_BOTTOM</code>
*''float'' '''dmg'''
+
:<code>STATE_UP</code>
:Stores the amount of damage various entity types do when blocked or triggered. Also stores how much drowning damage to deal to the player.
+
:<code>STATE_DOWN</code>
*''void()'' '''think1'''
+
*''vector'' '''pos1''' - Records the spawn position of various entity types.
:The function to call when an entity reaches its movement or rotation destination.
+
*''vector'' '''pos2''' - Records the destination position of various entity types.
*''vector'' '''finaldest'''
 
:The final calculated position of the entity's movement.
 
*''vector'' '''finalangle'''
 
:The final calculated angles of the entity's rotation. This shouldn't be used with BSP entities since their bounding box will not match their orientation.
 
*''float'' '''count'''
 
:Used by triggers to determine how many more times they must be activated.
 
*''float'' '''lip'''
 
:Distance in map units that doors and buttons stick out from the wall.
 
*''float'' '''state'''
 
:Stores the current state of various entity types. Can be one of the following:
 
:*<code>STATE_TOP</code>
 
:*<code>STATE_BOTTOM</code>
 
:*<code>STATE_UP</code>
 
:*<code>STATE_DOWN</code>
 
*''vector'' '''pos1'''
 
:Records the spawn position of various entity types.
 
*''vector'' '''pos2'''
 
:Records the destination position of various entity types.
 
 
 
 
=== General Entity Fields ===
 
=== General Entity Fields ===
*''string'' '''killtarget'''
+
*''string'' '''killtarget''' - The '''targetname''' id of the entities to remove from the map when activated. Contrary to its name, this will delete them and not kill them. This takes precedence over '''target''' by default.
:The '''targetname''' id of the entities to remove from the map when activated. Contrary to its name, this will delete them and not kill them. This takes precedence over '''target''' by default.
+
*''float'' '''attack_finished''' - Time stamp for when the entity is allowed to attack again.
*''float'' '''attack_finished'''
+
*''float'' '''pain_finished''' - Time stamp for when the entity can enter its pain state again.
:Time stamp for when the entity is allowed to attack again.
+
*''float'' '''fly_sound''' - Time stamp for when the wind sound effect can be played again from an entity when it walks into a push trigger.
*''float'' '''pain_finished'''
+
*''float'' '''delay''' - If activated, wait this long before actually activating other entities.
:Time stamp for when the entity can enter its pain state again.
+
*''float'' '''cnt''' - Counter that tracks various behaviors e.g. monster refiring, Spawn jumping, and bubble splitting.
*''float'' '''fly_sound'''
+
*''float'' '''distance''' - Unused.
:Time stamp for when the wind sound effect can be played again from an entity when it walks into a push trigger.
+
*''float'' '''volume''' - Unused.
*''float'' '''delay'''
+
*''float'' '''hit_z''' - Unused.
:If activated, wait this long before actually activating other entities.
 
*''float'' '''cnt'''
 
:Counter that tracks various behaviors e.g. monster refiring, Spawn jumping, and bubble splitting.
 
*''float'' '''distance'''
 
:Unused.
 
*''float'' '''volume'''
 
:Unused.
 
*''float'' '''hit_z'''
 
:Unused.
 
 
 
 
=== Monster Entity Fields ===
 
=== Monster Entity Fields ===
*''void()'' '''th_stand'''
+
*''void()'' '''th_stand''' - The function to call when a monster starts to idle.
:The function to call when a monster starts to idle.
+
*''void()'' '''th_walk''' - The function to call when a monster starts walking towards its patrol points.
*''void()'' '''th_walk'''
+
*''void()'' '''th_run''' - The function to call when a monster begins to chase its '''enemy'''.
:The function to call when a monster starts walking towards its patrol points.
+
*''void()'' '''th_missile''' - The function to call if a monster has a ranged attack.
*''void()'' '''th_run'''
+
*''void()'' '''th_melee''' - The function to call if a monster has a melee attack.
:The function to call when a monster begins to chase its '''enemy'''.
 
*''void()'' '''th_missile'''
 
:The function to call if a monster has a ranged attack.
 
*''void()'' '''th_melee'''
 
:The function to call if a monster has a melee attack.
 
 
*''void(entity attacker, float damage)'' '''th_pain''' - The function to call when the monster is damaged.
 
*''void(entity attacker, float damage)'' '''th_pain''' - The function to call when the monster is damaged.
*''void()'' '''th_die'''
+
*''void()'' '''th_die''' - The function to call when a monster dies.
:The function to call when a monster dies.
+
*''entity'' '''oldenemy''' - Stores the last valid enemy a monster had before switching targets.
*''entity'' '''oldenemy'''
+
*''float'' '''lefty''' - Boolean used by strafing monsters to determine which direction they're strafing (if <code>TRUE</code>, moves left).
:Stores the last valid enemy a monster had before switching targets.
+
*''float'' '''search_time''' - Time stamp used in co-op modes as a cool down for monsters looking for a new target to attack.
*''float'' '''lefty'''
+
*''float'' '''attack_state''' - The current attacking state of the monster. Can be one of the following:
:Boolean used by strafing monsters to determine which direction they're strafing (if <code>TRUE</code>, moves left).
+
:<code>AS_STRAIGHT</code>
*''float'' '''search_time'''
+
:<code>AS_SLIDING</code> (currently strafing)
:Time stamp used in co-op modes as a cool down for monsters looking for a new target to attack.
+
:<code>AS_MISSILE</code>
*''float'' '''attack_state'''
+
:<code>AS_MELEE</code>
:The current attacking state of the monster. Can be one of the following:
+
*''float'' '''pausetime''' - Time stamp for when a monster can start walking towards its patrol points.
:*<code>AS_STRAIGHT</code>
+
*''entity'' '''movetarget''' - The patrol point entity a monster is trying to walk towards.
:*<code>AS_SLIDING</code> (Currently strafing)
+
*''float'' '''waitmin''' - Time stamp for when [[Scrag|Scrags]] can play their idle sound.
:*<code>AS_MISSILE</code>
+
*''float'' '''inpain''' - Used by [[Zombie|Zombies]] to determine what pain state they're in. Can be one of the following:
:*<code>AS_MELEE</code>
+
:0 - No pain state
*''float'' '''pausetime'''
+
:1 - Flinching
:Time stamp for when a monster can start walking towards its patrol points.
+
:2 - Knocked down
*''entity'' '''movetarget'''
+
*''float'' '''waitmax''' - Unused.
:The patrol point entity a monster is trying to walk towards.
 
*''float'' '''waitmin'''
 
:Time stamp for when [[Scrag|Scrags]] can play their idle sound.
 
*''float'' '''inpain'''
 
:Used by [[Zombie|Zombies]] to determine what pain state they're in. Can be one of the following:
 
:*<code>0</code> (No pain state)
 
:*<code>1</code> (Flinching)
 
:*<code>2</code> (Knocked down)
 
*''float'' '''waitmax'''
 
:Unused.
 
 
 
 
=== Player Entity Fields ===
 
=== Player Entity Fields ===
*''float'' '''walkframe'''
+
*''float'' '''walkframe''' - The current frame of the player's idle and running animations.
:The current frame of the player's idle and running animations.
+
*''float'' '''invincible_finished''' - Time stamp for when the [[Pentagram of Protection]] powerup wears off.
*''float'' '''invincible_finished'''
+
*''float'' '''invincible_time''' - Time stamp that controls the sound and screen flash from the Pentagram of Protection wearing off.
:Time stamp for when the [[Pentagram of Protection]] powerup wears off.
+
*''float'' '''invincible_sound''' - Time stamp for when the protection sound can be played again when taking damage.
*''float'' '''invincible_time'''
+
*''float'' '''invisible_finished''' - Time stamp for when the [[Ring of Shadows]] powerup wears off.
:Time stamp that controls the sound and screen flash from the Pentagram of Protection wearing off.
+
*''float'' '''invisible_time''' - Time stamp that controls the sound and screen flash from the Ring of Shadows wearing off.
*''float'' '''invincible_sound'''
+
*''float'' '''invisible_sound''' - Time stamp for when the Ring's whispering sound effect is played.
:Time stamp for when the protection sound can be played again when taking damage.
+
*''float'' '''super_damage_finished''' - Time stamp for when the [[Quad Damage]] powerup wears off.
*''float'' '''invisible_finished'''
+
*''float'' '''super_time''' - Time stamp that controls the sound and screen flash from the Quad Damage wearing off.
:Time stamp for when the [[Ring of Shadows]] powerup wears off.
+
*''float'' '''super_sound''' - Time stamp for when the Quad firing sound effect can be played again.
*''float'' '''invisible_time'''
+
*''float'' '''radsuit_finished''' - Time stamp for when the [[Biosuit]] powerup wears off.
:Time stamp that controls the sound and screen flash from the Ring of Shadows wearing off.
+
*''float'' '''rad_time''' - Time stamp that controls the sound and screen flash from the Biosuit wearing off.
*''float'' '''invisible_sound'''
+
*''float'' '''axhitme''' - Signifies that the player was hit by another player's axe that frame.
:Time stamp for when the Ring's whispering sound effect is played.
+
*''float'' '''show_hostile''' - If greater than '''time''', nearby monsters will wake up without needing to see the player.
*''float'' '''super_damage_finished'''
+
*''float'' '''jump_flag''' - Stores the player's z velocity when not on the ground.
:Time stamp for when the [[Quad Damage]] powerup wears off.
+
*''float'' '''swim_flag''' - Time stamp for when the swimming sound should be played again while jumping underwater.
*''float'' '''super_time'''
+
*''float'' '''air_finished''' - Time stamp for when the player runs out of air when under a liquid and begins to drown.
:Time stamp that controls the sound and screen flash from the Quad Damage wearing off.
+
*''string'' '''deathtype''' - Used to determine if the player fell to their death by setting it to "falling".
*''float'' '''super_sound'''
+
*''float'' '''dmgtime''' - Time stamp for when a harmful liquid can damage a player again.
:Time stamp for when the Quad firing sound effect can be played again.
 
*''float'' '''radsuit_finished'''
 
:Time stamp for when the [[Biosuit]] powerup wears off.
 
*''float'' '''rad_time'''
 
:Time stamp that controls the sound and screen flash from the Biosuit wearing off.
 
*''float'' '''axhitme'''
 
:Signifies that the player was hit by another player's axe that frame.
 
*''float'' '''show_hostile'''
 
:If greater than '''time''', nearby monsters will wake up without needing to see the player.
 
*''float'' '''jump_flag'''
 
:Stores the player's z velocity when not on the ground.
 
*''float'' '''swim_flag'''
 
:Time stamp for when the swimming sound should be played again while jumping underwater.
 
*''float'' '''air_finished'''
 
:Time stamp for when the player runs out of air when under a liquid and begins to drown.
 
*''string'' '''deathtype'''
 
:Used to determine if the player fell to their death by setting it to "falling".
 
*''float'' '''dmgtime'''
 
:Time stamp for when a harmful liquid can damage a player again.
 

Please note that all contributions to Quake Wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see Quake Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)