[DISCLAIMER: If there's a site you recommend that already explains all this, please let me know.]
Hi people.
I've been reading, and reading and reading about Quake C. I can't help but use my current knowledge of C (the only language I'm familiar with) to 'grasp' Quake C, but much if the descriptions (as well as the code itself) is confusing to me. Normally, I'd look at main(), and look up the headers, and decipher what was going on that way. But here there IS no 'main' so I have no idea the order in which instructions are followed, I cant 'watch' the code execute, and so I have to 'guess' what happens and when. The tutorials help, but they still have left me confused as to HOW exactly the code works.
What's the best site which explains Quake C? I've been reading
http://www.gamers.org/dEngine/quake/spe ... c-lang.htm, but the explanations just confuse me. The guy seems to be freely intermixing jargon from C around in a very confusing way.
eg: "As Quake-C stands currently, all the field definitions are definitions of entity fields." (???)
I STILL don't understand exactly what an 'entity' is. Rather than asking the question 'what is an entity' which I've read many descriptions which seem 'sloppy', please allow me to give you rough bits and pieces of my current 'understanding', which I invite people to correct, or confirm.
1. A Quake C 'Entity' = a C 'Structure', ie a collection of variables, of different types, stored as a 'record' eg 'self' contains a bunch of variables which relate to 'self'. Just like C.
2. A 'field' = 'field variable' = a member variable of an entity. eg 'self.health'. Just like C.
3. In Quake C you can't make new Entities. But you can add new variables to existing Entities (?)
4. But every time you add a variable ('field') to an Entity (Structure), ALL entities in the game get that field added to them.(?) Eg, if we're defining
.float fooamount
Does that mean that EVERY ENTITY IN THE GAME has just been assigned a new variable .fooamount? there is now a 'self.fooamount'?
5. To quote from
http://www.gamers.org/dEngine/quake/spe ... tm#QC-TFLD
"Some of the fields do not store value, but instead they store the function to be executed in certain conditions. They are called the methods that can be aplied to the object."
So we're storing functions ('methods') inside entities (structures?). That sounds EXACTLY like C++. So do we call them functions, or methods?
When I started C, once I learned the language, I could (slowly) decipher what was going on, by following the 'flow' of the code. With Quake C, I'm copying and modifying bits and pieces, but without understanding wtf I'm doing, it's really easy to get stuck. It's like I'm in a foreign country with a little phrase book, and whilst I can ask for a coffee, what the time is and where the toilets are, I can't really have a proper conversation.
OneManClan