codemp/game/g_public.h

Go to the documentation of this file.
00001 // Copyright (C) 1999-2000 Id Software, Inc.
00002 //
00003 #ifndef G_PUBLIC_H
00004 
00005 // g_public.h -- game module information visible to server
00006 
00007 #define G_PUBLIC_H
00008 
00009 #define Q3_INFINITE                     16777216 
00010 
00011 #define GAME_API_VERSION        8
00012 
00013 // entity->svFlags
00014 // the server does not know how to interpret most of the values
00015 // in entityStates (level eType), so the game must explicitly flag
00016 // special server behaviors
00017 #define SVF_NOCLIENT                    0x00000001      // don't send entity to clients, even if it has effects
00018 #define SVF_BOT                                 0x00000008      // set if the entity is a bot
00019 #define SVF_PLAYER_USABLE               0x00000010      // player can use this with the use button
00020 #define SVF_BROADCAST                   0x00000020      // send to all connected clients
00021 #define SVF_PORTAL                              0x00000040      // merge a second pvs at origin2 into snapshots
00022 #define SVF_USE_CURRENT_ORIGIN  0x00000080      // entity->r.currentOrigin instead of entity->s.origin
00023                                                                                         // for link position (missiles and movers)
00024 #define SVF_SINGLECLIENT                0x00000100      // only send to a single client (entityShared_t->singleClient)
00025 #define SVF_NOSERVERINFO                0x00000200      // don't send CS_SERVERINFO updates to this client
00026                                                                                         // so that it can be updated for ping tools without
00027                                                                                         // lagging clients
00028 #define SVF_CAPSULE                             0x00000400      // use capsule for collision detection instead of bbox
00029 #define SVF_NOTSINGLECLIENT             0x00000800      // send entity to everyone but one client
00030                                                                                         // (entityShared_t->singleClient)
00031 
00032 #define SVF_OWNERNOTSHARED              0x00001000      // If it's owned by something and another thing owned by that something
00033                                                                                         // hits it, it will still touch
00034 
00035 #define SVF_ICARUS_FREEZE               0x00008000      // NPCs are frozen, ents don't execute ICARUS commands
00036 
00037 #define SVF_GLASS_BRUSH                 0x08000000      // Ent is a glass brush
00038 
00039 #define SVF_NO_BASIC_SOUNDS             0x10000000      // No basic sounds
00040 #define SVF_NO_COMBAT_SOUNDS    0x20000000      // No combat sounds
00041 #define SVF_NO_EXTRA_SOUNDS             0x40000000      // No extra or jedi sounds
00042 
00043 //rww - ghoul2 trace flags
00044 #define G2TRFLAG_DOGHOULTRACE   0x00000001 //do the ghoul2 trace
00045 #define G2TRFLAG_HITCORPSES             0x00000002 //will try g2 collision on the ent even if it's EF_DEAD
00046 #define G2TRFLAG_GETSURFINDEX   0x00000004 //will replace surfaceFlags with the ghoul2 surface index that was hit, if any.
00047 #define G2TRFLAG_THICK                  0x00000008 //assures that the trace radius will be significantly large regardless of the trace box size.
00048 
00049 //===============================================================
00050 
00051 //this structure is shared by gameside and in-engine NPC nav routines.
00052 typedef struct failedEdge_e
00053 {
00054         int     startID;
00055         int     endID;
00056         int checkTime;
00057         int     entID;
00058 } failedEdge_t;
00059 
00060 typedef struct {
00061         qboolean        linked;                         // qfalse if not in any good cluster
00062         int                     linkcount;
00063 
00064         int                     svFlags;                        // SVF_NOCLIENT, SVF_BROADCAST, etc
00065         int                     singleClient;           // only send to this client when SVF_SINGLECLIENT is set
00066 
00067         qboolean        bmodel;                         // if false, assume an explicit mins / maxs bounding box
00068                                                                         // only set by trap_SetBrushModel
00069         vec3_t          mins, maxs;
00070         int                     contents;                       // CONTENTS_TRIGGER, CONTENTS_SOLID, CONTENTS_BODY, etc
00071                                                                         // a non-solid entity should set to 0
00072 
00073         vec3_t          absmin, absmax;         // derived from mins/maxs and origin + rotation
00074 
00075         // currentOrigin will be used for all collision detection and world linking.
00076         // it will not necessarily be the same as the trajectory evaluation for the current
00077         // time, because each entity must be moved one at a time after time is advanced
00078         // to avoid simultanious collision issues
00079         vec3_t          currentOrigin;
00080         vec3_t          currentAngles;
00081         qboolean        mIsRoffing;                     // set to qtrue when the entity is being roffed
00082 
00083         // when a trace call is made and passEntityNum != ENTITYNUM_NONE,
00084         // an ent will be excluded from testing if:
00085         // ent->s.number == passEntityNum       (don't interact with self)
00086         // ent->s.ownerNum = passEntityNum      (don't interact with your own missiles)
00087         // entity[ent->s.ownerNum].ownerNum = passEntityNum     (don't interact with other missiles from owner)
00088         int                     ownerNum;
00089 
00090         // mask of clients that this entity should be broadcast too.  The first 32 clients
00091         // are represented by the first array index and the latter 32 clients are represented
00092         // by the second array index.
00093         int                     broadcastClients[2];
00094 
00095 } entityShared_t;
00096 
00097 //===============================================================
00098 
00099 //
00100 // system traps provided by the main engine
00101 //
00102 typedef enum {
00103         //============== general Quake services ==================
00104 
00105         G_PRINT,                // ( const char *string );
00106         // print message on the local console
00107 
00108         G_ERROR,                // ( const char *string );
00109         // abort the game
00110 
00111         G_MILLISECONDS, // ( void );
00112         // get current time for profiling reasons
00113         // this should NOT be used for any game related tasks,
00114         // because it is not journaled
00115 
00116         //Also for profiling.. do not use for game related tasks.
00117         G_PRECISIONTIMER_START,
00118         G_PRECISIONTIMER_END,
00119 
00120         // console variable interaction
00121         G_CVAR_REGISTER,        // ( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags );
00122         G_CVAR_UPDATE,  // ( vmCvar_t *vmCvar );
00123         G_CVAR_SET,             // ( const char *var_name, const char *value );
00124         G_CVAR_VARIABLE_INTEGER_VALUE,  // ( const char *var_name );
00125 
00126         G_CVAR_VARIABLE_STRING_BUFFER,  // ( const char *var_name, char *buffer, int bufsize );
00127 
00128         G_ARGC,                 // ( void );
00129         // ClientCommand and ServerCommand parameter access
00130 
00131         G_ARGV,                 // ( int n, char *buffer, int bufferLength );
00132 
00133         G_FS_FOPEN_FILE,        // ( const char *qpath, fileHandle_t *file, fsMode_t mode );
00134         G_FS_READ,              // ( void *buffer, int len, fileHandle_t f );
00135         G_FS_WRITE,             // ( const void *buffer, int len, fileHandle_t f );
00136         G_FS_FCLOSE_FILE,               // ( fileHandle_t f );
00137 
00138         G_SEND_CONSOLE_COMMAND, // ( const char *text );
00139         // add commands to the console as if they were typed in
00140         // for map changing, etc
00141 
00142 
00143         //=========== server specific functionality =============
00144 
00145         G_LOCATE_GAME_DATA,             // ( gentity_t *gEnts, int numGEntities, int sizeofGEntity_t,
00146         //                                                      playerState_t *clients, int sizeofGameClient );
00147         // the game needs to let the server system know where and how big the gentities
00148         // are, so it can look at them directly without going through an interface
00149 
00150         G_DROP_CLIENT,          // ( int clientNum, const char *reason );
00151         // kick a client off the server with a message
00152 
00153         G_SEND_SERVER_COMMAND,  // ( int clientNum, const char *fmt, ... );
00154         // reliably sends a command string to be interpreted by the given
00155         // client.  If clientNum is -1, it will be sent to all clients
00156 
00157         G_SET_CONFIGSTRING,     // ( int num, const char *string );
00158         // config strings hold all the index strings, and various other information
00159         // that is reliably communicated to all clients
00160         // All of the current configstrings are sent to clients when
00161         // they connect, and changes are sent to all connected clients.
00162         // All confgstrings are cleared at each level start.
00163 
00164         G_GET_CONFIGSTRING,     // ( int num, char *buffer, int bufferSize );
00165 
00166         G_GET_USERINFO,         // ( int num, char *buffer, int bufferSize );
00167         // userinfo strings are maintained by the server system, so they
00168         // are persistant across level loads, while all other game visible
00169         // data is completely reset
00170 
00171         G_SET_USERINFO,         // ( int num, const char *buffer );
00172 
00173         G_GET_SERVERINFO,       // ( char *buffer, int bufferSize );
00174         // the serverinfo info string has all the cvars visible to server browsers
00175 
00176         G_SET_SERVER_CULL,
00177         //server culling to reduce traffic on open maps -rww
00178 
00179         G_SET_BRUSH_MODEL,      // ( gentity_t *ent, const char *name );
00180         // sets mins and maxs based on the brushmodel name
00181 
00182         G_TRACE,        // ( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask );
00183         // collision detection against all linked entities
00184 
00185         G_G2TRACE,      // ( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask );
00186         // collision detection against all linked entities with ghoul2 check
00187 
00188         G_POINT_CONTENTS,       // ( const vec3_t point, int passEntityNum );
00189         // point contents against all linked entities
00190 
00191         G_IN_PVS,                       // ( const vec3_t p1, const vec3_t p2 );
00192 
00193         G_IN_PVS_IGNORE_PORTALS,        // ( const vec3_t p1, const vec3_t p2 );
00194 
00195         G_ADJUST_AREA_PORTAL_STATE,     // ( gentity_t *ent, qboolean open );
00196 
00197         G_AREAS_CONNECTED,      // ( int area1, int area2 );
00198 
00199         G_LINKENTITY,           // ( gentity_t *ent );
00200         // an entity will never be sent to a client or used for collision
00201         // if it is not passed to linkentity.  If the size, position, or
00202         // solidity changes, it must be relinked.
00203 
00204         G_UNLINKENTITY,         // ( gentity_t *ent );          
00205         // call before removing an interactive entity
00206 
00207         G_ENTITIES_IN_BOX,      // ( const vec3_t mins, const vec3_t maxs, gentity_t **list, int maxcount );
00208         // EntitiesInBox will return brush models based on their bounding box,
00209         // so exact determination must still be done with EntityContact
00210 
00211         G_ENTITY_CONTACT,       // ( const vec3_t mins, const vec3_t maxs, const gentity_t *ent );
00212         // perform an exact check against inline brush models of non-square shape
00213 
00214         // access for bots to get and free a server client (FIXME?)
00215         G_BOT_ALLOCATE_CLIENT,  // ( void );
00216 
00217         G_BOT_FREE_CLIENT,      // ( int clientNum );
00218 
00219         G_GET_USERCMD,  // ( int clientNum, usercmd_t *cmd )
00220 
00221         G_GET_ENTITY_TOKEN,     // qboolean ( char *buffer, int bufferSize )
00222         // Retrieves the next string token from the entity spawn text, returning
00223         // false when all tokens have been parsed.
00224         // This should only be done at GAME_INIT time.
00225 
00226         G_SIEGEPERSSET,
00227         G_SIEGEPERSGET,
00228 
00229         G_FS_GETFILELIST,
00230         G_DEBUG_POLYGON_CREATE,
00231         G_DEBUG_POLYGON_DELETE,
00232         G_REAL_TIME,
00233         G_SNAPVECTOR,
00234 
00235         G_TRACECAPSULE, // ( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask );
00236         G_ENTITY_CONTACTCAPSULE,        // ( const vec3_t mins, const vec3_t maxs, const gentity_t *ent );
00237 
00238 //      SP_REGISTER_SERVER_CMD,
00239         SP_GETSTRINGTEXTSTRING,
00240 
00241         G_ROFF_CLEAN,                           // qboolean     ROFF_Clean(void);
00242         G_ROFF_UPDATE_ENTITIES,         // void         ROFF_UpdateEntities(void);
00243         G_ROFF_CACHE,                           // int          ROFF_Cache(char *file);
00244         G_ROFF_PLAY,                            // qboolean     ROFF_Play(int entID, int roffID, qboolean doTranslation);
00245         G_ROFF_PURGE_ENT,                       // qboolean ROFF_PurgeEnt( int entID )
00246 
00247         //rww - dynamic vm memory allocation!
00248         G_TRUEMALLOC,
00249         G_TRUEFREE,
00250 
00251         //rww - icarus traps
00252         G_ICARUS_RUNSCRIPT,
00253         G_ICARUS_REGISTERSCRIPT,
00254 
00255         G_ICARUS_INIT,
00256         G_ICARUS_VALIDENT,
00257         G_ICARUS_ISINITIALIZED,
00258         G_ICARUS_MAINTAINTASKMANAGER,
00259         G_ICARUS_ISRUNNING,
00260         G_ICARUS_TASKIDPENDING,
00261         G_ICARUS_INITENT,
00262         G_ICARUS_FREEENT,
00263         G_ICARUS_ASSOCIATEENT,
00264         G_ICARUS_SHUTDOWN,
00265         G_ICARUS_TASKIDSET,
00266         G_ICARUS_TASKIDCOMPLETE,
00267         G_ICARUS_SETVAR,
00268         G_ICARUS_VARIABLEDECLARED,
00269         G_ICARUS_GETFLOATVARIABLE,
00270         G_ICARUS_GETSTRINGVARIABLE,
00271         G_ICARUS_GETVECTORVARIABLE,
00272 
00273         G_SET_SHARED_BUFFER,
00274 
00275         //BEGIN VM STUFF
00276         G_MEMSET = 100,
00277         G_MEMCPY,
00278         G_STRNCPY,
00279         G_SIN,
00280         G_COS,
00281         G_ATAN2,
00282         G_SQRT,
00283         G_MATRIXMULTIPLY,
00284         G_ANGLEVECTORS,
00285         G_PERPENDICULARVECTOR,
00286         G_FLOOR,
00287         G_CEIL,
00288 
00289         G_TESTPRINTINT,
00290         G_TESTPRINTFLOAT,
00291 
00292         G_ACOS,
00293         G_ASIN,
00294 
00295         //END VM STUFF
00296 
00297         //rww - BEGIN NPC NAV TRAPS
00298         G_NAV_INIT = 200,
00299         G_NAV_FREE,
00300         G_NAV_LOAD,
00301         G_NAV_SAVE,
00302         G_NAV_ADDRAWPOINT,
00303         G_NAV_CALCULATEPATHS,
00304         G_NAV_HARDCONNECT,
00305         G_NAV_SHOWNODES,
00306         G_NAV_SHOWEDGES,
00307         G_NAV_SHOWPATH,
00308         G_NAV_GETNEARESTNODE,
00309         G_NAV_GETBESTNODE,
00310         G_NAV_GETNODEPOSITION,
00311         G_NAV_GETNODENUMEDGES,
00312         G_NAV_GETNODEEDGE,
00313         G_NAV_GETNUMNODES,
00314         G_NAV_CONNECTED,
00315         G_NAV_GETPATHCOST,
00316         G_NAV_GETEDGECOST,
00317         G_NAV_GETPROJECTEDNODE,
00318         G_NAV_CHECKFAILEDNODES,
00319         G_NAV_ADDFAILEDNODE,
00320         G_NAV_NODEFAILED,
00321         G_NAV_NODESARENEIGHBORS,
00322         G_NAV_CLEARFAILEDEDGE,
00323         G_NAV_CLEARALLFAILEDEDGES,
00324         G_NAV_EDGEFAILED,
00325         G_NAV_ADDFAILEDEDGE,
00326         G_NAV_CHECKFAILEDEDGE,
00327         G_NAV_CHECKALLFAILEDEDGES,
00328         G_NAV_ROUTEBLOCKED,
00329         G_NAV_GETBESTNODEALTROUTE,
00330         G_NAV_GETBESTNODEALT2,
00331         G_NAV_GETBESTPATHBETWEENENTS,
00332         G_NAV_GETNODERADIUS,
00333         G_NAV_CHECKBLOCKEDEDGES,
00334         G_NAV_CLEARCHECKEDNODES,
00335         G_NAV_CHECKEDNODE,
00336         G_NAV_SETCHECKEDNODE,
00337         G_NAV_FLAGALLNODES,
00338         G_NAV_GETPATHSCALCULATED,
00339         G_NAV_SETPATHSCALCULATED,
00340         //rww - END NPC NAV TRAPS
00341 
00342         BOTLIB_SETUP = 250,                             // ( void );
00343         BOTLIB_SHUTDOWN,                                // ( void );
00344         BOTLIB_LIBVAR_SET,
00345         BOTLIB_LIBVAR_GET,
00346         BOTLIB_PC_ADD_GLOBAL_DEFINE,
00347         BOTLIB_START_FRAME,
00348         BOTLIB_LOAD_MAP,
00349         BOTLIB_UPDATENTITY,
00350         BOTLIB_TEST,
00351 
00352         BOTLIB_GET_SNAPSHOT_ENTITY,             // ( int client, int ent );
00353         BOTLIB_GET_CONSOLE_MESSAGE,             // ( int client, char *message, int size );
00354         BOTLIB_USER_COMMAND,                    // ( int client, usercmd_t *ucmd );
00355 
00356         BOTLIB_AAS_ENABLE_ROUTING_AREA = 300,
00357         BOTLIB_AAS_BBOX_AREAS,
00358         BOTLIB_AAS_AREA_INFO,
00359         BOTLIB_AAS_ENTITY_INFO,
00360 
00361         BOTLIB_AAS_INITIALIZED,
00362         BOTLIB_AAS_PRESENCE_TYPE_BOUNDING_BOX,
00363         BOTLIB_AAS_TIME,
00364 
00365         BOTLIB_AAS_POINT_AREA_NUM,
00366         BOTLIB_AAS_TRACE_AREAS,
00367 
00368         BOTLIB_AAS_POINT_CONTENTS,
00369         BOTLIB_AAS_NEXT_BSP_ENTITY,
00370         BOTLIB_AAS_VALUE_FOR_BSP_EPAIR_KEY,
00371         BOTLIB_AAS_VECTOR_FOR_BSP_EPAIR_KEY,
00372         BOTLIB_AAS_FLOAT_FOR_BSP_EPAIR_KEY,
00373         BOTLIB_AAS_INT_FOR_BSP_EPAIR_KEY,
00374 
00375         BOTLIB_AAS_AREA_REACHABILITY,
00376 
00377         BOTLIB_AAS_AREA_TRAVEL_TIME_TO_GOAL_AREA,
00378 
00379         BOTLIB_AAS_SWIMMING,
00380         BOTLIB_AAS_PREDICT_CLIENT_MOVEMENT,
00381 
00382         BOTLIB_EA_SAY = 400,
00383         BOTLIB_EA_SAY_TEAM,
00384         BOTLIB_EA_COMMAND,
00385 
00386         BOTLIB_EA_ACTION,
00387         BOTLIB_EA_GESTURE,
00388         BOTLIB_EA_TALK,
00389         BOTLIB_EA_ATTACK,
00390         BOTLIB_EA_ALT_ATTACK,
00391         BOTLIB_EA_FORCEPOWER,
00392         BOTLIB_EA_USE,
00393         BOTLIB_EA_RESPAWN,
00394         BOTLIB_EA_CROUCH,
00395         BOTLIB_EA_MOVE_UP,
00396         BOTLIB_EA_MOVE_DOWN,
00397         BOTLIB_EA_MOVE_FORWARD,
00398         BOTLIB_EA_MOVE_BACK,
00399         BOTLIB_EA_MOVE_LEFT,
00400         BOTLIB_EA_MOVE_RIGHT,
00401 
00402         BOTLIB_EA_SELECT_WEAPON,
00403         BOTLIB_EA_JUMP,
00404         BOTLIB_EA_DELAYED_JUMP,
00405         BOTLIB_EA_MOVE,
00406         BOTLIB_EA_VIEW,
00407 
00408         BOTLIB_EA_END_REGULAR,
00409         BOTLIB_EA_GET_INPUT,
00410         BOTLIB_EA_RESET_INPUT,
00411 
00412 
00413         BOTLIB_AI_LOAD_CHARACTER = 500,
00414         BOTLIB_AI_FREE_CHARACTER,
00415         BOTLIB_AI_CHARACTERISTIC_FLOAT,
00416         BOTLIB_AI_CHARACTERISTIC_BFLOAT,
00417         BOTLIB_AI_CHARACTERISTIC_INTEGER,
00418         BOTLIB_AI_CHARACTERISTIC_BINTEGER,
00419         BOTLIB_AI_CHARACTERISTIC_STRING,
00420 
00421         BOTLIB_AI_ALLOC_CHAT_STATE,
00422         BOTLIB_AI_FREE_CHAT_STATE,
00423         BOTLIB_AI_QUEUE_CONSOLE_MESSAGE,
00424         BOTLIB_AI_REMOVE_CONSOLE_MESSAGE,
00425         BOTLIB_AI_NEXT_CONSOLE_MESSAGE,
00426         BOTLIB_AI_NUM_CONSOLE_MESSAGE,
00427         BOTLIB_AI_INITIAL_CHAT,
00428         BOTLIB_AI_REPLY_CHAT,
00429         BOTLIB_AI_CHAT_LENGTH,
00430         BOTLIB_AI_ENTER_CHAT,
00431         BOTLIB_AI_STRING_CONTAINS,
00432         BOTLIB_AI_FIND_MATCH,
00433         BOTLIB_AI_MATCH_VARIABLE,
00434         BOTLIB_AI_UNIFY_WHITE_SPACES,
00435         BOTLIB_AI_REPLACE_SYNONYMS,
00436         BOTLIB_AI_LOAD_CHAT_FILE,
00437         BOTLIB_AI_SET_CHAT_GENDER,
00438         BOTLIB_AI_SET_CHAT_NAME,
00439 
00440         BOTLIB_AI_RESET_GOAL_STATE,
00441         BOTLIB_AI_RESET_AVOID_GOALS,
00442         BOTLIB_AI_PUSH_GOAL,
00443         BOTLIB_AI_POP_GOAL,
00444         BOTLIB_AI_EMPTY_GOAL_STACK,
00445         BOTLIB_AI_DUMP_AVOID_GOALS,
00446         BOTLIB_AI_DUMP_GOAL_STACK,
00447         BOTLIB_AI_GOAL_NAME,
00448         BOTLIB_AI_GET_TOP_GOAL,
00449         BOTLIB_AI_GET_SECOND_GOAL,
00450         BOTLIB_AI_CHOOSE_LTG_ITEM,
00451         BOTLIB_AI_CHOOSE_NBG_ITEM,
00452         BOTLIB_AI_TOUCHING_GOAL,
00453         BOTLIB_AI_ITEM_GOAL_IN_VIS_BUT_NOT_VISIBLE,
00454         BOTLIB_AI_GET_LEVEL_ITEM_GOAL,
00455         BOTLIB_AI_AVOID_GOAL_TIME,
00456         BOTLIB_AI_INIT_LEVEL_ITEMS,
00457         BOTLIB_AI_UPDATE_ENTITY_ITEMS,
00458         BOTLIB_AI_LOAD_ITEM_WEIGHTS,
00459         BOTLIB_AI_FREE_ITEM_WEIGHTS,
00460         BOTLIB_AI_SAVE_GOAL_FUZZY_LOGIC,
00461         BOTLIB_AI_ALLOC_GOAL_STATE,
00462         BOTLIB_AI_FREE_GOAL_STATE,
00463 
00464         BOTLIB_AI_RESET_MOVE_STATE,
00465         BOTLIB_AI_MOVE_TO_GOAL,
00466         BOTLIB_AI_MOVE_IN_DIRECTION,
00467         BOTLIB_AI_RESET_AVOID_REACH,
00468         BOTLIB_AI_RESET_LAST_AVOID_REACH,
00469         BOTLIB_AI_REACHABILITY_AREA,
00470         BOTLIB_AI_MOVEMENT_VIEW_TARGET,
00471         BOTLIB_AI_ALLOC_MOVE_STATE,
00472         BOTLIB_AI_FREE_MOVE_STATE,
00473         BOTLIB_AI_INIT_MOVE_STATE,
00474 
00475         BOTLIB_AI_CHOOSE_BEST_FIGHT_WEAPON,
00476         BOTLIB_AI_GET_WEAPON_INFO,
00477         BOTLIB_AI_LOAD_WEAPON_WEIGHTS,
00478         BOTLIB_AI_ALLOC_WEAPON_STATE,
00479         BOTLIB_AI_FREE_WEAPON_STATE,
00480         BOTLIB_AI_RESET_WEAPON_STATE,
00481 
00482         BOTLIB_AI_GENETIC_PARENTS_AND_CHILD_SELECTION,
00483         BOTLIB_AI_INTERBREED_GOAL_FUZZY_LOGIC,
00484         BOTLIB_AI_MUTATE_GOAL_FUZZY_LOGIC,
00485         BOTLIB_AI_GET_NEXT_CAMP_SPOT_GOAL,
00486         BOTLIB_AI_GET_MAP_LOCATION_GOAL,
00487         BOTLIB_AI_NUM_INITIAL_CHATS,
00488         BOTLIB_AI_GET_CHAT_MESSAGE,
00489         BOTLIB_AI_REMOVE_FROM_AVOID_GOALS,
00490         BOTLIB_AI_PREDICT_VISIBLE_POSITION,
00491 
00492         BOTLIB_AI_SET_AVOID_GOAL_TIME,
00493         BOTLIB_AI_ADD_AVOID_SPOT,
00494         BOTLIB_AAS_ALTERNATIVE_ROUTE_GOAL,
00495         BOTLIB_AAS_PREDICT_ROUTE,
00496         BOTLIB_AAS_POINT_REACHABILITY_AREA_INDEX,
00497 
00498         BOTLIB_PC_LOAD_SOURCE,
00499         BOTLIB_PC_FREE_SOURCE,
00500         BOTLIB_PC_READ_TOKEN,
00501         BOTLIB_PC_SOURCE_FILE_AND_LINE,
00502 
00503         /*
00504 Ghoul2 Insert Start
00505 */
00506         G_R_REGISTERSKIN,
00507         G_G2_LISTBONES,
00508         G_G2_LISTSURFACES,
00509         G_G2_HAVEWEGHOULMODELS,
00510         G_G2_SETMODELS,
00511         G_G2_GETBOLT,
00512         G_G2_GETBOLT_NOREC,
00513         G_G2_GETBOLT_NOREC_NOROT,
00514         G_G2_INITGHOUL2MODEL,
00515         G_G2_SETSKIN,
00516         G_G2_SIZE,
00517         G_G2_ADDBOLT,
00518         G_G2_SETBOLTINFO,
00519         G_G2_ANGLEOVERRIDE,
00520         G_G2_PLAYANIM,
00521         G_G2_GETBONEANIM,
00522         G_G2_GETGLANAME,
00523         G_G2_COPYGHOUL2INSTANCE,
00524         G_G2_COPYSPECIFICGHOUL2MODEL,
00525         G_G2_DUPLICATEGHOUL2INSTANCE,
00526         G_G2_HASGHOUL2MODELONINDEX,
00527         G_G2_REMOVEGHOUL2MODEL,
00528         G_G2_REMOVEGHOUL2MODELS,
00529         G_G2_CLEANMODELS,
00530         G_G2_COLLISIONDETECT,
00531         G_G2_COLLISIONDETECTCACHE,
00532 
00533         G_G2_SETROOTSURFACE,
00534         G_G2_SETSURFACEONOFF,
00535         G_G2_SETNEWORIGIN,
00536         G_G2_DOESBONEEXIST,
00537         G_G2_GETSURFACERENDERSTATUS,
00538 
00539         G_G2_ABSURDSMOOTHING,
00540 
00541 /*
00542         //rww - RAGDOLL_BEGIN
00543 */
00544         G_G2_SETRAGDOLL,
00545         G_G2_ANIMATEG2MODELS,
00546 /*
00547         //rww - RAGDOLL_END
00548 */
00549         //additional ragdoll options -rww
00550         G_G2_RAGPCJCONSTRAINT,
00551         G_G2_RAGPCJGRADIENTSPEED,
00552         G_G2_RAGEFFECTORGOAL,
00553         G_G2_GETRAGBONEPOS,
00554         G_G2_RAGEFFECTORKICK,
00555         G_G2_RAGFORCESOLVE,
00556 
00557         //rww - ik move method, allows you to specify a bone and move it to a world point (within joint constraints)
00558         //by using the majority of gil's existing bone angling stuff from the ragdoll code.
00559         G_G2_SETBONEIKSTATE,
00560         G_G2_IKMOVE,
00561 
00562         G_G2_REMOVEBONE,
00563 
00564         G_G2_ATTACHINSTANCETOENTNUM,
00565         G_G2_CLEARATTACHEDINSTANCE,
00566         G_G2_CLEANENTATTACHMENTS,
00567         G_G2_OVERRIDESERVER,
00568 
00569         G_G2_GETSURFACENAME,
00570 
00571         G_SET_ACTIVE_SUBBSP,
00572         G_CM_REGISTER_TERRAIN,
00573         G_RMG_INIT,
00574 
00575         G_BOT_UPDATEWAYPOINTS,
00576         G_BOT_CALCULATEPATHS
00577 /*
00578 Ghoul2 Insert End
00579 */
00580 
00581 } gameImport_t;
00582 
00583 //bstate.h
00584 typedef enum //# bState_e
00585 {//These take over only if script allows them to be autonomous
00586         BS_DEFAULT = 0,//# default behavior for that NPC
00587         BS_ADVANCE_FIGHT,//# Advance to captureGoal and shoot enemies if you can
00588         BS_SLEEP,//# Play awake script when startled by sound
00589         BS_FOLLOW_LEADER,//# Follow your leader and shoot any enemies you come across
00590         BS_JUMP,//# Face navgoal and jump to it.
00591         BS_SEARCH,//# Using current waypoint as a base, search the immediate branches of waypoints for enemies
00592         BS_WANDER,//# Wander down random waypoint paths
00593         BS_NOCLIP,//# Moves through walls, etc.
00594         BS_REMOVE,//# Waits for player to leave PVS then removes itself
00595         BS_CINEMATIC,//# Does nothing but face it's angles and move to a goal if it has one
00596         //# #eol
00597         //internal bStates only
00598         BS_WAIT,//# Does nothing but face it's angles
00599         BS_STAND_GUARD,
00600         BS_PATROL,
00601         BS_INVESTIGATE,//# head towards temp goal and look for enemies and listen for sounds
00602         BS_STAND_AND_SHOOT,
00603         BS_HUNT_AND_KILL,
00604         BS_FLEE,//# Run away!
00605         NUM_BSTATES
00606 } bState_t;
00607 
00608 enum
00609 {
00610         EDGE_NORMAL,
00611         EDGE_PATH,
00612         EDGE_BLOCKED,
00613         EDGE_FAILED,
00614         EDGE_MOVEDIR
00615 };
00616 
00617 enum
00618 {
00619         NODE_NORMAL,
00620         NODE_START,
00621         NODE_GOAL,
00622         NODE_NAVGOAL,
00623 };
00624 
00625 typedef enum //# taskID_e
00626 {
00627         TID_CHAN_VOICE = 0,     // Waiting for a voice sound to complete
00628         TID_ANIM_UPPER,         // Waiting to finish a lower anim holdtime
00629         TID_ANIM_LOWER,         // Waiting to finish a lower anim holdtime
00630         TID_ANIM_BOTH,          // Waiting to finish lower and upper anim holdtimes or normal md3 animating
00631         TID_MOVE_NAV,           // Trying to get to a navgoal or For ET_MOVERS
00632         TID_ANGLE_FACE,         // Turning to an angle or facing
00633         TID_BSTATE,                     // Waiting for a certain bState to finish
00634         TID_LOCATION,           // Waiting for ent to enter a specific trigger_location
00635 //      TID_MISSIONSTATUS,      // Waiting for player to finish reading MISSION STATUS SCREEN
00636         TID_RESIZE,                     // Waiting for clear bbox to inflate size
00637         TID_SHOOT,                      // Waiting for fire event
00638         NUM_TIDS,                       // for def of taskID array
00639 } taskID_t;
00640 
00641 typedef enum //# bSet_e
00642 {//This should check to matching a behavior state name first, then look for a script
00643         BSET_INVALID = -1,
00644         BSET_FIRST = 0,
00645         BSET_SPAWN = 0,//# script to use when first spawned
00646         BSET_USE,//# script to use when used
00647         BSET_AWAKE,//# script to use when awoken/startled
00648         BSET_ANGER,//# script to use when aquire an enemy
00649         BSET_ATTACK,//# script to run when you attack
00650         BSET_VICTORY,//# script to run when you kill someone
00651         BSET_LOSTENEMY,//# script to run when you can't find your enemy
00652         BSET_PAIN,//# script to use when take pain
00653         BSET_FLEE,//# script to use when take pain below 50% of health
00654         BSET_DEATH,//# script to use when killed
00655         BSET_DELAYED,//# script to run when self->delayScriptTime is reached
00656         BSET_BLOCKED,//# script to run when blocked by a friendly NPC or player
00657         BSET_BUMPED,//# script to run when bumped into a friendly NPC or player (can set bumpRadius)
00658         BSET_STUCK,//# script to run when blocked by a wall
00659         BSET_FFIRE,//# script to run when player shoots their own teammates
00660         BSET_FFDEATH,//# script to run when player kills a teammate
00661         BSET_MINDTRICK,//# script to run when player does a mind trick on this NPC
00662 
00663         NUM_BSETS
00664 } bSet_t;
00665 
00666 #define MAX_PARMS       16
00667 #define MAX_PARM_STRING_LENGTH  MAX_QPATH//was 16, had to lengthen it so they could take a valid file path
00668 typedef struct
00669 {       
00670         char    parm[MAX_PARMS][MAX_PARM_STRING_LENGTH];
00671 } parms_t;
00672 
00673 #define MAX_FAILED_NODES 8
00674 
00675 typedef struct Vehicle_s Vehicle_t;
00676 
00677 // the server looks at a sharedEntity, which is the start of the game's gentity_t structure
00678 //mod authors should not touch this struct
00679 typedef struct {
00680         entityState_t   s;                              // communicated by server to clients
00681         playerState_t   *playerState;   //needs to be in the gentity for bg entity access
00682                                                                         //if you want to actually see the contents I guess
00683                                                                         //you will have to be sure to VMA it first.
00684         Vehicle_t               *m_pVehicle; //vehicle data
00685         void                    *ghoul2; //g2 instance
00686         int                             localAnimIndex; //index locally (game/cgame) to anim data for this skel
00687         vec3_t                  modelScale; //needed for g2 collision
00688 
00689         //from here up must also be unified with bgEntity/centity
00690 
00691         entityShared_t  r;                              // shared by both the server system and game
00692 
00693         //Script/ICARUS-related fields
00694         int                             taskID[NUM_TIDS];
00695         parms_t                 *parms;
00696         char                    *behaviorSet[NUM_BSETS];
00697         char                    *script_targetname;
00698         int                             delayScriptTime;
00699         char                    *fullName;
00700 
00701         //rww - targetname and classname are now shared as well. ICARUS needs access to them.
00702         char                    *targetname;
00703         char                    *classname;                     // set in QuakeEd
00704 
00705         //rww - and yet more things to share. This is because the nav code is in the exe because it's all C++.
00706         int                             waypoint;                       //Set once per frame, if you've moved, and if someone asks
00707         int                             lastWaypoint;           //To make sure you don't double-back
00708         int                             lastValidWaypoint;      //ALWAYS valid -used for tracking someone you lost
00709         int                             noWaypointTime;         //Debouncer - so don't keep checking every waypoint in existance every frame that you can't find one
00710         int                             combatPoint;
00711         int                             failedWaypoints[MAX_FAILED_NODES];
00712         int                             failedWaypointCheckTime;
00713 
00714         int                             next_roff_time; //rww - npc's need to know when they're getting roff'd
00715 } sharedEntity_t;
00716 
00717 #ifdef __cplusplus
00718 class CSequencer;
00719 class CTaskManager;
00720 
00721 //I suppose this could be in another in-engine header or something. But we never want to
00722 //include an icarus file before sharedentity_t is declared.
00723 extern CSequencer       *gSequencers[MAX_GENTITIES];
00724 extern CTaskManager     *gTaskManagers[MAX_GENTITIES];
00725 
00726 #include "../icarus/icarus.h"
00727 #include "../icarus/sequencer.h"
00728 #include "../icarus/taskmanager.h"
00729 #endif
00730 
00731 //
00732 // functions exported by the game subsystem
00733 //
00734 typedef enum {
00735         GAME_INIT,      // ( int levelTime, int randomSeed, int restart );
00736         // init and shutdown will be called every single level
00737         // The game should call G_GET_ENTITY_TOKEN to parse through all the
00738         // entity configuration text and spawn gentities.
00739 
00740         GAME_SHUTDOWN,  // (void);
00741 
00742         GAME_CLIENT_CONNECT,    // ( int clientNum, qboolean firstTime, qboolean isBot );
00743         // return NULL if the client is allowed to connect, otherwise return
00744         // a text string with the reason for denial
00745 
00746         GAME_CLIENT_BEGIN,                              // ( int clientNum );
00747 
00748         GAME_CLIENT_USERINFO_CHANGED,   // ( int clientNum );
00749 
00750         GAME_CLIENT_DISCONNECT,                 // ( int clientNum );
00751 
00752         GAME_CLIENT_COMMAND,                    // ( int clientNum );
00753 
00754         GAME_CLIENT_THINK,                              // ( int clientNum );
00755 
00756         GAME_RUN_FRAME,                                 // ( int levelTime );
00757 
00758         GAME_CONSOLE_COMMAND,                   // ( void );
00759         // ConsoleCommand will be called when a command has been issued
00760         // that is not recognized as a builtin function.
00761         // The game can issue trap_argc() / trap_argv() commands to get the command
00762         // and parameters.  Return qfalse if the game doesn't recognize it as a command.
00763 
00764         BOTAI_START_FRAME,                              // ( int time );
00765 
00766         GAME_ROFF_NOTETRACK_CALLBACK,   // int entnum, char *notetrack
00767 
00768         GAME_SPAWN_RMG_ENTITY, //rwwRMG - added
00769 
00770         //rww - icarus callbacks
00771         GAME_ICARUS_PLAYSOUND,
00772         GAME_ICARUS_SET,
00773         GAME_ICARUS_LERP2POS,
00774         GAME_ICARUS_LERP2ORIGIN,
00775         GAME_ICARUS_LERP2ANGLES,
00776         GAME_ICARUS_GETTAG,
00777         GAME_ICARUS_LERP2START,
00778         GAME_ICARUS_LERP2END,
00779         GAME_ICARUS_USE,
00780         GAME_ICARUS_KILL,
00781         GAME_ICARUS_REMOVE,
00782         GAME_ICARUS_PLAY,
00783         GAME_ICARUS_GETFLOAT,
00784         GAME_ICARUS_GETVECTOR,
00785         GAME_ICARUS_GETSTRING,
00786         GAME_ICARUS_SOUNDINDEX,
00787         GAME_ICARUS_GETSETIDFORSTRING,
00788         GAME_NAV_CLEARPATHTOPOINT,
00789         GAME_NAV_CLEARLOS,
00790         GAME_NAV_CLEARPATHBETWEENPOINTS,
00791         GAME_NAV_CHECKNODEFAILEDFORENT,
00792         GAME_NAV_ENTISUNLOCKEDDOOR,
00793         GAME_NAV_ENTISDOOR,
00794         GAME_NAV_ENTISBREAKABLE,
00795         GAME_NAV_ENTISREMOVABLEUSABLE,
00796         GAME_NAV_FINDCOMBATPOINTWAYPOINTS,
00797         
00798         GAME_GETITEMINDEXBYTAG
00799 } gameExport_t;
00800 
00801 typedef struct
00802 {
00803         int taskID;
00804         int entID;
00805         char name[2048];
00806         char channel[2048];
00807 } T_G_ICARUS_PLAYSOUND;
00808 
00809 
00810 typedef struct
00811 {
00812         int taskID;
00813         int entID;
00814         char type_name[2048];
00815         char data[2048];
00816 } T_G_ICARUS_SET;
00817 
00818 typedef struct
00819 {
00820         int taskID;
00821         int entID; 
00822         vec3_t origin;
00823         vec3_t angles;
00824         float duration;
00825         qboolean nullAngles; //special case
00826 } T_G_ICARUS_LERP2POS;
00827 
00828 typedef struct
00829 {
00830         int taskID;
00831         int entID;
00832         vec3_t origin;
00833         float duration;
00834 } T_G_ICARUS_LERP2ORIGIN;
00835 
00836 typedef struct
00837 {
00838         int taskID;
00839         int entID;
00840         vec3_t angles;
00841         float duration;
00842 } T_G_ICARUS_LERP2ANGLES;
00843 
00844 typedef struct
00845 {
00846         int entID;
00847         char name[2048];
00848         int lookup;
00849         vec3_t info;
00850 } T_G_ICARUS_GETTAG;
00851 
00852 typedef struct
00853 {
00854         int entID;
00855         int taskID;
00856         float duration;
00857 } T_G_ICARUS_LERP2START;
00858 
00859 typedef struct
00860 {
00861         int entID;
00862         int taskID;
00863         float duration;
00864 } T_G_ICARUS_LERP2END;
00865 
00866 typedef struct
00867 {
00868         int entID;
00869         char target[2048];
00870 } T_G_ICARUS_USE;
00871 
00872 typedef struct
00873 {
00874         int entID;
00875         char name[2048];
00876 } T_G_ICARUS_KILL;
00877 
00878 typedef struct
00879 {
00880         int entID;
00881         char name[2048];
00882 } T_G_ICARUS_REMOVE;
00883 
00884 typedef struct
00885 {
00886         int taskID;
00887         int entID;
00888         char type[2048];
00889         char name[2048];
00890 } T_G_ICARUS_PLAY;
00891 
00892 typedef struct
00893 {
00894         int entID;
00895         int type;
00896         char name[2048];
00897         float value;
00898 } T_G_ICARUS_GETFLOAT;
00899 
00900 typedef struct
00901 {
00902         int entID;
00903         int type;
00904         char name[2048];
00905         vec3_t value;
00906 } T_G_ICARUS_GETVECTOR;
00907 
00908 typedef struct
00909 {
00910         int entID;
00911         int type;
00912         char name[2048];
00913         char value[2048];
00914 } T_G_ICARUS_GETSTRING;
00915 
00916 typedef struct
00917 {
00918         char filename[2048];
00919 } T_G_ICARUS_SOUNDINDEX;
00920 typedef struct
00921 {
00922         char string[2048];
00923 } T_G_ICARUS_GETSETIDFORSTRING;
00924 
00925 #endif //G_PUBLIC_H