overview |
This section explains the support classes and structs used (mostly) by qcs.
qentity |
![]() | |
![]() |
![]() |
![]() |
![]() |
class qentity { public: int index; int default_index; int frame; int skin; vector origin; vector facing; vector velocity; float lastTime; int rate; qentity(); void updateOrigin( vector &, float, float ); };
- index
- This indexes into qcs::modeltable and is used when determining the model type.
- default_index
- Set during SPAWNBASELINE messages.
- frame
- Current frame. Useful to determine if a player.mdl is dead or not; some frames are death animations.
- skin
- The skin number. Really only useful for armour, since different skins are used for different types (green, yellow, red) of armour.
- origin
- The center of the entitiy. Only valid if the model doesn't mode (health) or if it's visible. (use mbotbase::isVisible())
- facing
- Which way the entitiy is facing. It may not be moving in this direction.
- velocity
- The actual direction the model is moving. The length of the vector is the speed of the model, in QuakeUnits / second.
- lastTime
- The last timestamp this entity was updated in.
- rate
- I use this to store mbnav's target-rating for this model. You can do whatever with it ;)
- updateOrigin
- Use this instead of just changing origin by hand; this also updates the velocity vector. The first float is the newTimestamp, the second float is the oldTimestamp.
serverinfo |
![]() | |
![]() |
![]() |
![]() |
![]() |
struct serverInfo { char * name; char * address; char * level; int players; int maxPlayers; serverInfo(); ~serverInfo(); };
- name
- The name of the server.
- address
- The IP and port of the server (i.e. "129.128.109.135:26000")
- level
- The name of the level; this is not the filename of the level. (i.e. e1m1)
- players
- Current number of connected players. This is only updated by control packets (and is only valid if you are not connected and have just received a SERVERINFO packet)
- maxPlayers
- Maximum players allowed by server. This is valid when you are connected and the signon level is > 2.
qplayer |
![]() | |
![]() |
![]() |
![]() |
![]() |
class qplayer { public: int index; int frags; char * name; int hate; int shirt; int pants; qplayer(); ~qplayer(); };
- index
- Which entity this player is tied to. OBSOLETE: all players are tied to an entity 1 greater than their playerNumber (i.e. player 0 uses entitiy 1)
- frags
- How many kills this player has.
- name
- The player's name; all names are run through parseName() when received.
- hate
- mikeBot specific: the hatelevel of the player. Negative hate indicates a friend.
- shirt, pants
- The player's colours.
options |
![]() | |
![]() |
![]() |
![]() |
![]() |
class options { protected: int tableSize; char ** table; int elements; int * values; int getHashValue( char * ); public: options( int size = OPTS_MAX ); ~options(); int add( char *, int ); int remove( char * ); int find( char *, int * v = NULL ); int set( char * x, int v ) { return add( x, v ); } int get( char * x ) { int r=0; find( x, &r ); return r; } };