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

Difference between revisions of "QuakeC Fields"

From Quake Wiki

(Created page with "== What Are Fields? == Quake's fields are broken down into two main types: system fields and entity fields. When a field is declared, every entity in the game has their own v...")
(No difference)

Revision as of 23:18, 16 July 2023

What Are Fields?

Quake's fields are broken down into two main types: system fields and entity fields. When a field is declared, every entity in the game has their own version of that field. Valid field data types include string, vector, float, and entity. They are declared via

   .datatype variableName;

Note the . as declaring a variable without this will make it global instead of entity-specific.

System fields are fields defined within the engine itself and must be present for the game to work. These are always defined after the system global fields. The end of them is denoted by the void end_sys_fields; declaration. System fields must always be declared in the order defined within the vanilla QuakeC files as they are linked by memory offsets internally. Changing the order will break logic.

Entity fields are standard fields that have no internal linkage and can be defined freely anywhere. Declaring it will automatically give all entities access to their own version.

System Fields

float 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.

Entity Fields