Nuclide
Software Development Kit for id Tech
NSMonster.h File Reference

Go to the source code of this file.

Classes

class  NSMonster
 This entity class represents non-player characters. More...
 

Macros

#define NSMonsterLog(...)   if (autocvar_ai_debugLogic == true) _NSMonster_Log(classname, __FUNC__, num_for_edict(this), sprintf(__VA_ARGS__))
 

Enumerations

enum  monster_activity_t {
  ACT_RESET = 0 , ACT_IDLE = 1i , ACT_GUARD , ACT_WALK ,
  ACT_RUN , ACT_FLY , ACT_SWIM , ACT_HOP ,
  ACT_LEAP , ACT_FALL , ACT_LAND , ACT_STRAFE_LEFT ,
  ACT_STRAFE_RIGHT , ACT_ROLL_LEFT , ACT_ROLL_RIGHT , ACT_TURN_LEFT ,
  ACT_TURN_RIGHT , ACT_CROUCH , ACT_CROUCHIDLE , ACT_STAND ,
  ACT_USE , ACT_SIGNAL1 , ACT_SIGNAL2 , ACT_SIGNAL3 ,
  ACT_TWITCH , ACT_COWER , ACT_SMALL_FLINCH , ACT_BIG_FLINCH ,
  ACT_RANGE_ATTACK1 , ACT_RANGE_ATTACK2 , ACT_MELEE_ATTACK1 , ACT_MELEE_ATTACK2 ,
  ACT_RELOAD , ACT_ARM , ACT_DISARM , ACT_EAT ,
  ACT_DIESIMPLE , ACT_DIEBACKWARD , ACT_DIEFORWARD , ACT_DIEVIOLENT ,
  ACT_BARNACLE_HIT , ACT_BARNACLE_PULL , ACT_BARNACLE_CHOMP , ACT_BARNACLE_CHEW ,
  ACT_SLEEP , ACT_INSPECT_FLOOR , ACT_INSPECT_WALL , ACT_IDLE_ANGRY ,
  ACT_WALK_HURT , ACT_RUN_HURT , ACT_HOVER , ACT_GLIDE ,
  ACT_FLY_LEFT , ACT_FLY_RIGHT , ACT_DETECT_SCENT , ACT_SNIFF ,
  ACT_BITE , ACT_THREAT_DISPLAY , ACT_FEAR_DISPLAY , ACT_EXCITED ,
  ACT_SPECIAL_ATTACK1 , ACT_SPECIAL_ATTACK2 , ACT_COMBAT_IDLE , ACT_WALK_SCARED ,
  ACT_RUN_SCARED , ACT_VICTORY_DANCE , ACT_DIE_HEADSHOT , ACT_DIE_CHESTSHOT ,
  ACT_DIE_GUTSHOT , ACT_DIE_BACKSHOT , ACT_FLINCH_HEAD , ACT_FLINCH_CHEST ,
  ACT_FLINCH_STOMACH , ACT_FLINCH_LEFTARM , ACT_FLINCH_RIGHTARM , ACT_FLINCH_LEFTLEG ,
  ACT_FLINCH_RIGHTLEG
}
 List of supported ACT types. More...
 
enum  monsterState_t {
  MONSTER_IDLE , MONSTER_ALERT , MONSTER_FOLLOWING , MONSTER_CHASING ,
  MONSTER_AIMING , MONSTER_DEAD , MONSTER_GIBBED
}
 Behaviour states. More...
 
enum  sequenceState_t { SEQUENCESTATE_NONE , SEQUENCESTATE_IDLE , SEQUENCESTATE_ACTIVE , SEQUENCESTATE_ENDING }
 Scripted sequence states. More...
 
enum  allianceState_t {
  MAL_FRIEND , MAL_ENEMY , MAL_ALIEN , MAL_ROGUE ,
  MAL_NEUTRAL
}
 Alliance states. More...
 
enum  movementState_t { MOVESTATE_IDLE , MOVESTATE_WALK , MOVESTATE_RUN }
 Movement states. More...
 
enum  triggerCondition_t {
  MTRIG_NONE , MTRIG_SEEPLAYER_ANGRY , MTRIG_PAIN , MTRIG_HALFHEALTH ,
  MTRIG_DEATH , MTRIG_SQUADMEMBERDEAD , MTRIG_SQUADLEADERDEAD , MTRIG_HEARNOISE ,
  MTRIG_HEARENEMYPLAYER , MTRIG_HEARWEAPONS , MTRIG_SEEPLAYER , MTRIG_SEEPLAYER_RELAXED
}
 These numerations involve the m_iTriggerCondition attribute. More...
 

Functions

void _NSMonster_Log (string className, string functionName, float edictNum, string warnMessage)
 
string Sentences_GetSamples (string)
 
string Sentences_ProcessSample (string)
 
void NSMonster_AlertEnemyAlliance (vector pos, float radius, int alliance)
 
entity NSMonster_FindClosestPlayer (entity)
 

Variables

var bool autocvar_ai_debugLogic = false
 
typedef enumflags
 Bitfield enumeration for NSMonster its SendFlags field. More...
 
int m_iAlliance
 
float baseframe2
 
float baseframe1time
 
float baseframe2time
 
float baselerpfrac
 
float bonecontrol1
 
float bonecontrol2
 
float bonecontrol3
 
float bonecontrol4
 
float bonecontrol5
 
float subblendfrac
 
float subblend2frac
 
float basesubblendfrac
 
float basesubblend2frac
 

Macro Definition Documentation

◆ NSMonsterLog

#define NSMonsterLog (   ...)    if (autocvar_ai_debugLogic == true) _NSMonster_Log(classname, __FUNC__, num_for_edict(this), sprintf(__VA_ARGS__))

Enumeration Type Documentation

◆ allianceState_t

Alliance states.

Enumerator
MAL_FRIEND 

1, friendly towards the player

MAL_ENEMY 

2, unfriendly towards the player

MAL_ALIEN 

3, unfriendly towards anyone but themselves

MAL_ROGUE 

4, no allies, not even amongst themselves

MAL_NEUTRAL 

5, neutral - will not attack, will not be attacked

◆ monster_activity_t

List of supported ACT types.

These originate from GoldSrc and framegroups within models can be tagged with them. This way the game-logic doesn't need to know the exact framegroup but can instead pick a random ACT and we'll pick the right framegroup for you.

Enumerator
ACT_RESET 
ACT_IDLE 
ACT_GUARD 
ACT_WALK 
ACT_RUN 
ACT_FLY 
ACT_SWIM 
ACT_HOP 
ACT_LEAP 
ACT_FALL 
ACT_LAND 
ACT_STRAFE_LEFT 
ACT_STRAFE_RIGHT 
ACT_ROLL_LEFT 
ACT_ROLL_RIGHT 
ACT_TURN_LEFT 
ACT_TURN_RIGHT 
ACT_CROUCH 
ACT_CROUCHIDLE 
ACT_STAND 
ACT_USE 
ACT_SIGNAL1 
ACT_SIGNAL2 
ACT_SIGNAL3 
ACT_TWITCH 
ACT_COWER 
ACT_SMALL_FLINCH 
ACT_BIG_FLINCH 
ACT_RANGE_ATTACK1 
ACT_RANGE_ATTACK2 
ACT_MELEE_ATTACK1 
ACT_MELEE_ATTACK2 
ACT_RELOAD 
ACT_ARM 
ACT_DISARM 
ACT_EAT 
ACT_DIESIMPLE 
ACT_DIEBACKWARD 
ACT_DIEFORWARD 
ACT_DIEVIOLENT 
ACT_BARNACLE_HIT 
ACT_BARNACLE_PULL 
ACT_BARNACLE_CHOMP 
ACT_BARNACLE_CHEW 
ACT_SLEEP 
ACT_INSPECT_FLOOR 
ACT_INSPECT_WALL 
ACT_IDLE_ANGRY 
ACT_WALK_HURT 
ACT_RUN_HURT 
ACT_HOVER 
ACT_GLIDE 
ACT_FLY_LEFT 
ACT_FLY_RIGHT 
ACT_DETECT_SCENT 
ACT_SNIFF 
ACT_BITE 
ACT_THREAT_DISPLAY 
ACT_FEAR_DISPLAY 
ACT_EXCITED 
ACT_SPECIAL_ATTACK1 
ACT_SPECIAL_ATTACK2 
ACT_COMBAT_IDLE 
ACT_WALK_SCARED 
ACT_RUN_SCARED 
ACT_VICTORY_DANCE 
ACT_DIE_HEADSHOT 
ACT_DIE_CHESTSHOT 
ACT_DIE_GUTSHOT 
ACT_DIE_BACKSHOT 
ACT_FLINCH_HEAD 
ACT_FLINCH_CHEST 
ACT_FLINCH_STOMACH 
ACT_FLINCH_LEFTARM 
ACT_FLINCH_RIGHTARM 
ACT_FLINCH_LEFTLEG 
ACT_FLINCH_RIGHTLEG 

◆ monsterState_t

Behaviour states.

Enumerator
MONSTER_IDLE 
MONSTER_ALERT 
MONSTER_FOLLOWING 
MONSTER_CHASING 
MONSTER_AIMING 
MONSTER_DEAD 
MONSTER_GIBBED 

◆ movementState_t

Movement states.

Enumerator
MOVESTATE_IDLE 
MOVESTATE_WALK 
MOVESTATE_RUN 

◆ sequenceState_t

Scripted sequence states.

Enumerator
SEQUENCESTATE_NONE 
SEQUENCESTATE_IDLE 
SEQUENCESTATE_ACTIVE 
SEQUENCESTATE_ENDING 

◆ triggerCondition_t

These numerations involve the m_iTriggerCondition attribute.

Basically these conditions are being checked and triggered depending on what it's set to. If any of those checks are successful, we trigger our target under the m_strTriggerTarget attribute.

Enumerator
MTRIG_NONE 

1, nothing

MTRIG_SEEPLAYER_ANGRY 

2, we see an enemy player, that we want to harm

MTRIG_PAIN 

3, taken damage

MTRIG_HALFHEALTH 

4, lost half of our base_health

MTRIG_DEATH 

5, we have died.

MTRIG_SQUADMEMBERDEAD 

6, a squad member died

MTRIG_SQUADLEADERDEAD 

7, the squad leader died

MTRIG_HEARNOISE 

8, we hear some noise around the world.

MTRIG_HEARENEMYPLAYER 

9, we hear a player we are enemies with

MTRIG_HEARWEAPONS 

10, we hear weapons being fired

MTRIG_SEEPLAYER 

11, we see a player, don't have to be angry at him.

MTRIG_SEEPLAYER_RELAXED 

12, we see a player and we're currently attacking anything

Function Documentation

◆ _NSMonster_Log()

void _NSMonster_Log ( string  className,
string  functionName,
float  edictNum,
string  warnMessage 
)

◆ NSMonster_AlertEnemyAlliance()

void NSMonster_AlertEnemyAlliance ( vector  pos,
float  radius,
int  alliance 
)

◆ NSMonster_FindClosestPlayer()

entity NSMonster_FindClosestPlayer ( entity  target)

◆ Sentences_GetSamples()

string Sentences_GetSamples ( string  word)

◆ Sentences_ProcessSample()

string Sentences_ProcessSample ( string  sample)

Variable Documentation

◆ autocvar_ai_debugLogic

var bool autocvar_ai_debugLogic = false

◆ baseframe1time

float baseframe1time

◆ baseframe2

float baseframe2

◆ baseframe2time

float baseframe2time

◆ baselerpfrac

float baselerpfrac

◆ basesubblend2frac

float basesubblend2frac

◆ basesubblendfrac

float basesubblendfrac

◆ bonecontrol1

float bonecontrol1

◆ bonecontrol2

float bonecontrol2

◆ bonecontrol3

float bonecontrol3

◆ bonecontrol4

float bonecontrol4

◆ bonecontrol5

float bonecontrol5

◆ enumflags

typedef enumflags
Initial value:
{
MONFL_CHANGED_ORIGIN_X,
MONFL_CHANGED_ORIGIN_Y,
MONFL_CHANGED_ORIGIN_Z,
MONFL_CHANGED_ANGLES_X,
MONFL_CHANGED_ANGLES_Y,
MONFL_CHANGED_ANGLES_Z,
MONFL_CHANGED_MODELINDEX,
MONFL_CHANGED_SIZE,
MONFL_CHANGED_FLAGS,
MONFL_CHANGED_SOLID,
MONFL_CHANGED_FRAME,
MONFL_CHANGED_SKINHEALTH,
MONFL_CHANGED_MOVETYPE,
MONFL_CHANGED_EFFECTS,
MONFL_CHANGED_BODY,
MONFL_CHANGED_SCALE,
MONFL_CHANGED_VELOCITY,
MONFL_CHANGED_RENDERCOLOR,
MONFL_CHANGED_RENDERAMT,
MONFL_CHANGED_RENDERMODE,
MONFL_CHANGED_HEADYAW
} nsmonster_changed_t

Bitfield enumeration for NSMonster its SendFlags field.

For future use: SpawnFlags used in Source.

Monster flags, these are defined by the level designers.

These give hint as to which internal fields get networked to the client.

AI will be enabled once seen (1) Won't talk (2) Collides against func_monsterclip (4) Reserved for entityDef (8) Only reacts to scripted sequences (16) Reserved for entityDef (32) Ignores players (64) AI waits for scripted_sequence to end (128) Reserved for entityDef (256) Corpse fades instead of staying (512) Will spawn in multiplayer NSGameRules (1024) Is falling (2048) Part of a horde (4096)

AI will be enable once seen (1) Won't talk (2) Fall to ground, instead of dropping instantly (4) Drops healthkit (8) Walks direct paths (16) Reserved for entityDef (32) Reserved for entityDef (64) AI waits for scripted_sequence to end (128) Long visibility and line of sight (256) Corpse fades instead of staying (512) Think outside the PVS (1024) Will spawn through npc_maker (2048) Alternative collision, avoiding players (4096) Don't drop weapons (8192) Ignore pushing players (16384)

◆ m_iAlliance

int m_iAlliance

◆ subblend2frac

float subblend2frac

◆ subblendfrac

float subblendfrac