AI Controlled Characters - BG File Changes

 

Changes for BG Files

The following source code changes must be made to the BG (both game) files so they are avalible to both the game and cgame projects.

In bg_public.h about line 81 add :

#define CS_BOTINFO				25
#define CS_ITEMS 27
#ifdef SINGLEPLAYER // npc
#define CS_NPCS 28
#endif

#define CS_MODELS 32

In bg_public.h about line 264 add :

#define EF_AWARD_DENIED		0x00040000		// denied
#define EF_TEAMVOTED 0x00080000 // already cast a team vote
#ifdef SINGLEPLAYER // npc
#define EF_FORCE_END_FRAME 0x00100000
#endif

In bg_public.h about line 319 add :

	WP_BFG,
WP_GRAPPLING_HOOK,
#ifdef SINGLEPLAYER // npc
WP_FIREBALL,
WP_BAT,
WP_SEA1,
WP_SEA2,
WP_GUN,
#endif

In bg_public.h about line 452 add :

#ifdef SINGLEPLAYER // npc
EV_EARTHQUAKE,
#endif

EV_DEBUG_LINE,
EV_STOPLOOPINGSOUND,

In bg_public.h about line 538 add :

} animNumber_t;

#ifdef SINGLEPLAYER // npc
// NPC animations
typedef enum {
ANPC_DEATH1,
ANPC_DEATH2,
ANPC_DEATH3,
ANPC_TAUNT,
ANPC_ATTACK_FAR,
ANPC_ATTACK_MELEE,
ANPC_STANDING,
ANPC_STANDING_ACTIVE,
ANPC_WALK,
ANPC_RUN,
ANPC_BACKPEDAL,
ANPC_JUMP,
ANPC_LAND,
ANPC_PAIN,
MAX_ANIMATIONS_NPC
} animNumberNPC_t;
#endif

typedef struct animation_s {

In bg_public.h about line 635 add :

} meansOfDeath_t;

#ifdef SINGLEPLAYER // npc
typedef enum {
NPC_ANK,
NPC_BAT,
NPC_HULK,
NPC_METLAR,
NPC_PILOT,
NPC_SEALORD,
NPC_SOLDIER1,
NPC_SOLDIER2,
NPC_NUMNPCS
} npcType_t;
#define HULK_QUAKE_LEN 1700 // msec
typedef struct gnpc_s {
char *classname;
npcType_t npcType;
int health;
float painFreq;
int walkingSpeed;
int runningSpeed;
int fov;
int jumpHeight;
int walkingRotSpd;
int runningRotSpd;
int melee_dist;
int melee_damage;
int far_damage;
int animTimes[MAX_ANIMATIONS_NPC];
vec3_t mins,maxs,eye;
char *precaches;
char *sounds;
} gnpc_t;
extern gnpc_t bg_npclist[];
#endif

In bg_public.h about line 766 add :

	ET_GRAPPLE,				// grapple hooked on wall
ET_TEAM,
#ifdef SINGLEPLAYER // npc
ET_NPC,
#endif

ET_EVENTS

In bg_misc.c about line 25 add :

#include "q_shared.h"
#include "bg_public.h"
#ifdef SINGLEPLAYER // npc
gnpc_t bg_npclist[] =
{
{
"npc_ank", // class
NPC_ANK,
100, // health
1.0,
20, // walkingSpeed
60, // runningSpeed
180, // fov
50, // jumpHeight
20, // walkingRotSpd
75, // runningRotSpd
0, // melee distance
25, // melee damage
20, // far damage
{0},
-24,-24,-24,
24,24,24,
0,0,30,
"", // precache
"" // sounds
},
{
"npc_bat", // class
NPC_BAT,
100, // health
1.0,
40,
60, // runningSpeed
180, // fov
50, // jumpHeight
20, // walkingRotSpd
75, // runningRotSpd
0, // melee distance
0, // melee damage
20, // far damage
{0},
{-24,-24,-24},
{24,24,40},
{0,0,30},
"", // precache
"" // sounds
},
{
"npc_hulk", // class
NPC_HULK,
100, // health
1.0,
30,
60, // runningSpeed
180, // fov
50, // jumpHeight
20, // walkingRotSpd
75, // runningRotSpd
0, // melee distance
50, // melee damage
35, // far damage
{0},
{-24,-24,-24},
{24,24,24},
{0,0,30},
"", // precache
"" // sounds
},
{
"npc_metlar", // class
NPC_METLAR,
100, // health
1.0,
20,
60, // runningSpeed
180, // fov
50, // jumpHeight
20, // walkingRotSpd
75, // runningRotSpd
0, // melee distance
25, // melee damage
20, // far damage
{0},
{-24,-24,-24},
{24,24,40},
{0,0,30},
"", // precache
"" // sounds
},
{
"npc_pilot", // class
NPC_PILOT,
100, // health
1.0,
20,
60, // runningSpeed
180, // fov
50, // jumpHeight
20, // walkingRotSpd
75, // runningRotSpd
0, // melee distance
0, // melee damage
20, // far damage
{0},
{-24,-24,-24},
{24,24,40},
{0,0,30},
"", // precache
"" // sounds
},
{
"npc_sealord", // class
NPC_SEALORD,
1000, // health
1.0,
0,
0, // runningSpeed
180, // fov
50, // jumpHeight
0, // walkingRotSpd
0, // runningRotSpd
0, // melee distance
25, // melee damage
20, // far damage
{0},
{-24,-24,-24},
{24,24,40},
{0,0,30},
"", // precache
"" // sounds
},
{
"npc_soldier1", // class
NPC_SOLDIER1,
100, // health
1.0,
20,
60, // runningSpeed
180, // fov
50, // jumpHeight
20, // walkingRotSpd
75, // runningRotSpd
0, // melee distance
0, // melee damage
20, // far damage
{0},
{-24,-24,-24},
{24,24,40},
{0,0,30},
"", // precache
"" // sounds
},
{
"npc_soldier2", // class
NPC_SOLDIER2,
100, // health
1.0,
20,
60, // runningSpeed
180, // fov
50, // jumpHeight
20, // walkingRotSpd
75, // runningRotSpd
0, // melee distance
0, // melee damage
20, // far damage
{0},
{-24,-24,-24},
{24,24,40},
{0,0,30},
"", // precache
"" // sounds
},
{NULL},
};
#endif

In bg_misc.c about line 429 add :

/*QUAKED weapon_rocketlauncher (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
*/
{
"weapon_rocketlauncher",
"sound/misc/w_pkup.wav",
{ "models/weapons2/rocketl/rocketl.md3",
0, 0, 0},
/* icon */ "icons/iconw_rocket",
/* pickup */ "Rocket Launcher",
10,
IT_WEAPON,
WP_ROCKET_LAUNCHER,
/* precache */ "",
/* sounds */ ""
},
#ifdef SINGLEPLAYER // npc
{
"weapon_rocketlauncher",
"sound/misc/w_pkup.wav",
{ "models/weapons2/rocketl/rocketl.md3",
0, 0, 0},
/* icon */ "icons/iconw_rocket",
/* pickup */ "Rocket Launcher",
10,
IT_WEAPON,
WP_FIREBALL,
/* precache */ "",
/* sounds */ ""
},
{
"weapon_bfg",
"sound/misc/w_pkup.wav",
{ "models/weapons2/bfg/bfg.md3",
0, 0, 0},
/* icon */ "icons/iconw_bfg",
/* pickup */ "BFG10K",
20,
IT_WEAPON,
WP_BAT,
/* precache */ "",
/* sounds */ ""
},
{
"weapon_grenadelauncher",
"sound/misc/w_pkup.wav",
{ "models/weapons2/grenadel/grenadel.md3",
0, 0, 0},
/* icon */ "icons/iconw_grenade",
/* pickup */ "Grenade Launcher",
10,
IT_WEAPON,
WP_SEA1,
/* precache */ "",
/* sounds */ "sound/weapons/grenade/hgrenb1a.wav sound/weapons/grenade/hgrenb2a.wav"
},
{
"weapon_railgun",
"sound/misc/w_pkup.wav",
{ "models/weapons2/railgun/railgun.md3",
0, 0, 0},
/* icon */ "icons/iconw_railgun",
/* pickup */ "Railgun",
10,
IT_WEAPON,
WP_SEA2,
/* precache */ "",
/* sounds */ ""
},
{
"weapon_gun",
"sound/misc/w_pkup.wav",
{ "models/weapons2/gun/gun.md3",
"models/weapons2/gun/gun_hud.md3",
0, 0},
/* icon */ "icons/icon_gun",
/* pickup */ "Gun",
6,
IT_WEAPON,
WP_GUN,
/* precache */ "",
/* sounds */ ""
},
#endif

 

Return to Home Page