Bot stuff. Other stuff. Just... stuff :p

This commit is contained in:
Andrei Drexler 2002-05-18 14:52:16 +00:00
parent bf037e303f
commit e621dab25f
8 changed files with 94 additions and 39 deletions

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.34 2002/05/18 14:52:16 makro
// Bot stuff. Other stuff. Just... stuff :p
//
// Revision 1.33 2002/05/11 19:18:20 makro
// Sand surfaceparm
//
@ -4866,7 +4869,9 @@ int BotGetActivateGoal(bot_state_t *bs, int entitynum, bot_activategoal_t *activ
return 0;
}
//if it is a door
if (!strcmp(classname, "func_door")) {
//Makro - or a door_rotating
if (!strcmp(classname, "func_door") || !strcmp(classname, "func_door_rotating")) {
qboolean rotating = (strcmp(classname, "func_door_rotating") == 0);
if (trap_AAS_FloatForBSPEpairKey(ent, "health", &health)) {
//if the door has health then the door must be shot to open
if (health) {
@ -4877,28 +4882,28 @@ int BotGetActivateGoal(bot_state_t *bs, int entitynum, bot_activategoal_t *activ
//
trap_AAS_IntForBSPEpairKey(ent, "spawnflags", &spawnflags);
// if the door starts open then just wait for the door to return
if ( spawnflags & 1 )
// Makro - only if toggle is not set
if ( (spawnflags & 1) && !(spawnflags & 8) )
return 0;
//get the door origin
if (!trap_AAS_VectorForBSPEpairKey(ent, "origin", origin)) {
VectorClear(origin);
}
//if the door is open or opening already
//Makro - different code for rotating doors
if (!rotating) {
if (!VectorCompare(origin, entinfo.origin))
return 0;
} else {
if (g_entities[entinfo.number].moverState == ROTATOR_1TO2 || g_entities[entinfo.number].moverState == ROTATOR_2TO1)
return 0;
}
// store all the areas the door is in
trap_AAS_ValueForBSPEpairKey(ent, "model", model, sizeof(model));
if (*model) {
modelindex = atoi(model+1);
if (modelindex) {
VectorClear(angles);
//Makro - this should help
Cmd_OpenDoor( &g_entities[bs->entitynum] );
/*
if (bot_developer.integer == 2) {
G_Printf("^5BOT CODE: ^7Blocked by a sliding door\n");
}
*/
BotModelMinsMaxs(modelindex, ET_MOVER, 0, absmins, absmaxs);
//
numareas = trap_AAS_BBoxAreas(absmins, absmaxs, areas, MAX_ACTIVATEAREAS*2);
@ -4927,27 +4932,35 @@ int BotGetActivateGoal(bot_state_t *bs, int entitynum, bot_activategoal_t *activ
}
}
}
//Makro - open the door
if (!g_entities[entinfo.number].targetname) {
if (!rotating) {
Cmd_OpenDoor( &g_entities[bs->entitynum] );
return 0;
} else {
BotMoveTowardsEnt(bs, entinfo.origin, -80);
//BotFuncDoorRotatingActivateGoal(bs, ent, activategoal);
Cmd_OpenDoor( &g_entities[bs->entitynum] );
return 0;
}
}
}
}
//if it is some glass
if (!strcmp(classname, "func_breakable")) {
BotFuncBreakableGoal(bs, ent, activategoal);
//disable all areas the blocking entity is in
BotEnableActivateGoalAreas( activategoal, qfalse );
//nothing the bot can do to unbreakable glass
if (g_entities[entinfo.number].unbreakable)
return 0;
if (!g_entities[entinfo.number].targetname) {
BotFuncBreakableGoal(bs, ent, activategoal);
return ent;
}
}
/* Handled above now
//Makro - checking for rotating doors
if ( !strcmp(classname, "func_door_rotating") ) {
/*
if (bot_developer.integer == 2) {
G_Printf("^5BOT CODE: ^7Blocked by a rotating door\n");
}
*/
/*if ( trap_AAS_AreaReachability(bs->areanum) ) {
// disable all areas the blocking entity is in
BotEnableActivateGoalAreas( activategoal, qfalse );
}
*/
//if door is moving, wait till it stops
if ( g_entities[entitynum].moverState == ROTATOR_1TO2 || g_entities[entitynum].moverState == ROTATOR_2TO1 || (g_entities[entitynum].targetname) ) {
BotMoveTowardsEnt(bs, entinfo.origin, -80);
@ -4961,7 +4974,7 @@ int BotGetActivateGoal(bot_state_t *bs, int entitynum, bot_activategoal_t *activ
BotEnableActivateGoalAreas( activategoal, qfalse );
return ent;
}
}
}*/
// if the bot is blocked by or standing on top of a button
if (!strcmp(classname, "func_button")) {
return 0;

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.9 2002/05/18 14:52:16 makro
// Bot stuff. Other stuff. Just... stuff :p
//
// Revision 1.8 2002/05/04 16:13:04 makro
// Bots
//
@ -1486,9 +1489,9 @@ int BotAIStartFrame(int time) {
trap_BotLibUpdateEntity(i, NULL);
continue;
}*/
//Makro - hack for bots
//Makro - hack for bots !
if (ent->r.svFlags & SVF_NOCLIENT) {
if ( !(ent->r.svFlags & SVF_BOTHACK) ) {
if ( !(ent->r.svFlags & SVF_BOTHACK) || ent->nextthink > level.time) {
trap_BotLibUpdateEntity(i, NULL);
continue;
}

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.14 2002/05/18 14:52:16 makro
// Bot stuff. Other stuff. Just... stuff :p
//
// Revision 1.13 2002/05/07 05:06:56 niceass
// physics tweaks
//
@ -132,7 +135,10 @@ qboolean PM_SlideMove( qboolean gravity ) {
if (numplanes >= MAX_CLIP_PLANES) {
// this shouldn't really happen
// Makro - yet it does ! - added ifdef
#ifdef DEBUG
Com_Printf("DEBUG: MAX_CLIP_PLANES\n");
#endif
VectorClear( pm->ps->velocity );
return qtrue;
}

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.77 2002/05/18 14:52:16 makro
// Bot stuff. Other stuff. Just... stuff :p
//
// Revision 1.76 2002/05/16 06:57:54 makro
// Doors with health (again !), bot-only trigger_pushes
//
@ -1910,15 +1913,17 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
// Makro - we should change some more stuff in here
// shootable doors / buttons don't actually have any health
if ( targ->s.eType == ET_MOVER && targ->health < 0) {
if ( targ->use && (targ->moverState == MOVER_POS1 || targ->moverState == ROTATOR_POS1) ) {
if ( targ->use && (targ->moverState == MOVER_POS1 || targ->moverState == ROTATOR_POS1 || (targ->spawnflags & 8)) ) {
targ->use( targ, inflictor, attacker );
}
/*
//use the targets of the team master
if (targ->teammaster && targ->teammaster != targ) {
G_UseTargets(targ->teammaster, attacker);
}
//use own targets
G_UseTargets(targ, attacker);
*/
return;
}

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.37 2002/05/18 14:52:16 makro
// Bot stuff. Other stuff. Just... stuff :p
//
// Revision 1.36 2002/05/04 16:13:04 makro
// Bots
//
@ -620,9 +623,13 @@ void Touch_Item (gentity_t *ent, gentity_t *other, trace_t *trace) {
if (other->health < 1)
return; // dead people can't pickup
//Makro - if the item is not sent to the client, picking it up would be kinda odd
if (ent->r.svFlags & SVF_NOCLIENT) {
//G_Printf("^1Reached SVF_NOCLIENT item\n");
//Makro - even more bot hacks !
//this way, we can remove the item from the bot's library for a few seconds
//so bots won't get stuck in a loop between 2 items
if ((ent->r.svFlags & MASK_BOTHACK) == MASK_BOTHACK) {
if (ent->nextthink < level.time) {
ent->nextthink = level.time + 45 * 1000;
}
return;
}

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.14 2002/05/18 14:52:16 makro
// Bot stuff. Other stuff. Just... stuff :p
//
// Revision 1.13 2002/05/16 06:57:54 makro
// Doors with health (again !), bot-only trigger_pushes
//
@ -231,7 +234,10 @@ void SP_trigger_push( gentity_t *self ) {
self->s.generic1 = G_SoundIndex( sound );
}
//Makro - for bot-only triggers
if ( !(self->spawnflags & 1) ) {
self->r.svFlags &= ~SVF_NOCLIENT;
}
self->s.eType = ET_PUSH_TRIGGER;
self->touch = trigger_push_touch;
self->think = AimAtTarget;

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.57 2002/05/18 14:52:16 makro
// Bot stuff. Other stuff. Just... stuff :p
//
// Revision 1.56 2002/05/12 22:14:13 makro
// Impact sounds
//
@ -2631,6 +2634,8 @@ void Laser_Think( gentity_t *self )
trace_t tr; //, tr2;
int l=0, passent;
gentity_t *traceEnt;
//Makro - added
int contents;
//If the player dies, is spectator, or wrong weapon, kill the dot
if (self->parent->client->ps.pm_type == PM_DEAD ||
@ -2679,6 +2684,16 @@ void Laser_Think( gentity_t *self )
//Makro - new surfaceparm system
//if (!(tr.surfaceFlags & SURF_GLASS)) break;
if (!(GetMaterialFromFlag(tr.surfaceFlags) == MAT_GLASS)) break;
/*
//Makro - don't go through brushes that aren't detail/trans
//contents = trap_PointContents(tr.endpos, -1);
contents = tr.contents;
if (contents & CONTENTS_SOLID) {
if ( !(contents & (CONTENTS_TRANSLUCENT | CONTENTS_DETAIL)) ) {
break;
}
}
*/
VectorMA(tr.endpos, 10, forward, start); // Nudge it forward a little bit
}

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\RSP73.tmp" with contents
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP169.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\g_combat.c"
"C:\Games\Quake3\rq3source\reaction\game\ai_dmq3.c"
]
Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP73.tmp"
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP74.tmp" with contents
Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP169.tmp"
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP16A.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\RSP74.tmp"
Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP16A.tmp"
<h3>Output Window</h3>
Compiling...
g_combat.c
ai_dmq3.c
Linking...
Creating library c:\reactionoutput/qagamex86.lib and object c:\reactionoutput/qagamex86.exp