‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
multilockapguidance.csc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 
3 #using scripts\shared\array_shared;
4 #using scripts\shared\clientfield_shared;
5 #using scripts\shared\duplicaterender_mgr;
6 #using scripts\shared\filter_shared;
7 #using scripts\shared\flagsys_shared;
8 #using scripts\shared\system_shared;
9 #using scripts\shared\util_shared;
10 
11 #insert scripts\shared\duplicaterender.gsh;
12 #insert scripts\shared\weapons\antipersonnelguidance.gsh;
13 #insert scripts\shared\shared.gsh;
14 #insert scripts\shared\version.gsh;
15 
16 #namespace antipersonnel_guidance;
17 
18 ‪REGISTER_SYSTEM( "multilockap_guidance", &‪__init__, undefined )
19 
20 #define AP_OUTLINE_MATERIAL "mc/hud_outline_model_red"
21 
22 function ‪__init__()
23 {
24  level thread ‪player_init();
25 
27  "ap_locked", undefined,
29 
30 }
31 
32 
33 function ‪player_init()
34 {
36 
37  players = getlocalplayers();
38 
39  foreach( player in players )
40  {
41  player thread ‪watch_lockon(0);
42  }
43 }
44 
45 
46 function ‪watch_lockon( localClientNum )
47 {
48 
49  while(1)
50  {
51  self waittill("lockon_changed",state,target);
52  if (IsDefined(self.replay_lock) && ( !IsDefined(target) || self.replay_lock!= target ) )
53  {
54  self.ap_lock ‪duplicate_render::change_dr_flags( localClientNum, undefined, "ap_locked" );
55  self.ap_lock = undefined;
56  }
57  switch(state)
58  {
59  case ‪AP_TARGET_LOST:
62  target ‪duplicate_render::change_dr_flags( localClientNum, undefined, "ap_locked" );
63  break;
64 
67  target ‪duplicate_render::change_dr_flags( localClientNum, "ap_locked", undefined );
68  self.ap_lock = target;
69  break;
70  }
71  }
72 }
73 
74 /*
75 function watch_lockon_old( localClientNum )
76 {
77 
78  while(1)
79  {
80  self waittill("lockon_changed",state,target);
81  if (IsDefined(self.replay_lock) && ( !IsDefined(target) || self.replay_lock!= target ) )
82  {
83  self.replay_lock ent_set_outline( TARGET_OUTLINE_OFF );
84  self.replay_lock = undefined;
85  }
86  target ent_set_outline( state );
87  switch(state)
88  {
89  case REPLAYGUN_TARGET_LOST:
90  target ent_set_outline( TARGET_OUTLINE_OFF );
91  //self playsound(localClientNum,"wpn_replay_lost");
92  break;
93  case REPLAYGUN_TARGET_LOCKING:
94  target ent_set_outline( TARGET_OUTLINE_OFF );
95  //self playsound(localClientNum,"wpn_replay_tracking");
96  break;
97  case REPLAYGUN_TARGET_SUSPEND:
98  target ent_set_outline( TARGET_OUTLINE_OFF );
99  break;
100  case REPLAYGUN_TARGET_LOCKED:
101  //self playsound(localClientNum,"wpn_replay_lock_on");
102  // fall through
103  case REPLAYGUN_TARGET_REGAIN:
104  target ent_set_outline( TARGET_OUTLINE_RED );
105  self.replay_lock = target;
106  break;
107  }
108  }
109 
110 
111 }
112 
113 
114 //*****************************************************************************
115 //*****************************************************************************
116 // Adding shader filters to Ents
117 //*****************************************************************************
118 //*****************************************************************************
119 
120 function init_ent_shader_materials( player )
121 {
122  // _filter::init_filter_indices();
123  filter::map_material_helper( player, "mc/hud_outline_model_red" );
124  filter::map_material_helper( player, "mc/hud_outline_model_green" );
125  filter::map_material_helper( player, "mc/hud_outline_model_orange" );
126 
127 }
128 
129 
130 function ent_set_outline( color )
131 {
132  switch( color )
133  {
134  case TARGET_OUTLINE_OFF :
135  case TARGET_OUTLINE_SUSPEND:
136  case TARGET_OUTLINE_LOCKING:
137  self addduplicaterenderoption( DR_TYPE_OFFSCREEN, DR_METHOD_OFF );
138  self addduplicaterenderoption( DR_TYPE_FRAMEBUFFER, DR_METHOD_DEFAULT_MATERIAL );
139  break;
140 
141  // Thermal Material
142  case TARGET_OUTLINE_THERMAL:
143  self addduplicaterenderoption( DR_TYPE_OFFSCREEN, DR_METHOD_OFF );
144  self addduplicaterenderoption( DR_TYPE_FRAMEBUFFER, DR_METHOD_DEFAULT_MATERIAL );
145  break;
146 
147  // Red Material
148  case TARGET_OUTLINE_LOCKED:
149  case TARGET_OUTLINE_RED:
150  self addduplicaterenderoption( DR_TYPE_FRAMEBUFFER, DR_METHOD_DEFAULT_MATERIAL );
151  self addduplicaterenderoption( DR_TYPE_OFFSCREEN, DR_METHOD_CUSTOM_MATERIAL, filter::mapped_material_id( "mc/hud_outline_model_red" ) );
152  break;
153 
154  // Green Material
155  case TARGET_OUTLINE_GREEN:
156  self addduplicaterenderoption( DR_TYPE_FRAMEBUFFER, DR_METHOD_DEFAULT_MATERIAL );
157  self addduplicaterenderoption( DR_TYPE_OFFSCREEN, DR_METHOD_CUSTOM_MATERIAL, filter::mapped_material_id( "mc/hud_outline_model_green" ) );
158  break;
159 
160  // Orange Material
161  case TARGET_OUTLINE_ORANGE:
162  self addduplicaterenderoption( DR_TYPE_FRAMEBUFFER, DR_METHOD_DEFAULT_MATERIAL );
163  self addduplicaterenderoption( DR_TYPE_OFFSCREEN, DR_METHOD_CUSTOM_MATERIAL, filter::mapped_material_id( "mc/hud_outline_model_orange" ) );
164  break;
165  }
166 }
167 
168 
169 */
‪AP_TARGET_LOCKED
‪#define AP_TARGET_LOCKED
Definition: antipersonnelguidance.gsh:16
‪waitforclient
‪function waitforclient(client)
Definition: util_shared.csc:60
‪DR_CULL_ALWAYS
‪#define DR_CULL_ALWAYS
Definition: duplicaterender.gsh:14
‪DR_TYPE_OFFSCREEN
‪#define DR_TYPE_OFFSCREEN
Definition: duplicaterender.gsh:6
‪AP_TARGET_REGAIN
‪#define AP_TARGET_REGAIN
Definition: antipersonnelguidance.gsh:18
‪AP_TARGET_LOST
‪#define AP_TARGET_LOST
Definition: antipersonnelguidance.gsh:14
‪watch_lockon
‪function watch_lockon(localClientNum)
Definition: multilockapguidance.csc:46
‪player_init
‪function player_init()
Definition: multilockapguidance.csc:33
‪AP_TARGET_SUSPEND
‪#define AP_TARGET_SUSPEND
Definition: antipersonnelguidance.gsh:17
‪REGISTER_SYSTEM
‪#define REGISTER_SYSTEM(__sys, __func_init_preload, __reqs)
Definition: shared.gsh:204
‪AP_OUTLINE_MATERIAL
‪#define AP_OUTLINE_MATERIAL
Definition: multilockapguidance.csc:20
‪__init__
‪function __init__()
Definition: multilockapguidance.csc:22
‪set_dr_filter_offscreen
‪function set_dr_filter_offscreen(name, priority, require_flags, refuse_flags, drtype1, drval1, drcull1, drtype2, drval2, drcull2, drtype3, drval3, drcull3)
Definition: duplicaterender_mgr.csc:177
‪AP_TARGET_LOCKING
‪#define AP_TARGET_LOCKING
Definition: antipersonnelguidance.gsh:15
‪change_dr_flags
‪function change_dr_flags(localClientNum, toset, toclear)
Definition: duplicaterender_mgr.csc:289