Entities creation/QuakeC and map connection
Moderator: InsideQC Admins
5 posts
• Page 1 of 1
Entities creation/QuakeC and map connection
IIUIC :
Thanks.
- each entity has attributes
- - Does it have to have attribues
- I want to make mod from scratch. What is a minimal set of attribues which Quake needs
- - engine gets attribute by fixed offsets (they are in a vector) rather than hashmap. How are user defined attributes stored
you create entity with classname X in a map
- - if map editor does not support arbitrary names use EntEd
- - if you dont have one entity is not spawned
you make up some entity attributes Y in a map
you add those parameters Y in a Quake C
- - into defs.qc (must be
Thanks.
-

daemonicky - Posts: 185
- Joined: Wed Apr 13, 2011 1:34 pm
Re: Entities creation/QuakeC and map connection
from what you said (that from which i could comprehend):
entities don't have to have attributes.
are these questions or statements?
my advice: please keep your topics organized, alright? reading that hurt my head.
entities don't have to have attributes.
daemonicky wrote:IIUIC :
you create entity with classname X in a map- if map editor does not support arbitrary names use EntEd
you create void function with name X in a Quake C- if you dont have one entity is not spawned
when a map is loaded for all entities on a map quake calls all their X functions
are these questions or statements?
my advice: please keep your topics organized, alright? reading that hurt my head.
-

behind_you - Posts: 237
- Joined: Sat Feb 05, 2011 6:57 am
- Location: Tripoli, Libya
an ent is a block of fields
a union between an array and the fields defined before end_sys_fields in defs.qc.
the progs contains names/indexes of the fields, allowing the engine to lookup the index by field name.
fields can be defined anywhere at global scope in qc code. it doesn't have to be just in defs.qc. code cleanliness means they're *usually* defined in defs.qc, yes. but not always, you can define them whereever you want.
every entity type has the same exact fields. whether they are actually used is a different matter. the fields are always equally valid, as far as the engine/vm is aware.
loading ents from maps is a case of: spawn an ent. for each named field, look up the offset, store the value at that format ('angle' gets remapped to 'angles_y', field names with a leading underscore are considered comments and ignored), fields that don't exist result in a warning instead. find a function with the same name as the new .classname field. if found, call the function, if not found, delete the ent and print a warning.
editors don't have a clue which fields are used by any given entity type unless explicitly told. QuakeED parses the QC code itself, but other editors have some private field list which is chosen based on the classname chosen. Editors don't have a clue about custom fields in custom mods, and thus generally provide a way to add whatever custom fields you want.
note that functions are loaded in the same way that any other field is loaded, and matched by name. which means you can do some sneaky info_notnull entity hacks.
a union between an array and the fields defined before end_sys_fields in defs.qc.
the progs contains names/indexes of the fields, allowing the engine to lookup the index by field name.
fields can be defined anywhere at global scope in qc code. it doesn't have to be just in defs.qc. code cleanliness means they're *usually* defined in defs.qc, yes. but not always, you can define them whereever you want.
every entity type has the same exact fields. whether they are actually used is a different matter. the fields are always equally valid, as far as the engine/vm is aware.
loading ents from maps is a case of: spawn an ent. for each named field, look up the offset, store the value at that format ('angle' gets remapped to 'angles_y', field names with a leading underscore are considered comments and ignored), fields that don't exist result in a warning instead. find a function with the same name as the new .classname field. if found, call the function, if not found, delete the ent and print a warning.
editors don't have a clue which fields are used by any given entity type unless explicitly told. QuakeED parses the QC code itself, but other editors have some private field list which is chosen based on the classname chosen. Editors don't have a clue about custom fields in custom mods, and thus generally provide a way to add whatever custom fields you want.
note that functions are loaded in the same way that any other field is loaded, and matched by name. which means you can do some sneaky info_notnull entity hacks.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Re: Entities creation/QuakeC and map connection
Thank you both. And I apologize for messy post.
So, in order to make entity work I have to make function in quake C and match its classname in level editor?
What info_notnull hacks? Are they necessary?
So, in order to make entity work I have to make function in quake C and match its classname in level editor?
What info_notnull hacks? Are they necessary?
-

daemonicky - Posts: 185
- Joined: Wed Apr 13, 2011 1:34 pm
you're function:
void() iwanttoputagunhere;
in your map, make an entity called iwanttoputagunhere.
that's how you do it
void() iwanttoputagunhere;
in your map, make an entity called iwanttoputagunhere.
that's how you do it
-

behind_you - Posts: 237
- Joined: Sat Feb 05, 2011 6:57 am
- Location: Tripoli, Libya
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest