mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2025-02-18 10:02:50 +00:00
Bots should reload/bandage when roaming around
Added "pathtarget" key to all the entities
This commit is contained in:
parent
0042ba64b6
commit
bc0cded7bf
11 changed files with 163 additions and 100 deletions
|
@ -5,6 +5,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.26 2002/05/30 21:18:28 makro
|
||||||
|
// Bots should reload/bandage when roaming around
|
||||||
|
// Added "pathtarget" key to all the entities
|
||||||
|
//
|
||||||
// Revision 1.25 2002/05/11 14:22:06 makro
|
// Revision 1.25 2002/05/11 14:22:06 makro
|
||||||
// Func_statics now reset at the beginning of each round
|
// Func_statics now reset at the beginning of each round
|
||||||
//
|
//
|
||||||
|
@ -1780,15 +1784,9 @@ AIEnter_Seek_ActivateEntity
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
void AIEnter_Seek_ActivateEntity(bot_state_t *bs, char *s) {
|
void AIEnter_Seek_ActivateEntity(bot_state_t *bs, char *s) {
|
||||||
int damage = RQ3_Bot_NeedToBandage(bs);
|
|
||||||
|
|
||||||
BotRecordNodeSwitch(bs, "activate entity", "", s);
|
BotRecordNodeSwitch(bs, "activate entity", "", s);
|
||||||
//Makro - check if the bot needs to bandage
|
//Makro - check if the bot needs to reload/bandage
|
||||||
if (damage == 2 || ((damage == 1) && RQ3_Bot_CheckBandage(bs))) {
|
RQ3_Bot_IdleActions(bs);
|
||||||
if (bs->cur_ps.weaponstate != WEAPON_BANDAGING) {
|
|
||||||
Cmd_Bandage( &g_entities[bs->entitynum] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bs->ainode = AINode_Seek_ActivateEntity;
|
bs->ainode = AINode_Seek_ActivateEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2030,7 +2028,6 @@ AIEnter_Seek_NBG
|
||||||
void AIEnter_Seek_NBG(bot_state_t *bs, char *s) {
|
void AIEnter_Seek_NBG(bot_state_t *bs, char *s) {
|
||||||
bot_goal_t goal;
|
bot_goal_t goal;
|
||||||
char buf[144];
|
char buf[144];
|
||||||
int damage = RQ3_Bot_NeedToBandage(bs);
|
|
||||||
|
|
||||||
if (trap_BotGetTopGoal(bs->gs, &goal)) {
|
if (trap_BotGetTopGoal(bs->gs, &goal)) {
|
||||||
trap_BotGoalName(goal.number, buf, 144);
|
trap_BotGoalName(goal.number, buf, 144);
|
||||||
|
@ -2039,13 +2036,8 @@ void AIEnter_Seek_NBG(bot_state_t *bs, char *s) {
|
||||||
else {
|
else {
|
||||||
BotRecordNodeSwitch(bs, "seek NBG", "no goal", s);
|
BotRecordNodeSwitch(bs, "seek NBG", "no goal", s);
|
||||||
}
|
}
|
||||||
//Makro - check if the bot needs to bandage
|
//Makro - check if the bot needs to reload/bandage
|
||||||
if (damage == 2 || ((damage == 1) && RQ3_Bot_CheckBandage(bs))) {
|
RQ3_Bot_IdleActions(bs);
|
||||||
if (bs->cur_ps.weaponstate != WEAPON_BANDAGING) {
|
|
||||||
Cmd_Bandage( &g_entities[bs->entitynum] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bs->ainode = AINode_Seek_ActivateEntity;
|
|
||||||
bs->ainode = AINode_Seek_NBG;
|
bs->ainode = AINode_Seek_NBG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2084,6 +2076,10 @@ int AINode_Seek_NBG(bot_state_t *bs) {
|
||||||
}
|
}
|
||||||
//map specific code
|
//map specific code
|
||||||
BotMapScripts(bs);
|
BotMapScripts(bs);
|
||||||
|
|
||||||
|
//Makro - check if the bot needs to reload/bandage
|
||||||
|
RQ3_Bot_IdleActions(bs);
|
||||||
|
|
||||||
//no enemy
|
//no enemy
|
||||||
bs->enemy = -1;
|
bs->enemy = -1;
|
||||||
//if the bot has no goal
|
//if the bot has no goal
|
||||||
|
@ -2171,8 +2167,6 @@ AIEnter_Seek_LTG
|
||||||
void AIEnter_Seek_LTG(bot_state_t *bs, char *s) {
|
void AIEnter_Seek_LTG(bot_state_t *bs, char *s) {
|
||||||
bot_goal_t goal;
|
bot_goal_t goal;
|
||||||
char buf[144];
|
char buf[144];
|
||||||
int damage = RQ3_Bot_NeedToBandage(bs);
|
|
||||||
|
|
||||||
if (trap_BotGetTopGoal(bs->gs, &goal)) {
|
if (trap_BotGetTopGoal(bs->gs, &goal)) {
|
||||||
trap_BotGoalName(goal.number, buf, 144);
|
trap_BotGoalName(goal.number, buf, 144);
|
||||||
BotRecordNodeSwitch(bs, "seek LTG", buf, s);
|
BotRecordNodeSwitch(bs, "seek LTG", buf, s);
|
||||||
|
@ -2180,12 +2174,8 @@ void AIEnter_Seek_LTG(bot_state_t *bs, char *s) {
|
||||||
else {
|
else {
|
||||||
BotRecordNodeSwitch(bs, "seek LTG", "no goal", s);
|
BotRecordNodeSwitch(bs, "seek LTG", "no goal", s);
|
||||||
}
|
}
|
||||||
//Makro - check if the bot needs to bandage
|
//Makro - check if the bot needs to reload/bandage
|
||||||
if (damage == 2 || ((damage == 1) && RQ3_Bot_CheckBandage(bs))) {
|
RQ3_Bot_IdleActions(bs);
|
||||||
if (bs->cur_ps.weaponstate != WEAPON_BANDAGING) {
|
|
||||||
Cmd_Bandage( &g_entities[bs->entitynum] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bs->ainode = AINode_Seek_LTG;
|
bs->ainode = AINode_Seek_LTG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2234,6 +2224,10 @@ int AINode_Seek_LTG(bot_state_t *bs)
|
||||||
}
|
}
|
||||||
//map specific code
|
//map specific code
|
||||||
BotMapScripts(bs);
|
BotMapScripts(bs);
|
||||||
|
|
||||||
|
//Makro - check if the bot needs to reload/bandage
|
||||||
|
RQ3_Bot_IdleActions(bs);
|
||||||
|
|
||||||
//no enemy
|
//no enemy
|
||||||
bs->enemy = -1;
|
bs->enemy = -1;
|
||||||
//
|
//
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.38 2002/05/30 21:18:28 makro
|
||||||
|
// Bots should reload/bandage when roaming around
|
||||||
|
// Added "pathtarget" key to all the entities
|
||||||
|
//
|
||||||
// Revision 1.37 2002/05/27 06:47:22 niceass
|
// Revision 1.37 2002/05/27 06:47:22 niceass
|
||||||
// removed some kamakazi stuff
|
// removed some kamakazi stuff
|
||||||
//
|
//
|
||||||
|
@ -2297,7 +2301,9 @@ void BotUpdateInventory(bot_state_t *bs) {
|
||||||
memcpy(oldinventory, bs->inventory, sizeof(oldinventory));
|
memcpy(oldinventory, bs->inventory, sizeof(oldinventory));
|
||||||
//armor
|
//armor
|
||||||
bs->inventory[INVENTORY_ARMOR] = bs->cur_ps.stats[STAT_ARMOR];
|
bs->inventory[INVENTORY_ARMOR] = bs->cur_ps.stats[STAT_ARMOR];
|
||||||
//weapons
|
|
||||||
|
// WEAPONS //
|
||||||
|
|
||||||
//Blaze: Reaction Weapons
|
//Blaze: Reaction Weapons
|
||||||
bs->inventory[INVENTORY_KNIFE] = (bs->cur_ps.stats[STAT_WEAPONS] & (1 << WP_KNIFE)) != 0;
|
bs->inventory[INVENTORY_KNIFE] = (bs->cur_ps.stats[STAT_WEAPONS] & (1 << WP_KNIFE)) != 0;
|
||||||
bs->inventory[INVENTORY_PISTOL] = (bs->cur_ps.stats[STAT_WEAPONS] & (1 << WP_PISTOL)) != 0;
|
bs->inventory[INVENTORY_PISTOL] = (bs->cur_ps.stats[STAT_WEAPONS] & (1 << WP_PISTOL)) != 0;
|
||||||
|
@ -2308,30 +2314,48 @@ void BotUpdateInventory(bot_state_t *bs) {
|
||||||
bs->inventory[INVENTORY_M3] = (bs->cur_ps.stats[STAT_WEAPONS] & (1 << WP_M3)) != 0;
|
bs->inventory[INVENTORY_M3] = (bs->cur_ps.stats[STAT_WEAPONS] & (1 << WP_M3)) != 0;
|
||||||
bs->inventory[INVENTORY_AKIMBO] = (bs->cur_ps.stats[STAT_WEAPONS] & (1 << WP_AKIMBO)) != 0;
|
bs->inventory[INVENTORY_AKIMBO] = (bs->cur_ps.stats[STAT_WEAPONS] & (1 << WP_AKIMBO)) != 0;
|
||||||
bs->inventory[INVENTORY_GRENADE] = (bs->cur_ps.stats[STAT_WEAPONS] & (1 << WP_GRENADE)) != 0;
|
bs->inventory[INVENTORY_GRENADE] = (bs->cur_ps.stats[STAT_WEAPONS] & (1 << WP_GRENADE)) != 0;
|
||||||
//ammo
|
|
||||||
|
// CLIPS //
|
||||||
|
|
||||||
|
//Makro - adding clip info
|
||||||
|
//Note - this stuff is also added to the ammo info, so bots know they still have ammo for their guns
|
||||||
|
bs->inventory[INVENTORY_KNIFECLIP] = ent->client->numClips[WP_KNIFE];
|
||||||
|
bs->inventory[INVENTORY_PISTOLCLIP] = ent->client->numClips[WP_PISTOL];
|
||||||
|
bs->inventory[INVENTORY_M3CLIP] = ent->client->numClips[WP_M3];
|
||||||
|
bs->inventory[INVENTORY_SSG3000CLIP] = ent->client->numClips[WP_SSG3000];
|
||||||
|
bs->inventory[INVENTORY_MP5CLIP] = ent->client->numClips[WP_MP5];
|
||||||
|
bs->inventory[INVENTORY_M4CLIP] = ent->client->numClips[WP_M4];
|
||||||
|
amt = ent->client->numClips[WP_HANDCANNON];
|
||||||
|
if (amt < 2)
|
||||||
|
amt = 0;
|
||||||
|
bs->inventory[INVENTORY_HANDCANNONCLIP] = amt;
|
||||||
|
amt = ent->client->numClips[WP_AKIMBO];
|
||||||
|
if (amt < 2)
|
||||||
|
amt = 0;
|
||||||
|
bs->inventory[INVENTORY_AKIMBOCLIP] = amt;
|
||||||
|
bs->inventory[INVENTORY_GRENADECLIP] = ent->client->numClips[WP_GRENADE];
|
||||||
|
|
||||||
|
// AMMO //
|
||||||
|
|
||||||
//Makro - clips should be taken into account
|
//Makro - clips should be taken into account
|
||||||
bs->inventory[INVENTORY_PISTOLAMMO] = bs->cur_ps.ammo[WP_PISTOL] + ent->client->numClips[WP_PISTOL] * RQ3_PISTOL_CLIP;
|
bs->inventory[INVENTORY_PISTOLAMMO] = bs->cur_ps.ammo[WP_PISTOL] + bs->inventory[INVENTORY_PISTOLCLIP] * RQ3_PISTOL_CLIP;
|
||||||
bs->inventory[INVENTORY_KNIFEAMMO] = bs->cur_ps.ammo[WP_KNIFE];
|
bs->inventory[INVENTORY_KNIFEAMMO] = bs->cur_ps.ammo[WP_KNIFE];
|
||||||
bs->inventory[INVENTORY_M4AMMO] = bs->cur_ps.ammo[WP_M4] + ent->client->numClips[WP_M4] * RQ3_M4_CLIP;
|
bs->inventory[INVENTORY_M4AMMO] = bs->cur_ps.ammo[WP_M4] + bs->inventory[INVENTORY_M4CLIP] * RQ3_M4_CLIP;
|
||||||
bs->inventory[INVENTORY_SSG3000AMMO] = bs->cur_ps.ammo[WP_SSG3000] + ent->client->numClips[WP_SSG3000];
|
bs->inventory[INVENTORY_SSG3000AMMO] = bs->cur_ps.ammo[WP_SSG3000] + bs->inventory[INVENTORY_SSG3000CLIP];
|
||||||
bs->inventory[INVENTORY_MP5AMMO] = bs->cur_ps.ammo[WP_MP5] + ent->client->numClips[WP_MP5] * RQ3_MP5_CLIP;
|
bs->inventory[INVENTORY_MP5AMMO] = bs->cur_ps.ammo[WP_MP5] + bs->inventory[INVENTORY_MP5CLIP] * RQ3_MP5_CLIP;
|
||||||
//Blaze: Same ammo for shotgun and handcannon
|
//Blaze: Same ammo for shotgun and handcannon
|
||||||
//Makro - this was odd
|
//Makro - this was odd
|
||||||
//bs->inventory[INVENTORY_M3AMMO] = bs->cur_ps.ammo[WP_HANDCANNON];
|
//bs->inventory[INVENTORY_M3AMMO] = bs->cur_ps.ammo[WP_HANDCANNON];
|
||||||
//bs->inventory[INVENTORY_M3AMMO] = bs->cur_ps.ammo[WP_M3];
|
//bs->inventory[INVENTORY_M3AMMO] = bs->cur_ps.ammo[WP_M3];
|
||||||
bs->inventory[INVENTORY_M3AMMO] = bs->cur_ps.ammo[WP_M3] + ent->client->numClips[WP_M3];
|
bs->inventory[INVENTORY_M3AMMO] = bs->cur_ps.ammo[WP_M3] + bs->inventory[INVENTORY_M3CLIP];
|
||||||
amt = bs->cur_ps.ammo[WP_HANDCANNON] + ent->client->numClips[WP_HANDCANNON];
|
amt = bs->cur_ps.ammo[WP_HANDCANNON] + bs->inventory[INVENTORY_HANDCANNONCLIP];
|
||||||
//Makro - hackish, but oh well... bots shouldn't want to use a HC when they only have one shell left
|
//Makro - hackish, but oh well... bots shouldn't want to use a HC when they only have one shell left
|
||||||
if (amt < 2)
|
if (amt < 2)
|
||||||
amt = 0;
|
amt = 0;
|
||||||
bs->inventory[INVENTORY_HANDCANNONAMMO] = amt;
|
bs->inventory[INVENTORY_HANDCANNONAMMO] = amt;
|
||||||
//Blaze: Same ammo for Pistol and Akimbo Pistols
|
//Blaze: Same ammo for Pistol and Akimbo Pistols
|
||||||
//bs->inventory[INVENTORY_PISTOLAMMO] = bs->cur_ps.ammo[WP_AKIMBO];
|
//bs->inventory[INVENTORY_PISTOLAMMO] = bs->cur_ps.ammo[WP_AKIMBO];
|
||||||
//Makro - same hack for akimbo
|
bs->inventory[INVENTORY_AKIMBOAMMO] = bs->cur_ps.ammo[WP_AKIMBO] + bs->inventory[INVENTORY_AKIMBOCLIP] * RQ3_PISTOL_CLIP;
|
||||||
amt = bs->cur_ps.ammo[WP_AKIMBO] + ent->client->numClips[WP_AKIMBO] * RQ3_PISTOL_CLIP;
|
|
||||||
if (amt < 2)
|
|
||||||
amt = 0;
|
|
||||||
bs->inventory[INVENTORY_AKIMBOAMMO] = amt;
|
|
||||||
bs->inventory[INVENTORY_GRENADEAMMO] = bs->cur_ps.ammo[WP_GRENADE];
|
bs->inventory[INVENTORY_GRENADEAMMO] = bs->cur_ps.ammo[WP_GRENADE];
|
||||||
|
|
||||||
// bs->inventory[INVENTORY_BFGAMMO] = bs->cur_ps.ammo[WP_BFG];
|
// bs->inventory[INVENTORY_BFGAMMO] = bs->cur_ps.ammo[WP_BFG];
|
||||||
|
@ -2370,18 +2394,6 @@ void BotUpdateInventory(bot_state_t *bs) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Makro - adding clip info
|
|
||||||
//Note - this stuff is also added to the ammo info, so bots know they still have ammo for their guns
|
|
||||||
bs->inventory[INVENTORY_KNIFECLIP] = ent->client->numClips[WP_KNIFE];
|
|
||||||
bs->inventory[INVENTORY_PISTOLCLIP] = ent->client->numClips[WP_PISTOL];
|
|
||||||
bs->inventory[INVENTORY_M3CLIP] = ent->client->numClips[WP_M3];
|
|
||||||
bs->inventory[INVENTORY_SSG3000CLIP] = ent->client->numClips[WP_SSG3000];
|
|
||||||
bs->inventory[INVENTORY_MP5CLIP] = ent->client->numClips[WP_MP5];
|
|
||||||
bs->inventory[INVENTORY_M4CLIP] = ent->client->numClips[WP_M4];
|
|
||||||
bs->inventory[INVENTORY_HANDCANNONCLIP] = ent->client->numClips[WP_HANDCANNON];
|
|
||||||
bs->inventory[INVENTORY_AKIMBOCLIP] = ent->client->numClips[WP_AKIMBO];
|
|
||||||
bs->inventory[INVENTORY_GRENADECLIP] = ent->client->numClips[WP_GRENADE];
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (showInfo) {
|
if (showInfo) {
|
||||||
BotAI_Print(PRT_MESSAGE, "Inventory for %s :\n-----------------\n", ent->client->pers.netname);
|
BotAI_Print(PRT_MESSAGE, "Inventory for %s :\n-----------------\n", ent->client->pers.netname);
|
||||||
|
@ -2644,10 +2656,10 @@ Added by Makro
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
int RQ3_Bot_NeedToBandage( bot_state_t *bs) {
|
int RQ3_Bot_NeedToBandage( bot_state_t *bs) {
|
||||||
if ((bs->cur_ps.stats[STAT_RQ3] & RQ3_BANDAGE_NEED) == RQ3_BANDAGE_NEED)
|
|
||||||
return 1;
|
|
||||||
if ((bs->cur_ps.stats[STAT_RQ3] & RQ3_LEGDAMAGE) == RQ3_LEGDAMAGE)
|
if ((bs->cur_ps.stats[STAT_RQ3] & RQ3_LEGDAMAGE) == RQ3_LEGDAMAGE)
|
||||||
return 2;
|
return 2;
|
||||||
|
if ((bs->cur_ps.stats[STAT_RQ3] & RQ3_BANDAGE_NEED) == RQ3_BANDAGE_NEED)
|
||||||
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2672,6 +2684,45 @@ qboolean RQ3_Bot_CheckBandage( bot_state_t *bs ) {
|
||||||
return doBandage;
|
return doBandage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
==================
|
||||||
|
RQ3_Bot_RQ3_Bot_IdleActions
|
||||||
|
|
||||||
|
Added by Makro
|
||||||
|
==================
|
||||||
|
*/
|
||||||
|
void RQ3_Bot_IdleActions( bot_state_t *bs ) {
|
||||||
|
int damage = RQ3_Bot_NeedToBandage(bs);
|
||||||
|
int ammo = bs->cur_ps.ammo[bs->cur_ps.weapon];
|
||||||
|
int weapon = bs->cur_ps.weapon;
|
||||||
|
//float reactiontime = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_REACTIONTIME, 0, 1);
|
||||||
|
|
||||||
|
//too soon to reload/bandage again ?
|
||||||
|
if (bs->idleAction_time > FloatTime())
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
//check if the bot needs to bandage
|
||||||
|
if (damage == 2 || ((damage == 1) && RQ3_Bot_CheckBandage(bs))) {
|
||||||
|
if (bs->cur_ps.weaponstate != WEAPON_BANDAGING) {
|
||||||
|
Cmd_Bandage( &g_entities[bs->entitynum] );
|
||||||
|
bs->idleAction_time = FloatTime() + 4;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//check if the bot needs to reload
|
||||||
|
if (ammo == 0 || (weapon == WP_SSG3000 && ammo < RQ3_SSG3000_AMMO) || (weapon == WP_M3 && ammo < RQ3_M3_AMMO)) {
|
||||||
|
if (RQ3_Bot_CanReload(bs, weapon)) {
|
||||||
|
trap_EA_Action(bs->client, ACTION_AFFIRMATIVE);
|
||||||
|
bs->idleAction_time = FloatTime() + 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==================
|
==================
|
||||||
BotBattleUseItems
|
BotBattleUseItems
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.8 2002/05/30 21:18:28 makro
|
||||||
|
// Bots should reload/bandage when roaming around
|
||||||
|
// Added "pathtarget" key to all the entities
|
||||||
|
//
|
||||||
// Revision 1.7 2002/05/10 13:21:53 makro
|
// Revision 1.7 2002/05/10 13:21:53 makro
|
||||||
// Mainly bot stuff. Also fixed a couple of crash bugs
|
// Mainly bot stuff. Also fixed a couple of crash bugs
|
||||||
//
|
//
|
||||||
|
@ -186,7 +190,8 @@ int BotPointAreaNum(vec3_t origin);
|
||||||
//
|
//
|
||||||
void BotMapScripts(bot_state_t *bs);
|
void BotMapScripts(bot_state_t *bs);
|
||||||
|
|
||||||
//RQ3 bot functions
|
// RQ3 bot functions //
|
||||||
|
|
||||||
qboolean RQ3_Bot_CheckBandage( bot_state_t *bs );
|
qboolean RQ3_Bot_CheckBandage( bot_state_t *bs );
|
||||||
qboolean RQ3_Bot_CanReload( bot_state_t *bs, int weapon );
|
qboolean RQ3_Bot_CanReload( bot_state_t *bs, int weapon );
|
||||||
int RQ3_Bot_NeedToBandage( bot_state_t *bs);
|
int RQ3_Bot_NeedToBandage( bot_state_t *bs);
|
||||||
|
@ -195,6 +200,7 @@ void BotAttack(bot_state_t *bs);
|
||||||
bot_moveresult_t BotMoveTo(bot_state_t *bs, vec3_t dest);
|
bot_moveresult_t BotMoveTo(bot_state_t *bs, vec3_t dest);
|
||||||
void BotMoveTowardsEnt(bot_state_t *bs, vec3_t dest, int dist);
|
void BotMoveTowardsEnt(bot_state_t *bs, vec3_t dest, int dist);
|
||||||
char *BotGetUserInfoKey(bot_state_t *bs, char *key);
|
char *BotGetUserInfoKey(bot_state_t *bs, char *key);
|
||||||
|
void RQ3_Bot_IdleActions( bot_state_t *bs );
|
||||||
|
|
||||||
//ctf flags
|
//ctf flags
|
||||||
#define CTF_FLAG_NONE 0
|
#define CTF_FLAG_NONE 0
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.9 2002/05/30 21:18:28 makro
|
||||||
|
// Bots should reload/bandage when roaming around
|
||||||
|
// Added "pathtarget" key to all the entities
|
||||||
|
//
|
||||||
// Revision 1.8 2002/05/05 15:18:02 makro
|
// Revision 1.8 2002/05/05 15:18:02 makro
|
||||||
// Fixed some crash bugs. Bot stuff. Triggerable func_statics.
|
// Fixed some crash bugs. Bot stuff. Triggerable func_statics.
|
||||||
// Made flags only spawn in CTF mode
|
// Made flags only spawn in CTF mode
|
||||||
|
@ -217,6 +221,7 @@ typedef struct bot_state_s
|
||||||
int predictobstacles_goalareanum; //last goal areanum the bot predicted obstacles for
|
int predictobstacles_goalareanum; //last goal areanum the bot predicted obstacles for
|
||||||
float radioresponse_time; //Makro - the last time the bot responded to a radio message
|
float radioresponse_time; //Makro - the last time the bot responded to a radio message
|
||||||
int radioresponse_count; //Makro - how many times the bot responded to radio messages
|
int radioresponse_count; //Makro - how many times the bot responded to radio messages
|
||||||
|
float idleAction_time; //Makro - last time the bot did something while roaming around (reload/bandage)
|
||||||
|
|
||||||
vec3_t aimtarget;
|
vec3_t aimtarget;
|
||||||
vec3_t enemyvelocity; //enemy velocity 0.5 secs ago during battle
|
vec3_t enemyvelocity; //enemy velocity 0.5 secs ago during battle
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.84 2002/05/30 21:18:28 makro
|
||||||
|
// Bots should reload/bandage when roaming around
|
||||||
|
// Added "pathtarget" key to all the entities
|
||||||
|
//
|
||||||
// Revision 1.83 2002/05/28 01:17:01 jbravo
|
// Revision 1.83 2002/05/28 01:17:01 jbravo
|
||||||
// More gib fixes. g_RQ3_gib added
|
// More gib fixes. g_RQ3_gib added
|
||||||
//
|
//
|
||||||
|
@ -352,7 +356,7 @@ struct gentity_s {
|
||||||
gitem_t *item; // for bonus items
|
gitem_t *item; // for bonus items
|
||||||
float distance; // VALKYRIE: for rotating door
|
float distance; // VALKYRIE: for rotating door
|
||||||
//Blaze: Holds the target set by a button
|
//Blaze: Holds the target set by a button
|
||||||
char pathtarget[32];
|
char *pathtarget;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.50 2002/05/30 21:18:28 makro
|
||||||
|
// Bots should reload/bandage when roaming around
|
||||||
|
// Added "pathtarget" key to all the entities
|
||||||
|
//
|
||||||
// Revision 1.49 2002/05/29 13:49:25 makro
|
// Revision 1.49 2002/05/29 13:49:25 makro
|
||||||
// Elevators/doors
|
// Elevators/doors
|
||||||
//
|
//
|
||||||
|
@ -163,12 +167,21 @@ void SP_light( gentity_t *self ) {
|
||||||
G_FreeEntity( self );
|
G_FreeEntity( self );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*QUAKED light_d (0 1 0) (-8 -8 -8) (8 8 8)
|
/*QUAKED light_d (0 1 0) (-8 -8 -8) (8 8 8) ADDITIVE FLICKER PULSE STROBE START_OFF
|
||||||
Dynamic light entity. Use sparingly.
|
Dynamic light entity. Use sparingly.
|
||||||
Q3 does not allow for manual light radius setup.
|
Q3 does not allow for manual light radius setup.
|
||||||
Set the color key for the intended color
|
Set the color key for the intended color
|
||||||
"light" overrides the default 100 intensity.
|
"light" overrides the default 100 intensity.
|
||||||
*/
|
*/
|
||||||
|
void use_dlight( gentity_t *ent, gentity_t *other, gentity_t *activator ) {
|
||||||
|
ent->unbreakable ^= 1;
|
||||||
|
if (ent->unbreakable) {
|
||||||
|
ent->r.svFlags &= ~SVF_NOCLIENT;
|
||||||
|
} else {
|
||||||
|
ent->r.svFlags |= SVF_NOCLIENT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SP_dlight( gentity_t *ent ) {
|
void SP_dlight( gentity_t *ent ) {
|
||||||
vec3_t color;
|
vec3_t color;
|
||||||
float light;
|
float light;
|
||||||
|
@ -187,6 +200,16 @@ void SP_dlight( gentity_t *ent ) {
|
||||||
ent->s.eventParm |= DLIGHT_PULSE;
|
ent->s.eventParm |= DLIGHT_PULSE;
|
||||||
if ( ent->spawnflags & 8 )
|
if ( ent->spawnflags & 8 )
|
||||||
ent->s.eventParm |= DLIGHT_STROBE;
|
ent->s.eventParm |= DLIGHT_STROBE;
|
||||||
|
|
||||||
|
//Makro - added START_OFF flag
|
||||||
|
if ( ent->spawnflags & 16 ) {
|
||||||
|
ent->unbreakable = 1;
|
||||||
|
ent->r.svFlags &= ~SVF_NOCLIENT;
|
||||||
|
} else {
|
||||||
|
ent->unbreakable = 0;
|
||||||
|
ent->r.svFlags |= SVF_NOCLIENT;
|
||||||
|
}
|
||||||
|
ent->use = use_dlight;
|
||||||
|
|
||||||
r = color[0] * 255;
|
r = color[0] * 255;
|
||||||
if ( r > 255 ) {
|
if ( r > 255 ) {
|
||||||
|
@ -591,7 +614,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
||||||
char *id;
|
char *id;
|
||||||
char *velocity;
|
char *velocity;
|
||||||
char *jump;
|
char *jump;
|
||||||
char *name, *s;
|
char *name;
|
||||||
char breakinfo[MAX_INFO_STRING];
|
char breakinfo[MAX_INFO_STRING];
|
||||||
|
|
||||||
// Make it appear as the brush
|
// Make it appear as the brush
|
||||||
|
@ -723,11 +746,6 @@ void SP_func_breakable( gentity_t *ent ) {
|
||||||
|
|
||||||
trap_LinkEntity (ent);
|
trap_LinkEntity (ent);
|
||||||
|
|
||||||
//Makro - added for elevators
|
|
||||||
if (G_SpawnString( "pathtarget","", &s)) {
|
|
||||||
Q_strncpyz(ent->pathtarget, s, sizeof(ent->pathtarget));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -887,7 +905,6 @@ void G_BreakGlass( gentity_t *ent, gentity_t *inflictor, gentity_t *attacker, ve
|
||||||
|
|
||||||
void SP_func_pressure( gentity_t *ent ) {
|
void SP_func_pressure( gentity_t *ent ) {
|
||||||
char *type;
|
char *type;
|
||||||
char *s;
|
|
||||||
|
|
||||||
// Make it appear as the brush
|
// Make it appear as the brush
|
||||||
trap_SetBrushModel( ent, ent->model );
|
trap_SetBrushModel( ent, ent->model );
|
||||||
|
@ -912,10 +929,6 @@ void SP_func_pressure( gentity_t *ent ) {
|
||||||
// ent->s.frame holds type
|
// ent->s.frame holds type
|
||||||
// ent->s.powerups holds speed
|
// ent->s.powerups holds speed
|
||||||
|
|
||||||
//Makro - added for elevators
|
|
||||||
if (G_SpawnString( "pathtarget","", &s)) {
|
|
||||||
Q_strncpyz(ent->pathtarget, s, sizeof(ent->pathtarget));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void G_CreatePressure(vec3_t origin, vec3_t normal, gentity_t *ent) {
|
void G_CreatePressure(vec3_t origin, vec3_t normal, gentity_t *ent) {
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.43 2002/05/30 21:18:28 makro
|
||||||
|
// Bots should reload/bandage when roaming around
|
||||||
|
// Added "pathtarget" key to all the entities
|
||||||
|
//
|
||||||
// Revision 1.42 2002/05/29 19:49:21 makro
|
// Revision 1.42 2002/05/29 19:49:21 makro
|
||||||
// Option to disable spectator triggers for doors
|
// Option to disable spectator triggers for doors
|
||||||
//
|
//
|
||||||
|
@ -1125,12 +1129,6 @@ void InitMover( gentity_t *ent ) {
|
||||||
if ( ent->s.pos.trDuration <= 0 ) {
|
if ( ent->s.pos.trDuration <= 0 ) {
|
||||||
ent->s.pos.trDuration = 1;
|
ent->s.pos.trDuration = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Makro - added for elevators
|
|
||||||
if (G_SpawnString( "pathtarget","", &sound)) {
|
|
||||||
Q_strncpyz(ent->pathtarget, sound, sizeof(ent->pathtarget));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1756,11 +1754,6 @@ void InitRotator( gentity_t *ent ) {
|
||||||
if ( ent->s.apos.trDuration <= 0 ) {
|
if ( ent->s.apos.trDuration <= 0 ) {
|
||||||
ent->s.apos.trDuration = 1;
|
ent->s.apos.trDuration = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Makro - added for elevators
|
|
||||||
if (G_SpawnString( "pathtarget","", &sound)) {
|
|
||||||
Q_strncpyz(ent->pathtarget, sound, sizeof(ent->pathtarget));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.28 2002/05/30 21:18:28 makro
|
||||||
|
// Bots should reload/bandage when roaming around
|
||||||
|
// Added "pathtarget" key to all the entities
|
||||||
|
//
|
||||||
// Revision 1.27 2002/05/25 10:40:31 makro
|
// Revision 1.27 2002/05/25 10:40:31 makro
|
||||||
// Loading screen
|
// Loading screen
|
||||||
//
|
//
|
||||||
|
@ -175,7 +179,7 @@ field_t fields[] = {
|
||||||
{"targetShaderName", FOFS(targetShaderName), F_LSTRING},
|
{"targetShaderName", FOFS(targetShaderName), F_LSTRING},
|
||||||
{"targetShaderNewName", FOFS(targetShaderNewName), F_LSTRING},
|
{"targetShaderNewName", FOFS(targetShaderNewName), F_LSTRING},
|
||||||
{"distance", FOFS(distance), F_FLOAT}, // VALKYRIE: for rotating doors
|
{"distance", FOFS(distance), F_FLOAT}, // VALKYRIE: for rotating doors
|
||||||
//{"pathtarget", FOFS(pathtarget), F_LSTRING}, // Makro - for func_trains
|
{"pathtarget", FOFS(pathtarget), F_LSTRING}, // Makro - for func_trains
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.7 2002/05/30 21:18:28 makro
|
||||||
|
// Bots should reload/bandage when roaming around
|
||||||
|
// Added "pathtarget" key to all the entities
|
||||||
|
//
|
||||||
// Revision 1.6 2002/05/23 18:37:50 makro
|
// Revision 1.6 2002/05/23 18:37:50 makro
|
||||||
// Bots should crouch more often when they attack with a SSG
|
// Bots should crouch more often when they attack with a SSG
|
||||||
// Made this depend on skill. Also, elevator stuff
|
// Made this depend on skill. Also, elevator stuff
|
||||||
|
@ -104,7 +108,6 @@ void Use_Target_Delay( gentity_t *ent, gentity_t *other, gentity_t *activator )
|
||||||
}
|
}
|
||||||
|
|
||||||
void SP_target_delay( gentity_t *ent ) {
|
void SP_target_delay( gentity_t *ent ) {
|
||||||
char *s;
|
|
||||||
|
|
||||||
// check delay for backwards compatability
|
// check delay for backwards compatability
|
||||||
if ( !G_SpawnFloat( "delay", "0", &ent->wait ) ) {
|
if ( !G_SpawnFloat( "delay", "0", &ent->wait ) ) {
|
||||||
|
@ -115,11 +118,6 @@ void SP_target_delay( gentity_t *ent ) {
|
||||||
ent->wait = 1;
|
ent->wait = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Makro - added for elevators
|
|
||||||
if (G_SpawnString( "pathtarget","", &s)) {
|
|
||||||
Q_strncpyz(ent->pathtarget, s, sizeof(ent->pathtarget));
|
|
||||||
}
|
|
||||||
|
|
||||||
ent->use = Use_Target_Delay;
|
ent->use = Use_Target_Delay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,11 +407,6 @@ void target_relay_use (gentity_t *self, gentity_t *other, gentity_t *activator)
|
||||||
}
|
}
|
||||||
|
|
||||||
void SP_target_relay (gentity_t *self) {
|
void SP_target_relay (gentity_t *self) {
|
||||||
char *s;
|
|
||||||
//Makro - added for elevators
|
|
||||||
if (G_SpawnString( "pathtarget","", &s)) {
|
|
||||||
Q_strncpyz(self->pathtarget, s, sizeof(self->pathtarget));
|
|
||||||
}
|
|
||||||
self->use = target_relay_use;
|
self->use = target_relay_use;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,10 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.19 2002/05/30 21:18:28 makro
|
||||||
|
// Bots should reload/bandage when roaming around
|
||||||
|
// Added "pathtarget" key to all the entities
|
||||||
|
//
|
||||||
// Revision 1.18 2002/05/29 13:49:26 makro
|
// Revision 1.18 2002/05/29 13:49:26 makro
|
||||||
// Elevators/doors
|
// Elevators/doors
|
||||||
//
|
//
|
||||||
|
@ -54,18 +58,12 @@
|
||||||
|
|
||||||
|
|
||||||
void InitTrigger( gentity_t *self ) {
|
void InitTrigger( gentity_t *self ) {
|
||||||
char *s;
|
|
||||||
if (!VectorCompare (self->s.angles, vec3_origin))
|
if (!VectorCompare (self->s.angles, vec3_origin))
|
||||||
G_SetMovedir (self->s.angles, self->movedir);
|
G_SetMovedir (self->s.angles, self->movedir);
|
||||||
|
|
||||||
trap_SetBrushModel( self, self->model );
|
trap_SetBrushModel( self, self->model );
|
||||||
self->r.contents = CONTENTS_TRIGGER; // replaces the -1 from trap_SetBrushModel
|
self->r.contents = CONTENTS_TRIGGER; // replaces the -1 from trap_SetBrushModel
|
||||||
self->r.svFlags = SVF_NOCLIENT;
|
self->r.svFlags = SVF_NOCLIENT;
|
||||||
|
|
||||||
//Makro - added for elevators
|
|
||||||
if (G_SpawnString( "pathtarget","", &s)) {
|
|
||||||
Q_strncpyz(self->pathtarget, s, sizeof(self->pathtarget));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,13 +6,14 @@
|
||||||
--------------------Configuration: game - Win32 Release--------------------
|
--------------------Configuration: game - Win32 Release--------------------
|
||||||
</h3>
|
</h3>
|
||||||
<h3>Command Lines</h3>
|
<h3>Command Lines</h3>
|
||||||
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSPB1.tmp" with contents
|
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP189.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
|
/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_mover.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\RSPB1.tmp"
|
Creating command line "cl.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP189.tmp"
|
||||||
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSPB2.tmp" with contents
|
Creating temporary file "D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP18A.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"
|
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_chat.obj
|
||||||
|
@ -55,10 +56,11 @@ kernel32.lib user32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows
|
||||||
\reactionoutput\zcam.obj
|
\reactionoutput\zcam.obj
|
||||||
\reactionoutput\zcam_target.obj
|
\reactionoutput\zcam_target.obj
|
||||||
]
|
]
|
||||||
Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSPB2.tmp"
|
Creating command line "link.exe @D:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP18A.tmp"
|
||||||
<h3>Output Window</h3>
|
<h3>Output Window</h3>
|
||||||
Compiling...
|
Compiling...
|
||||||
g_mover.c
|
ai_dmnet.c
|
||||||
|
ai_dmq3.c
|
||||||
Linking...
|
Linking...
|
||||||
Creating library c:\reactionoutput/qagamex86.lib and object c:\reactionoutput/qagamex86.exp
|
Creating library c:\reactionoutput/qagamex86.lib and object c:\reactionoutput/qagamex86.exp
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue