Shared conditions: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (linking to other pages and information)
(too many links to same page)
 
Line 1: Line 1:
{{Dead end|date=January 2024}}
Following values are defined in [https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/game/server/ai_condition.h ai_condition.h]


== Conditions ==
*COND_NONE: A way for a function to return no condition to get
*COND_NONE: A way for a function to return no condition to get
*COND_IN_PVS
*COND_IN_PVS
Line 11: Line 12:
*COND_SEE_FEAR
*COND_SEE_FEAR
*COND_SEE_DISLIKE
*COND_SEE_DISLIKE
*[[NPC Sensing|COND_SEE_ENEMY]]
*[[NPC Sensing|COND_LOST_ENEMY]]
*COND_ENEMY_WENT_NULL: Set in the edge case where you had an enemy last think, but don't have one this think.
*COND_ENEMY_WENT_NULL: Set in the edge case where you had an enemy last think, but don't have one this think.
*COND_ENEMY_OCCLUDED: Can't see m_hEnemy
*COND_ENEMY_OCCLUDED: Can't see m_hEnemy
Line 38: Line 37:
*COND_TASK_FAILED
*COND_TASK_FAILED
*COND_SCHEDULE_DONE:  Just completed last task in schedule, so make it invalid by clearing it.
*COND_SCHEDULE_DONE:  Just completed last task in schedule, so make it invalid by clearing it.
*[[NPC Sensing|COND_SMELL]]
*COND_TOO_CLOSE_TO_ATTACK
*COND_TOO_CLOSE_TO_ATTACK
*COND_TOO_FAR_TO_ATTACK
*COND_TOO_FAR_TO_ATTACK
Line 51: Line 49:
*COND_GIVE_WAY: Another npc requested that I give way
*COND_GIVE_WAY: Another npc requested that I give way
*COND_WAY_CLEAR: I no longer have to give way
*COND_WAY_CLEAR: I no longer have to give way
*[[NPC Sensing|COND_HEAR_DANGER]]
*COND_HEAR_THUMPER
*COND_HEAR_THUMPER
*COND_HEAR_BUGBAIT
*COND_HEAR_BUGBAIT
*[[NPC Sensing|COND_HEAR_COMBAT]]
*[[NPC Sensing|COND_HEAR_WORLD]]
*[[NPC Sensing|COND_HEAR_PLAYER]]
*[[NPC Sensing|COND_HEAR_BULLET_IMPACT]]
*[[NPC Sensing|COND_HEAR_PHYSICS_DANGER]]
*[[NPC Sensing|COND_HEAR_MOVE_AWAY]]: Described as scattering NPCs from the origin of this sound.
*COND_HEAR_SPOOKY: Zombies make this when Alyx is in darkness mode
*COND_HEAR_SPOOKY: Zombies make this when Alyx is in darkness mode
*[[NPC Sensing|COND_NO_HEAR_DANGER]]: Since we can't use ~CONDITION. Mutually exclusive with COND_HEAR_DANGER
*COND_FLOATING_OFF_GROUND
*COND_FLOATING_OFF_GROUND
*COND_MOBBED_BY_ENEMIES: Surrounded by a large number of enemies melee attacking me. (Zombies or Antlions, usually).
*COND_MOBBED_BY_ENEMIES: Surrounded by a large number of enemies melee attacking me. (Zombies or Antlions, usually).
*COND_RECEIVED_ORDERS
*COND_RECEIVED_ORDERS
*[[Squads|COND_PLAYER_ADDED_TO_SQUAD]]
*[[Squads|COND_PLAYER_REMOVED_FROM_SQUAD]]
*COND_PLAYER_PUSHING
*COND_PLAYER_PUSHING
*[[NPC Debugging|COND_NPC_FREEZE]]: We received an [[NPC Debugging|npc_freeze]] command while we were unfrozen
*[[NPC Debugging|COND_NPC_UNFREEZE]]: We received an ''npc_freeze'' command while we were frozen
*COND_TALKER_RESPOND_TO_QUESTION
*COND_TALKER_RESPOND_TO_QUESTION
*COND_NO_CUSTOM_INTERRUPTS: Don't call BuildScheduleTestBits for this schedule. Used for schedules that must strictly control their interruptibility.
*COND_NO_CUSTOM_INTERRUPTS: Don't call BuildScheduleTestBits for this schedule. Used for schedules that must strictly control their interruptibility.
=== [[NPC Sensing|Sensing]] ===
*COND_SEE_ENEMY
*COND_LOST_ENEMY
*COND_SMELL
*COND_HEAR_DANGER
*COND_HEAR_COMBAT
*COND_HEAR_WORLD
*COND_HEAR_PLAYER
*COND_HEAR_BULLET_IMPACT
*COND_HEAR_PHYSICS_DANGER
*COND_HEAR_MOVE_AWAY: Described as scattering NPCs from the origin of this sound.
*COND_NO_HEAR_DANGER: Since we can't use ~CONDITION. Mutually exclusive with COND_HEAR_DANGER
=== [[Squads]] ===
*COND_PLAYER_ADDED_TO_SQUAD
*COND_PLAYER_REMOVED_FROM_SQUAD
=== [[NPC Debugging|Debugging]] ===
*COND_NPC_FREEZE: We received an [[NPC_Debugging#npc_freeze|npc_freeze]] command while we were unfrozen
*COND_NPC_UNFREEZE: We received an ''npc_freeze'' command while we were frozen
== See Also ==
* [[NPC Sensing]]
* [[Squads]]
* [[NPC Debugging]]


[[Category:AI Programming]]
[[Category:AI Programming]]

Latest revision as of 22:52, 7 October 2024

Following values are defined in ai_condition.h

Conditions

  • COND_NONE: A way for a function to return no condition to get
  • COND_IN_PVS
  • COND_IDLE_INTERRUPT: The schedule in question is a low priority idle and therefore a candidate for translation into something else
  • COND_LOW_PRIMARY_AMMO
  • COND_NO_PRIMARY_AMMO
  • COND_NO_SECONDARY_AMMO
  • COND_NO_WEAPON
  • COND_SEE_HATE
  • COND_SEE_FEAR
  • COND_SEE_DISLIKE
  • COND_ENEMY_WENT_NULL: Set in the edge case where you had an enemy last think, but don't have one this think.
  • COND_ENEMY_OCCLUDED: Can't see m_hEnemy
  • COND_TARGET_OCCLUDED: Can't see m_hTargetEnt
  • COND_HAVE_ENEMY_LOS
  • COND_HAVE_TARGET_LOS
  • COND_LIGHT_DAMAGE
  • COND_HEAVY_DAMAGE
  • COND_PHYSICS_DAMAGE
  • COND_REPEATED_DAMAGE: Damaged several times in a row
  • COND_CAN_RANGE_ATTACK1: Hitscan weapon only
  • COND_CAN_RANGE_ATTACK2: Grenade weapon only
  • COND_CAN_MELEE_ATTACK1
  • COND_CAN_MELEE_ATTACK2
  • COND_PROVOKED
  • COND_NEW_ENEMY
  • COND_ENEMY_TOO_FAR
  • COND_ENEMY_FACING_ME
  • COND_BEHIND_ENEMY
  • COND_ENEMY_DEAD
  • COND_ENEMY_UNREACHABLE: Not connected to me via node graph
  • COND_SEE_PLAYER
  • COND_LOST_PLAYER
  • COND_SEE_NEMESIS
  • COND_TASK_FAILED
  • COND_SCHEDULE_DONE: Just completed last task in schedule, so make it invalid by clearing it.
  • COND_TOO_CLOSE_TO_ATTACK
  • COND_TOO_FAR_TO_ATTACK
  • COND_NOT_FACING_ATTACK
  • COND_WEAPON_HAS_LOS
  • COND_WEAPON_BLOCKED_BY_FRIEND: Friend between weapon and target
  • COND_WEAPON_PLAYER_IN_SPREAD: Player in shooting direction
  • COND_WEAPON_PLAYER_NEAR_TARGET: Player near shooting position
  • COND_WEAPON_SIGHT_OCCLUDED
  • COND_BETTER_WEAPON_AVAILABLE
  • COND_HEALTH_ITEM_AVAILABLE: There's a healthkit available.
  • COND_GIVE_WAY: Another npc requested that I give way
  • COND_WAY_CLEAR: I no longer have to give way
  • COND_HEAR_THUMPER
  • COND_HEAR_BUGBAIT
  • COND_HEAR_SPOOKY: Zombies make this when Alyx is in darkness mode
  • COND_FLOATING_OFF_GROUND
  • COND_MOBBED_BY_ENEMIES: Surrounded by a large number of enemies melee attacking me. (Zombies or Antlions, usually).
  • COND_RECEIVED_ORDERS
  • COND_PLAYER_PUSHING
  • COND_TALKER_RESPOND_TO_QUESTION
  • COND_NO_CUSTOM_INTERRUPTS: Don't call BuildScheduleTestBits for this schedule. Used for schedules that must strictly control their interruptibility.

Sensing

  • COND_SEE_ENEMY
  • COND_LOST_ENEMY
  • COND_SMELL
  • COND_HEAR_DANGER
  • COND_HEAR_COMBAT
  • COND_HEAR_WORLD
  • COND_HEAR_PLAYER
  • COND_HEAR_BULLET_IMPACT
  • COND_HEAR_PHYSICS_DANGER
  • COND_HEAR_MOVE_AWAY: Described as scattering NPCs from the origin of this sound.
  • COND_NO_HEAR_DANGER: Since we can't use ~CONDITION. Mutually exclusive with COND_HEAR_DANGER

Squads

  • COND_PLAYER_ADDED_TO_SQUAD
  • COND_PLAYER_REMOVED_FROM_SQUAD

Debugging

  • COND_NPC_FREEZE: We received an npc_freeze command while we were unfrozen
  • COND_NPC_UNFREEZE: We received an npc_freeze command while we were frozen

See Also