Spectators can go through breakables and doors with

a targetname or health. Bots should crouch more/jump less
often when attacking at long range
This commit is contained in:
Andrei Drexler 2002-05-11 12:45:25 +00:00
parent 8f12a44cfb
commit df30da7f76
5 changed files with 59 additions and 27 deletions

View File

@ -5,6 +5,11 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.31 2002/05/11 12:45:25 makro
// Spectators can go through breakables and doors with
// a targetname or health. Bots should crouch more/jump less
// often when attacking at long range
//
// Revision 1.30 2002/05/10 13:21:53 makro
// Mainly bot stuff. Also fixed a couple of crash bugs
//
@ -331,18 +336,14 @@ Added by Makro
*/
void BotMoveTowardsEnt(bot_state_t *bs, vec3_t dest, int dist) {
vec3_t dir;
/*
VectorTargetDist(bs->origin, dest, dist, dir);
//dir[2] = bs->origin[2];
/*
if (bot_developer.integer == 2) {
G_Printf(va("^5BOT CODE: ^7Moving from (%i %i %i) towards entity at (%i %i %i) up to (%i %i %i)\n",
(int) bs->origin[0], (int) bs->origin[1], (int) bs->origin[2],
(int) dest[0], (int) dest[1], (int) dest[2],
(int) dir[0], (int) dir[1], (int) dir[2]));
}
*/
BotMoveTo(bs, dir);
*/
VectorSubtract(dest, bs->origin, dir);
VectorNormalize(dir);
trap_BotMoveInDirection(bs->ms, dir, 400, MOVE_WALK);
}
/*
@ -3230,6 +3231,11 @@ bot_moveresult_t BotAttackMove(bot_state_t *bs, int tfl) {
VectorSubtract(entinfo.origin, bs->origin, forward);
//the distance towards the enemy
dist = VectorNormalize(forward);
//Makro - for long range attacks the bots should crouch more often
if (dist > 512) {
croucher = Com_Clamp(0, 1, croucher * 2.0f);
jumper = Com_Clamp(0, 1, jumper / 2.0f);
}
VectorNegate(forward, backward);
//walk, crouch or jump
movetype = MOVE_WALK;

View File

@ -5,6 +5,11 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.37 2002/05/11 12:45:25 makro
// Spectators can go through breakables and doors with
// a targetname or health. Bots should crouch more/jump less
// often when attacking at long range
//
// Revision 1.36 2002/05/11 00:38:47 blaze
// trigger_push and target_push default to no noise when the noise flag is not set.
//
@ -78,6 +83,8 @@
extern char rq3_breakables[RQ3_MAX_BREAKABLES][80];
void G_ExplodeMissile( gentity_t *ent );
//Makro - added
void Think_SpawnNewDoorTrigger( gentity_t *ent );
/*QUAKED func_group (0 0 0) ?
Used to group brushes together just for editor convenience. They are turned into normal brushes by the utilities.
@ -638,6 +645,10 @@ void SP_func_breakable( gentity_t *ent ) {
ent->s.modelindex2 = G_ModelIndex( ent->model2 );
}
//Makro - added this so spectators can go through breakables
ent->nextthink = level.time + FRAMETIME;
ent->think = Think_SpawnNewDoorTrigger;
trap_LinkEntity (ent);
}

View File

@ -5,6 +5,11 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.28 2002/05/11 12:45:25 makro
// Spectators can go through breakables and doors with
// a targetname or health. Bots should crouch more/jump less
// often when attacking at long range
//
// Revision 1.27 2002/05/11 00:38:47 blaze
// trigger_push and target_push default to no noise when the noise flag is not set.
//
@ -1300,6 +1305,7 @@ void Think_SpawnNewDoorTrigger( gentity_t *ent ) {
mins[1] += 60;
}
other = G_Spawn ();
other->classname = "door_trigger_spectator";
VectorCopy (mins, other->r.mins);
@ -1451,12 +1457,14 @@ void SP_func_door (gentity_t *ent) {
if ( health ) {
ent->takedamage = qtrue;
}
if ( ent->targetname || health ) {
// non touch/shoot doors
ent->think = Think_MatchTeam;
} else {
//Makro - spectators should be able to go through doors with health/targetname
//plus, MatchTeam is called in the end, anyway
// if ( ent->targetname || health ) {
// // non touch/shoot doors
// ent->think = Think_MatchTeam;
// } else {
ent->think = Think_SpawnNewDoorTrigger;
}
// }
}
//Elder: open areaportals for start_open doors
@ -1597,12 +1605,14 @@ void SP_func_door_rotating ( gentity_t *ent ) {
if ( health ) {
ent->takedamage = qtrue;
}
if ( ent->targetname || health ) {
// non touch/shoot doors
ent->think = Think_MatchTeam;
} else {
//Makro - spectators should be able to go through doors with health/targetname
//plus, MatchTeam is called in the end, anyway
// if ( ent->targetname || health ) {
// // non touch/shoot doors
// ent->think = Think_MatchTeam;
// } else {
ent->think = Think_SpawnNewDoorTrigger;
}
// }
}
}

View File

@ -5,6 +5,11 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.25 2002/05/11 12:45:25 makro
// Spectators can go through breakables and doors with
// a targetname or health. Bots should crouch more/jump less
// often when attacking at long range
//
// Revision 1.24 2002/05/05 15:18:02 makro
// Fixed some crash bugs. Bot stuff. Triggerable func_statics.
// Made flags only spawn in CTF mode
@ -755,11 +760,11 @@ void SP_worldspawn( void ) {
trap_SetConfigstring( CS_MESSAGE, s ); // map specific message
//Makro - color for the loading screen text
G_SpawnVector( "_color", "0.75 0.75 0.75", color );
G_SpawnVector( "_text_color", "0.75 0.75 0.75", color );
Info_SetValueForKey(info, "r1", va("%f", color[0]));
Info_SetValueForKey(info, "g1", va("%f", color[1]));
Info_SetValueForKey(info, "b1", va("%f", color[2]));
G_SpawnVector( "_color2", "1 1 1", color );
G_SpawnVector( "_text_color2", "1 1 1", color );
Info_SetValueForKey(info, "r2", va("%f", color[0]));
Info_SetValueForKey(info, "g2", va("%f", color[1]));
Info_SetValueForKey(info, "b2", va("%f", color[2]));

View File

@ -6,13 +6,13 @@
--------------------Configuration: game - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP1AC.tmp" with contents
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP235.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_dmnet.c"
"C:\Games\Quake3\rq3source\reaction\game\ai_dmq3.c"
]
Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP1AC.tmp"
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP1AD.tmp" with contents
Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP235.tmp"
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP236.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
@ -55,10 +55,10 @@ kernel32.lib user32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows
\reactionoutput\zcam.obj
\reactionoutput\zcam_target.obj
]
Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP1AD.tmp"
Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP236.tmp"
<h3>Output Window</h3>
Compiling...
ai_dmnet.c
ai_dmq3.c
Linking...
Creating library c:\reactionoutput/qagamex86.lib and object c:\reactionoutput/qagamex86.exp