‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
archetype_human_blackboard.gsc
Go to the documentation of this file.
1 #using scripts\shared\array_shared;
2 
3 #using scripts\shared\ai_shared;
4 #using scripts\shared\ai\systems\ai_interface;
5 #using scripts\shared\ai\systems\blackboard;
6 #using scripts\shared\ai\systems\shared;
7 #using scripts\shared\ai\archetype_utility;
8 #using scripts\shared\ai\archetype_cover_utility;
9 #using scripts\shared\ai\archetype_locomotion_utility;
10 
11 #insert scripts\shared\ai\systems\blackboard.gsh;
12 #insert scripts\shared\ai\utility.gsh;
13 #insert scripts\shared\shared.gsh;
14 
15 #namespace Blackboard;
16 
17 //*****************************************************************************
18 // NOTE! When adding a new blackboard variable you must also declare the
19 // blackboard variable within the ast_definitions file found at:
20 //
21 // //t7/main/game/share/raw/animtables/ast_definitions.json
22 //
23 // This allows the Animation Selector Table system to determine how to create
24 // queries based on the blackboard variable.
25 //
26 // Also, all blackboard values must be lowercased! No convert to lower is
27 // perform when assigning values to the blackboard.
28 //
29 //*****************************************************************************
31 {
37 }
38 
39 function private ‪BB_GetArrivalType()
40 {
41  if( self ‪ai::get_behavior_attribute( "disablearrivals" ) )
43 
44  return ‪ARRIVE_AT_GOAL;
45 }
46 
48 {
49  return AngleClamp180( self.angles[ 1 ] - self.node.angles[ 1 ] );
50 }
51 
52 #define CLOSE_FRIENDLY_DISTANCE ( 120 )
53 #define MAX_NEARBY_FRIENDLIES 3
55 {
56  if ( !‪ai::GetAiAttribute( self, "disablesprint" ) )
57  {
58  // if the script interface needs sprinting
59  if ( ‪ai::GetAiAttribute( self, "sprint" ) )
60  {
62  }
63 
64  if ( !isDefined( self.nearbyFriendlyCheck ) )
65  self.nearbyFriendlyCheck = 0;
66 
67  now = GetTime();
68 
69  if ( now >= self.nearbyFriendlyCheck )
70  {
71  self.nearbyFriendlyCount = GetActorTeamCountRadius( self.origin, ‪CLOSE_FRIENDLY_DISTANCE, self.team, "neutral" );
72  self.nearbyFriendlyCheck = now + 500;
73  }
74 
75  if ( self.nearbyFriendlyCount >= ‪MAX_NEARBY_FRIENDLIES )
76  {
77  // Too many nearby friendlies to sprint, run instead.
79  }
80 
81  // should sprint if too far away from enemy
82  if ( IsDefined( self.enemy ) && IsDefined( self.runAndGunDist ) )
83  {
84  if ( DistanceSquared( self.origin, self LastKnownPos( self.enemy ) )
85  > ( self.runAndGunDist * self.runAndGunDist ) )
86  {
88  }
89  }
90  else if ( IsDefined( self.goalpos ) && IsDefined( self.runAndGunDist ) )
91  {
92  if ( DistanceSquared( self.origin, self.goalpos )
93  > ( self.runAndGunDist * self.runAndGunDist ) )
94  {
96  }
97  }
98  }
99 
101 }
102 
103 function private ‪BB_GetCoverFlankability()
104 {
105  if( self ASMIsTransitionRunning() )
106  {
108  }
109 
110  if( !IsDefined( self.node ) )
111  {
113  }
114 
116 
117  if( IsDefined( coverMode ) )
118  {
119  coverNode = self.node;
120 
121  if( coverMode == ‪COVER_ALERT_MODE || coverMode == ‪COVER_MODE_NONE )
122  {
124  }
125 
126  if( ‪NODE_COVER_PILLAR( coverNode ) )
127  {
128  return ( coverMode == ‪COVER_BLIND_MODE );
129  }
130  else if( ‪NODE_COVER_LEFT( coverNode ) || ‪NODE_COVER_RIGHT( coverNode ) )
131  {
132  return ( coverMode == ‪COVER_BLIND_MODE || coverMode == ‪COVER_OVER_MODE );
133  }
134  else if( ‪NODE_COVER_STAND( coverNode ) || ‪NODE_COVER_CROUCH( coverNode ) )
135  {
137  }
138  }
139 
141 }
‪HUMAN_COVER_FLANKABILITY
‪#define HUMAN_COVER_FLANKABILITY
Definition: blackboard.gsh:218
‪COVER_MODE
‪#define COVER_MODE
Definition: blackboard.gsh:41
‪BB_GetCoverFlankability
‪function private BB_GetCoverFlankability()
Definition: archetype_human_blackboard.gsc:103
‪HUMAN_LOCOMOTION_MOVEMENT_DEFAULT
‪#define HUMAN_LOCOMOTION_MOVEMENT_DEFAULT
Definition: blackboard.gsh:127
‪COVER_BLIND_MODE
‪#define COVER_BLIND_MODE
Definition: blackboard.gsh:110
‪NODE_COVER_STAND
‪#define NODE_COVER_STAND(_node)
Definition: utility.gsh:9
‪BB_GetTacticalArrivalFacingYaw
‪function private BB_GetTacticalArrivalFacingYaw()
Definition: archetype_human_blackboard.gsc:47
‪HUMAN_LOCOMOTION_MOVEMENT_SPRINT
‪#define HUMAN_LOCOMOTION_MOVEMENT_SPRINT
Definition: blackboard.gsh:126
‪NODE_COVER_PILLAR
‪#define NODE_COVER_PILLAR(_node)
Definition: utility.gsh:8
‪NODE_COVER_LEFT
‪#define NODE_COVER_LEFT(_node)
Definition: utility.gsh:6
‪RegisterActorBlackBoardAttributes
‪function RegisterActorBlackBoardAttributes()
Definition: archetype_human_blackboard.gsc:30
‪BB_REGISTER_ATTRIBUTE
‪#define BB_REGISTER_ATTRIBUTE(name, defaultValue, getter)
Definition: blackboard.gsh:1
‪BB_GetLocomotionMovementType
‪function private BB_GetLocomotionMovementType()
Definition: archetype_human_blackboard.gsc:54
‪COVER_MODE_NONE
‪#define COVER_MODE_NONE
Definition: blackboard.gsh:108
‪CLOSE_FRIENDLY_DISTANCE
‪#define CLOSE_FRIENDLY_DISTANCE
Definition: archetype_human_blackboard.gsc:52
‪HUMAN_COVER_UNFLANKABLE
‪#define HUMAN_COVER_UNFLANKABLE
Definition: blackboard.gsh:220
‪GetBlackBoardAttribute
‪function GetBlackBoardAttribute(entity, attributeName)
Definition: blackboard.gsc:32
‪HUMAN_LOCOMOTION_VARIATION
‪#define HUMAN_LOCOMOTION_VARIATION
Definition: blackboard.gsh:129
‪NODE_COVER_RIGHT
‪#define NODE_COVER_RIGHT(_node)
Definition: utility.gsh:7
‪DONT_ARRIVE_AT_GOAL
‪#define DONT_ARRIVE_AT_GOAL
Definition: blackboard.gsh:22
‪MAX_NEARBY_FRIENDLIES
‪#define MAX_NEARBY_FRIENDLIES
Definition: archetype_human_blackboard.gsc:53
‪ARRIVAL_TYPE
‪#define ARRIVAL_TYPE
Definition: blackboard.gsh:20
‪ARRIVE_AT_GOAL
‪#define ARRIVE_AT_GOAL
Definition: blackboard.gsh:21
‪TACTICAL_ARRIVAL_FACING_YAW
‪#define TACTICAL_ARRIVAL_FACING_YAW
Definition: blackboard.gsh:65
‪BB_GetArrivalType
‪function private BB_GetArrivalType()
Definition: archetype_human_blackboard.gsc:39
‪GetAiAttribute
‪function GetAiAttribute(entity, attribute)
Definition: ai_interface.gsc:118
‪HUMAN_LOCOMOTION_MOVEMENT_TYPE
‪#define HUMAN_LOCOMOTION_MOVEMENT_TYPE
Definition: blackboard.gsh:124
‪COVER_ALERT_MODE
‪#define COVER_ALERT_MODE
Definition: blackboard.gsh:113
‪COVER_OVER_MODE
‪#define COVER_OVER_MODE
Definition: blackboard.gsh:111
‪HUMAN_COVER_FLANKABLE
‪#define HUMAN_COVER_FLANKABLE
Definition: blackboard.gsh:219
‪get_behavior_attribute
‪function get_behavior_attribute(attribute)
Definition: ai_shared.gsc:184
‪NODE_COVER_CROUCH
‪#define NODE_COVER_CROUCH(_node)
Definition: utility.gsh:10