From c8e3138029920df8314871e27f27fadfc4b2bcf8 Mon Sep 17 00:00:00 2001 From: Andrei Drexler Date: Sat, 4 May 2002 01:03:43 +0000 Subject: [PATCH] Bots --- reaction/game/ai_dmq3.c | 8 +++- reaction/game/ai_main.c | 19 +++++++++- reaction/game/g_items.c | 14 +++++++ reaction/game/g_spawn.c | 16 ++++++++ reaction/game/g_teamplay.c | 6 +++ reaction/game/game.plg | 75 +++++++++----------------------------- 6 files changed, 78 insertions(+), 60 deletions(-) diff --git a/reaction/game/ai_dmq3.c b/reaction/game/ai_dmq3.c index f2558aff..e29505a7 100644 --- a/reaction/game/ai_dmq3.c +++ b/reaction/game/ai_dmq3.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.26 2002/05/04 01:03:42 makro +// Bots +// // Revision 1.25 2002/05/03 18:09:19 makro // Bot stuff. Jump kicks // @@ -1583,10 +1586,11 @@ Added by Makro ================== */ void BotRQ3TPSeekGoals( bot_state_t *bs ) { +/* int firstBot = -1, firstHuman = -1, leader = -1, i; static int maxclients; - //if the bot already has a goal + //if the bot already has a goal if (bs->ltgtype || bs->ltg_time < FloatTime()) return; @@ -1633,7 +1637,7 @@ void BotRQ3TPSeekGoals( bot_state_t *bs ) { bs->ltgtype = LTG_TEAMACCOMPANY; bs->formation_dist = 3.5 * 32; //3.5 meter BotSetTeamStatus(bs); - +*/ return; } diff --git a/reaction/game/ai_main.c b/reaction/game/ai_main.c index 9477a2c4..84bf2d0e 100644 --- a/reaction/game/ai_main.c +++ b/reaction/game/ai_main.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.7 2002/05/04 01:03:42 makro +// Bots +// // Revision 1.6 2002/03/31 19:16:55 makro // Bandaging, reloading, opening rotating doors (still needs a lot of), shooting breakables // @@ -188,7 +191,12 @@ int BotAI_GetEntityState( int entityNum, entityState_t *state ) { memset( state, 0, sizeof(entityState_t) ); if (!ent->inuse) return qfalse; if (!ent->r.linked) return qfalse; - if (ent->r.svFlags & SVF_NOCLIENT) return qfalse; + //Makro - hack for bots + //if (ent->r.svFlags & SVF_NOCLIENT) return qfalse; + if (ent->r.svFlags & SVF_NOCLIENT) + if ( !(ent->s.eFlags & EF_NODRAW) ) + return qfalse; + //end Makro memcpy( state, &ent->s, sizeof(entityState_t) ); return qtrue; } @@ -1470,10 +1478,19 @@ int BotAIStartFrame(int time) { trap_BotLibUpdateEntity(i, NULL); continue; } + /* if (ent->r.svFlags & SVF_NOCLIENT) { trap_BotLibUpdateEntity(i, NULL); continue; + }*/ + //Makro - hack for bots + if (ent->r.svFlags & SVF_NOCLIENT) { + if ( !(ent->s.eFlags & EF_NODRAW) ) { + trap_BotLibUpdateEntity(i, NULL); + continue; + } } + //end Makro // do not update missiles if (ent->s.eType == ET_MISSILE) { trap_BotLibUpdateEntity(i, NULL); diff --git a/reaction/game/g_items.c b/reaction/game/g_items.c index c22c1fe8..5e93f627 100644 --- a/reaction/game/g_items.c +++ b/reaction/game/g_items.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.35 2002/05/04 01:03:43 makro +// Bots +// // Revision 1.34 2002/04/30 01:23:05 jbravo // Changed the server logging to be more like a normal AQ server. Cleaned // all colors from the logs. @@ -1144,6 +1147,17 @@ void FinishSpawningItem( gentity_t *ent ) { return; } + //Makro - for bots and TP + if (ent != NULL) { + if (ent->item != NULL) { + if (ent->item->giType == IT_WEAPON || ent->item->giType == IT_AMMO) { + if (g_gametype.integer == GT_TEAMPLAY) { + ent->r.svFlags |= SVF_NOCLIENT; + ent->s.eFlags |= EF_NODRAW; + } + } + } + } trap_LinkEntity (ent); } diff --git a/reaction/game/g_spawn.c b/reaction/game/g_spawn.c index 5f5be17e..75af9028 100644 --- a/reaction/game/g_spawn.c +++ b/reaction/game/g_spawn.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.22 2002/05/04 01:03:43 makro +// Bots +// // Revision 1.21 2002/05/02 23:05:25 makro // Loading screen. Jump kicks. Bot stuff // @@ -421,6 +424,7 @@ qboolean G_CallSpawn( gentity_t *ent ) { // check item spawn functions // JBravo: No weapons and items on the maps in teamplay + /* if (g_gametype.integer != GT_TEAMPLAY) { for ( item=bg_itemlist+1 ; item->classname ; item++ ) { if ( !strcmp(item->classname, ent->classname) ) { @@ -428,6 +432,18 @@ qboolean G_CallSpawn( gentity_t *ent ) { return qtrue; } } + }*/ + //Makro - new code + for ( item=bg_itemlist+1 ; item->classname ; item++ ) { + if ( !strcmp(item->classname, ent->classname) ) { + G_SpawnItem( ent, item ); + /* + if (g_gametype.integer == GT_TEAMPLAY) { + ent->r.svFlags |= SVF_NOCLIENT; + ent->s.eFlags |= EF_NODRAW; + }*/ + return qtrue; + } } // check normal spawn functions diff --git a/reaction/game/g_teamplay.c b/reaction/game/g_teamplay.c index e80714e6..c56c90c6 100644 --- a/reaction/game/g_teamplay.c +++ b/reaction/game/g_teamplay.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.74 2002/05/04 01:03:43 makro +// Bots +// // Revision 1.73 2002/05/02 00:02:19 jbravo // Added a fix for the incorrect weapon at spawns // @@ -461,6 +464,9 @@ void CleanLevel() continue; if (!ent->item) continue; + //Makro - added this for bots + if (ent->r.svFlags & SVF_NOCLIENT) + continue; if (ent->item->giType == IT_WEAPON) { switch (ent->item->giTag) { case WP_MP5: diff --git a/reaction/game/game.plg b/reaction/game/game.plg index 3c708fb8..2068eb59 100644 --- a/reaction/game/game.plg +++ b/reaction/game/game.plg @@ -3,71 +3,32 @@
 

Build Log

+--------------------Configuration: cgame - Win32 Release-------------------- +

+

Command Lines

+ + + +

Results

+cgamex86.dll - 0 error(s), 0 warning(s) +

--------------------Configuration: game - Win32 Release--------------------

Command Lines

-Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP22B0.tmp" with contents -[ -/nologo /G6 /ML /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FR"c:\reactionoutput/" /Fp"c:\reactionoutput/game.pch" /YX /Fo"c:\reactionoutput/" /Fd"c:\reactionoutput/" /FD /c -"C:\Games\Quake3\rq3source\reaction\game\ai_dmq3.c" -"C:\Games\Quake3\rq3source\reaction\game\ai_team.c" -] -Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP22B0.tmp" -Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP22B1.tmp" with contents -[ -kernel32.lib user32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows /dll /incremental:no /pdb:"c:\reactionoutput/qagamex86.pdb" /map:"c:\reactionoutput/qagamex86.map" /machine:I386 /def:".\game.def" /out:"..\Release/qagamex86.dll" /implib:"c:\reactionoutput/qagamex86.lib" -\reactionoutput\ai_chat.obj -\reactionoutput\ai_cmd.obj -\reactionoutput\ai_dmnet.obj -\reactionoutput\ai_dmq3.obj -\reactionoutput\ai_main.obj -\reactionoutput\ai_team.obj -\reactionoutput\ai_vcmd.obj -\reactionoutput\bg_misc.obj -\reactionoutput\bg_pmove.obj -\reactionoutput\bg_slidemove.obj -\reactionoutput\g_active.obj -\reactionoutput\g_arenas.obj -\reactionoutput\g_bot.obj -\reactionoutput\g_client.obj -\reactionoutput\g_cmds.obj -\reactionoutput\g_combat.obj -\reactionoutput\g_fileio.obj -\reactionoutput\g_items.obj -\reactionoutput\g_main.obj -\reactionoutput\g_matchmode.obj -\reactionoutput\g_mem.obj -\reactionoutput\g_misc.obj -\reactionoutput\g_missile.obj -\reactionoutput\g_mover.obj -\reactionoutput\g_session.obj -\reactionoutput\g_spawn.obj -\reactionoutput\g_svcmds.obj -\reactionoutput\g_syscalls.obj -\reactionoutput\g_target.obj -\reactionoutput\g_team.obj -\reactionoutput\g_teamplay.obj -\reactionoutput\g_trigger.obj -\reactionoutput\g_utils.obj -\reactionoutput\g_weapon.obj -\reactionoutput\q_math.obj -\reactionoutput\q_shared.obj -\reactionoutput\rxn_game.obj -\reactionoutput\zcam.obj -\reactionoutput\zcam_target.obj -] -Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP22B1.tmp" -

Output Window

-Compiling... -ai_dmq3.c -ai_team.c -Linking... - Creating library c:\reactionoutput/qagamex86.lib and object c:\reactionoutput/qagamex86.exp

Results

qagamex86.dll - 0 error(s), 0 warning(s) +

+--------------------Configuration: ui - Win32 Release TA-------------------- +

+

Command Lines

+ + + +

Results

+uix86.dll - 0 error(s), 0 warning(s)