‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_character_customization.csc
Go to the documentation of this file.
1 #using scripts\core\_multi_extracam;
2 
3 #using scripts\codescripts\struct;
4 #using scripts\shared\abilities\gadgets\_gadget_camo_render;
5 #using scripts\shared\animation_shared;
6 #using scripts\shared\duplicaterender_mgr;
7 #using scripts\shared\end_game_taunts;
8 #using scripts\shared\filter_shared;
9 #using scripts\shared\scene_shared;
10 #using scripts\shared\system_shared;
11 #using scripts\shared\util_shared;
12 #using scripts\shared\array_shared;
13 
14 #insert scripts\shared\shared.gsh;
15 #insert scripts\shared\duplicaterender.gsh;
16 #insert scripts\shared\weapons\weapon_group_anims.gsh;
17 
18 #namespace character_customization;
19 
20 #define HERO_HELMET_BONE ""
21 #define HERO_HEAD_BONE ""
22 #define HERO_WEAPON_BONE "tag_weapon_right"
23 #define HERO_CUSTOMIZE_IDLE_ANIM "pb_cac_main_lobby_idle"
24 #define HERO_LOBBY_CLIENT_IDLE_ANIM "pb_cac_vs_screen_idle_1"
25 #define RS_ROTATION_SPEED_MULTIPLIER 3.0
26 
27 #define HERO_MESH_LODS STREAM_LOD_HIGHEST
28 #define HERO_TEXTURE_LODS STREAM_MIP_EXCLUDE_HIGHEST
29 
30 #define HELMET_MESH_LODS STREAM_LOD_HIGHEST
31 #define HELMET_TEXTURE_LODS STREAM_MIP_EXCLUDE_HIGHEST
32 
33 #define HEAD_MESH_LODS STREAM_LOD_HIGHEST
34 #define HEAD_TEXTURE_LODS STREAM_MIP_EXCLUDE_HIGHEST
35 
36 #define LIVE_CHARACTER_SPAWN_TARGET "character_customization"
37 #define DEFAULT_LIVE_CHARACTER_EXPLODER "char_customization"
38 
39 #define SHOWCASE_WEAPON_PAINTSHOP_CLASS 1
40 #define LOCAL_WEAPON_PAINTSHOP_CLASS 2
41 
42 #using_animtree("all_player");
43 
44 ‪REGISTER_SYSTEM( "character_customization", &‪__init__, undefined )
45 
46 // SETUP
49 function ‪__init__()
50 {
51  level.extra_cam_render_hero_func_callback = &‪process_character_extracam_request;
52  level.extra_cam_render_lobby_client_hero_func_callback = &‪process_lobby_client_character_extracam_request;
53  level.extra_cam_render_current_hero_headshot_func_callback = &‪process_current_hero_headshot_extracam_request;
54  level.extra_cam_render_outfit_preview_func_callback = &‪process_outfit_preview_extracam_request;
55  level.extra_cam_render_character_body_item_func_callback = &‪process_character_body_item_extracam_request;
56  level.extra_cam_render_character_helmet_item_func_callback = &‪process_character_helmet_item_extracam_request;
57  level.extra_cam_render_character_head_item_func_callback = &‪process_character_head_item_extracam_request;
58  level.model_type_bones = associativearray( "helmet", ‪HERO_HELMET_BONE, "head", ‪HERO_HEAD_BONE );
59 
60  ‪DEFAULT( level.liveCCData, [] );
61  ‪DEFAULT( level.custom_characters, [] );
62  ‪DEFAULT( level.extra_cam_hero_data, [] );
63  ‪DEFAULT( level.extra_cam_lobby_client_hero_data, [] );
64  ‪DEFAULT( level.extra_cam_headshot_hero_data, [] );
65  ‪DEFAULT( level.extra_cam_outfit_preview_data, [] );
66 
67  level.characterCustomizationSetup = &‪localClientConnect;
68 }
69 
70 function ‪localClientConnect( localClientNum )
71 {
72  // setup our live and static characters
73  level.liveCCData[localClientNum] = ‪setup_live_character_customization_target( localClientNum );
74  if( IsDefined( level.liveCCData[localClientNum] ) )
75  {
76  ‪setup_character_streaming( level.liveCCData[localClientNum] );
77  }
78 
79  level.staticCCData = ‪setup_static_character_customization_target( localClientNum );
80 }
81 
82 function ‪create_character_data_struct( characterModel, localClientNum, alt_render_mode = true )
83 {
84  if ( !isdefined( characterModel ) )
85  {
86  return undefined;
87  }
88 
89  ‪DEFAULT( level.custom_characters[localClientNum], [] );
90 
91  if ( isdefined( level.custom_characters[localClientNum][characterModel.targetname] ) )
92  {
93  return level.custom_characters[localClientNum][characterModel.targetname];
94  }
95 
96  data_struct = SpawnStruct();
97  level.custom_characters[localClientNum][characterModel.targetname] = data_struct;
98 
99  // models
100  data_struct.characterModel = characterModel;
101  data_struct.attached_model_anims = ‪array();
102  data_struct.attached_models = ‪array();
103  data_struct.attached_entities = ‪array();
104  data_struct.origin = characterModel.origin;
105  data_struct.angles = characterModel.angles;
106 
107  // indices
108  data_struct.characterIndex = 0;
109  data_struct.characterMode = ‪SESSIONMODE_INVALID;
110  data_struct.splitScreenClient = undefined;
111 
112  data_struct.bodyIndex = 0;
113  data_struct.bodyColors = ‪array( 0, 0, 0 );
114 
115  data_struct.helmetIndex = 0;
116  data_struct.helmetColors = ‪array( 0, 0, 0 );
117 
118  data_struct.headIndex = 0;
119 
120  data_struct.align_target = undefined;
121  data_struct.currentAnimation = undefined;
122  data_struct.currentScene = undefined;
123 
124  // render options
125  data_struct.body_render_options = GetCharacterBodyRenderOptions( 0, 0, 0, 0, 0 );
126  data_struct.helmet_render_options = GetCharacterHelmetRenderOptions( 0, 0, 0, 0, 0 );
127  data_struct.head_render_options = GetCharacterHeadRenderOptions( 0 );
128  data_struct.mode_render_options = GetCharacterModeRenderOptions( 0 );
129  data_struct.alt_render_mode = alt_render_mode;
130 
131  // menu options
132  data_struct.useFrozenMomentAnim = false;
133  data_struct.frozenMomentStyle = "weapon";
134  data_struct.show_helmets = true;
135  data_struct.allow_showcase_weapons = false;
136 
137  data_struct.force_prologue_body = false;
138  if ( SessionModeIsCampaignGame() )
139  {
140  highestMapReached = GetDStat( localClientNum, "highestMapReached" );
141  data_struct.force_prologue_body = ( !isdefined(highestMapReached) || highestMapReached == 0 ) && GetDvarString( "mapname" ) == "core_frontend";
142  }
143 
144  characterModel SetHighDetail( true, data_struct.alt_render_mode );
145  return data_struct;
146 }
147 
148 function ‪handle_forced_streaming( game_mode )
149 {
150  return; // MJD - disable all forcing
151 
152  heroes = GetHeroes( game_mode );
153  foreach( hero in heroes )
154  {
155  bodies = GetHeroBodyModelIndices( hero, game_mode );
156  helmets = GetHeroHelmetModelIndices( hero, game_mode );
157  foreach( helmet in helmets )
158  {
159  ForceStreamXModel( helmet, ‪HELMET_MESH_LODS, ‪HELMET_TEXTURE_LODS );
160  }
161  foreach( body in bodies )
162  {
163  ForceStreamXModel( body, ‪HERO_MESH_LODS, ‪HERO_TEXTURE_LODS );
164  }
165  }
166 
167  heads = GetHeroHeadModelIndices( game_mode );
168  foreach( head in heads )
169  {
170  ForceStreamXModel( head, ‪HEAD_MESH_LODS, ‪HEAD_TEXTURE_LODS );
171  }
172 }
173 
175 // UTILITY
177 
178 // supported "params" fields: align_struct, anim_name, weapon_left, weapon_right, scene, extracam_data
179 function ‪loadEquippedCharacterOnModel( localClientNum, data_struct, characterIndex, params )
180 {
181  assert( isdefined( data_struct ) );
182 
183  data_lcn = ‪VAL( data_struct.splitScreenClient, localClientNum );
184 
185  if( !isdefined( characterIndex ) )
186  {
187  characterIndex = GetEquippedHeroIndex( data_lcn, params.sessionMode );
188  }
189 
190  defaultIndex = undefined;
191 
192  if ( ‪IS_TRUE( params.isDefaultHero ) )
193  {
194  defaultIndex = 0;
195  }
196 
197  ‪set_character( data_struct, characterIndex );
198 
199  characterMode = params.sessionMode;
200  ‪set_character_mode( data_struct, characterMode );
201 
202 
203  body = ‪get_character_body( data_lcn, characterMode, characterIndex, params.extracam_data );
204  bodyColors = ‪get_character_body_colors( data_lcn, characterMode, characterIndex, body, params.extracam_data );
205  ‪set_body( data_struct, characterMode, characterIndex, body, bodyColors );
206 
207  head = ‪character_customization::get_character_head( data_lcn, characterMode, params.extracam_data );
208  ‪set_head( data_struct, characterMode, head );
209 
210  helmet = ‪get_character_helmet( data_lcn, characterMode, characterIndex, params.extracam_data );
211  helmetColors = ‪get_character_helmet_colors( data_lcn, characterMode, data_struct.characterIndex, helmet, params.extracam_data );
212  ‪set_helmet( data_struct, characterMode, characterIndex, helmet, helmetColors );
213 
214 
215  if ( ‪IS_TRUE( data_struct.allow_showcase_weapons ) )
216  {
217  showcaseWeapon = ‪get_character_showcase_weapon( data_lcn, characterMode, characterIndex, params.extracam_data );
218  ‪set_showcase_weapon( data_struct, characterMode, data_lcn, undefined, characterIndex, showcaseWeapon.weaponName, showcaseWeapon.attachmentInfo, showcaseWeapon.weaponRenderOptions, false, true );
219  }
220 
221  return ‪update( localClientNum, data_struct, params );
222 }
223 
224 #using_animtree("generic");
225 #define ANIM_NOTIFY "_anim_notify_"
226 
227 function ‪update_model_attachment( localClientNum, data_struct, attached_model, slot, model_anim, model_intro_anim, force_update )
228 {
229  assert( isdefined( data_struct.attached_models ) );
230  assert( isdefined( data_struct.attached_model_anims ) );
231  assert( isdefined( level.model_type_bones ) );
232 
233  if ( force_update || attached_model !== data_struct.attached_models[slot] || model_anim !== data_struct.attached_model_anims[slot] )
234  {
235  bone = slot;
236  if ( isdefined( level.model_type_bones[slot] ) )
237  {
238  bone = level.model_type_bones[slot];
239  }
240 
241  assert( isdefined( bone ) );
242 
243  if ( isdefined( data_struct.attached_models[slot] ) )
244  {
245  if ( isDefined(data_struct.attached_entities[slot]) )
246  {
247  data_struct.attached_entities[slot] Unlink();
248  data_struct.attached_entities[slot] Delete();
249  data_struct.attached_entities[slot] = undefined;
250  }
251  else
252  {
253  if( data_struct.characterModel IsAttached( data_struct.attached_models[slot], bone ) )
254  {
255  data_struct.characterModel Detach( data_struct.attached_models[slot], bone );
256  }
257  }
258 
259  data_struct.attached_models[slot] = undefined;
260  }
261 
262  data_struct.attached_models[slot] = attached_model;
263  if ( isdefined( data_struct.attached_models[slot] ) )
264  {
265  if ( isDefined(model_anim) )
266  {
267  ent = ‪Spawn( localClientNum, data_struct.characterModel.origin, "script_model" );
268  ent SetHighDetail( true, data_struct.alt_render_mode );
269  data_struct.attached_entities[slot] = ent;
270  ent SetModel( data_struct.attached_models[slot] );
271  if ( !ent HasAnimTree() )
272  {
273  ent UseAnimTree( #animtree );
274  }
275 
276  ent.origin = data_struct.characterModel.origin;
277  ent.angles = data_struct.characterModel.angles;
278  ent.chosenOrigin = ent.origin;
279  ent.chosenAngles = ent.angles;
280  ent thread ‪play_intro_and_animation( model_intro_anim, model_anim, true );
281  }
282  else
283  {
284  if ( !data_struct.characterModel IsAttached( data_struct.attached_models[slot], bone ) )
285  {
286  data_struct.characterModel Attach( data_struct.attached_models[slot], bone );
287  }
288  }
289 
290  data_struct.attached_model_anims[slot] = model_anim;
291  }
292  }
293 
294  // Need to set the customization since it could have changed without changing attachments.
295  if ( isDefined( data_struct.attached_entities[slot] ) )
296  data_struct.attached_entities[slot] SetBodyRenderOptions( data_struct.mode_render_options, data_struct.body_render_options, data_struct.helmet_render_options, data_struct.head_render_options );
297 }
298 
299 function ‪set_character( data_struct, characterIndex )
300 {
301  data_struct.characterIndex = characterIndex;
302 }
303 
304 function ‪set_character_mode( data_struct, characterMode )
305 {
306  assert( isdefined( characterMode ) );
307  data_struct.characterMode = characterMode;
308  data_struct.mode_render_options = GetCharacterModeRenderOptions( characterMode );
309 }
310 
311 function ‪set_body( data_struct, mode, characterIndex, bodyIndex, bodyColors )
312 {
313  assert( isdefined( mode ) );
314  assert( mode != ‪SESSIONMODE_INVALID );
315 
316  if ( mode == ‪SESSIONMODE_CAMPAIGN && ‪IS_TRUE(data_struct.force_prologue_body) )
317  {
318  bodyIndex = 1; // force pbt_cp_male_body_01_prologue or pbt_cp_female_body_01_prologue since we're not cyber yet
319  }
320 
321  data_struct.bodyIndex = bodyIndex;
322  data_struct.bodyModel = GetCharacterBodyModel( characterIndex, bodyIndex, mode );
323 
324  if( isdefined( data_struct.bodyModel ) )
325  {
326  data_struct.characterModel SetModel( data_struct.bodyModel );
327  }
328 
329  if( isdefined( bodyColors ) )
330  {
331  ‪set_body_colors( data_struct, mode, bodyColors );
332  }
333 
334  render_options = GetCharacterBodyRenderOptions( data_struct.characterIndex, data_struct.bodyIndex, data_struct.bodyColors[0], data_struct.bodyColors[1], data_struct.bodyColors[2] );
335  data_struct.body_render_options = render_options;
336 }
337 
338 function ‪set_body_colors( data_struct, mode, bodyColors )
339 {
340  for( i = 0; i < bodyColors.size && i < bodyColors.size; i++ )
341  {
342  ‪set_body_color( data_struct, i, bodyColors[ i ] );
343  }
344 }
345 
346 function ‪set_body_color( data_struct, colorSlot, colorIndex )
347 {
348  data_struct.bodyColors[ colorSlot ] = colorIndex;
349 
350  render_options = GetCharacterBodyRenderOptions( data_struct.characterIndex, data_struct.bodyIndex, data_struct.bodyColors[0], data_struct.bodyColors[1], data_struct.bodyColors[2] );
351  data_struct.body_render_options = render_options;
352 }
353 
354 function ‪set_head( data_struct, mode, headIndex )
355 {
356  data_struct.headIndex = headIndex;
357  data_struct.headModel = GetCharacterHeadModel( headIndex, mode );
358 
359  render_options = GetCharacterHeadRenderOptions( headIndex );
360  data_struct.head_render_options = render_options;
361 }
362 
363 function ‪set_helmet( data_struct, mode, characterIndex, helmetIndex, helmetColors )
364 {
365  data_struct.helmetIndex = helmetIndex;
366  data_struct.helmetModel = GetCharacterHelmetModel( characterIndex, helmetIndex, mode );
367 
368  ‪set_helmet_colors( data_struct, helmetColors );
369 }
370 
371 function ‪set_showcase_weapon( data_struct, mode, localClientNum, xuid, characterIndex, showcaseWeaponName, showcaseWeaponAttachmentInfo, weaponRenderOptions, useShowcasePaintjob, useLocalPaintshop )
372 {
373  if ( isdefined( xuid ) )
374  {
375  SetShowcaseWeaponPaintshopXUID( localClientNum, xuid );
376  }
377  else
378  {
379  SetShowcaseWeaponPaintshopXUID( localClientNum );
380  }
381 
382  data_struct.showcaseWeaponName = showcaseWeaponName;
383  data_struct.showcaseWeaponModel = GetWeaponWithAttachments( showcaseWeaponName );
384 
385  if ( data_struct.showcaseWeaponModel == GetWeapon( "none" ) )
386  {
387  // Fallback in case there is no weapon.
388  data_struct.showcaseWeaponModel = GetWeapon( "ar_standard" );
389  data_struct.showcaseWeaponName = data_struct.showcaseWeaponModel.name;
390  }
391 
392  attachmentNames = [];
393  attachmentIndices = [];
394  tokenizedAttachmentInfo = strtok( showcaseWeaponAttachmentInfo, "," );
395  for ( index = 0; index + 1 < tokenizedAttachmentInfo.size; index += 2 )
396  {
397  attachmentNames[ attachmentNames.size ] = tokenizedAttachmentInfo[ index ];
398  attachmentIndices[ attachmentIndices.size ] = int( tokenizedAttachmentInfo[ index + 1 ] );
399  }
400  for ( index = tokenizedAttachmentInfo.size; index + 1 < 16; index += 2 )
401  {
402  attachmentNames[ attachmentNames.size ] = "none";
403  attachmentIndices[ attachmentIndices.size ] = 0;
404  }
405  data_struct.acvi = GetAttachmentCosmeticVariantIndexes( data_struct.showcaseWeaponModel,
406  attachmentNames[ 0 ], attachmentIndices[ 0 ],
407  attachmentNames[ 1 ], attachmentIndices[ 1 ],
408  attachmentNames[ 2 ], attachmentIndices[ 2 ],
409  attachmentNames[ 3 ], attachmentIndices[ 3 ],
410  attachmentNames[ 4 ], attachmentIndices[ 4 ],
411  attachmentNames[ 5 ], attachmentIndices[ 5 ],
412  attachmentNames[ 6 ], attachmentIndices[ 6 ],
413  attachmentNames[ 7 ], attachmentIndices[ 7 ] );
414 
415  camoIndex = 0;
418  showPaintshop = false;
419  tokenizedWeaponRenderOptions = strtok( weaponRenderOptions, "," );
420  if ( tokenizedWeaponRenderOptions.size > 2 )
421  {
422  camoIndex = int( tokenizedWeaponRenderOptions[ 0 ] );
423  paintjobSlot = int( tokenizedWeaponRenderOptions[ 1 ] );
424  paintjobIndex = int( tokenizedWeaponRenderOptions[ 2 ] );
425  showPaintshop = paintjobSlot != ‪CUSTOMIZATION_INVALID_PAINTJOB_SLOT && paintjobIndex != ‪CUSTOMIZATION_INVALID_PAINTJOB_INDEX;
426  }
427 
428  paintshopClassType = 0;
429  if ( useShowcasePaintjob )
430  {
431  paintshopClassType = ‪SHOWCASE_WEAPON_PAINTSHOP_CLASS;
432  }
433  else if ( useLocalPaintshop )
434  {
435  paintshopClassType = ‪LOCAL_WEAPON_PAINTSHOP_CLASS;
436  }
437  data_struct.weaponRenderOptions = CalcWeaponOptions( localClientNum, camoIndex, 0, 0, false, false, showPaintshop, paintshopClassType );
438 
439  weapon_root_name = data_struct.showcaseWeaponModel.rootWeapon.name;
440  weapon_is_dual_wield = data_struct.showcaseWeaponModel.isdualwield;
441  weapon_group = GetItemGroupForWeaponName( weapon_root_name );
442 
443  if ( weapon_group == "weapon_launcher" )
444  {
445  if ( weapon_root_name == "launcher_lockonly" ||
446  weapon_root_name == "launcher_multi" )
447  {
448  weapon_group = "weapon_launcher_alt";
449  }
450  else if ( weapon_root_name == "launcher_ex41" )
451  {
452  weapon_group = "weapon_smg_ppsh";
453  }
454  }
455  else if ( weapon_group == "weapon_pistol" && weapon_is_dual_wield )
456  {
457  weapon_group = "weapon_pistol_dw";
458  }
459  else if ( weapon_group == "weapon_smg")
460  {
461  if ( weapon_root_name == "smg_ppsh" )
462  {
463  weapon_group = "weapon_smg_ppsh";
464  }
465  }
466  else if ( weapon_group == "weapon_cqb")
467  {
468  if ( weapon_root_name == "shotgun_olympia" )
469  {
470  weapon_group = "weapon_shotgun_olympia";
471  }
472  }
473  else if ( weapon_group == "weapon_special" )
474  {
475  if ( weapon_root_name == "special_crossbow" ||
476  weapon_root_name == "special_discgun" )
477  {
478  weapon_group = "weapon_smg";
479  }
480  else if( weapon_root_name == "special_crossbow_dw" )
481  {
482  weapon_group = "weapon_pistol_dw";
483  }
484  else if( weapon_root_name == "knife_ballistic" )
485  {
486  weapon_group = "weapon_knife_ballistic";
487  }
488  }
489  else if ( weapon_group == "weapon_knife" )
490  {
491  if ( weapon_root_name == "melee_knuckles" ||
492  weapon_root_name == "melee_boxing" )
493  {
494  weapon_group = "weapon_knuckles";
495  }
496  else if ( weapon_root_name == "melee_chainsaw" ||
497  weapon_root_name == "melee_boneglass" ||
498  weapon_root_name == "melee_crescent" )
499  {
500  weapon_group = "weapon_chainsaw";
501  }
502  else if ( weapon_root_name == "melee_improvise" ||
503  weapon_root_name == "melee_shovel" )
504  {
505  weapon_group = "weapon_improvise";
506  }
507  else if ( weapon_root_name == "melee_wrench" ||
508  weapon_root_name == "melee_crowbar" ||
509  weapon_root_name == "melee_shockbaton" )
510  {
511  weapon_group = "weapon_wrench";
512  }
513  else if ( weapon_root_name == "melee_nunchuks" )
514  {
515  weapon_group = "weapon_nunchucks";
516  }
517  else if ( weapon_root_name == "melee_sword" ||
518  weapon_root_name == "melee_bat" ||
519  weapon_root_name == "melee_fireaxe" ||
520  weapon_root_name == "melee_mace" ||
521  weapon_root_name == "melee_katana" )
522  {
523  weapon_group = "weapon_sword";
524  }
525  else if ( weapon_root_name == "melee_prosthetic" )
526  {
527  weapon_group = "weapon_prosthetic";
528  }
529  }
530  else if ( weapon_group == "miscweapon" )
531  {
532  if ( weapon_root_name == "blackjack_coin" )
533  {
534  weapon_group = "brawler";
535  }
536  else if ( weapon_root_name == "blackjack_cards" )
537  {
538  weapon_group = "brawler";
539  }
540  }
541 
542  if ( data_struct.characterMode === ‪SESSIONMODE_ZOMBIES )
543  {
544  data_struct.anim_name = ‪INSPECTION_POSE_ZM;
545  }
546  else if ( isdefined( ‪WEAPON_GROUP_FRONTEND_ANIMS[ weapon_group ] ) )
547  {
548  data_struct.anim_name = ‪WEAPON_GROUP_FRONTEND_ANIMS[ weapon_group ];
549  }
550 }
551 
552 
553 function ‪set_helmet_colors( data_struct, colors )
554 {
555  for ( i = 0; i < colors.size && i < data_struct.helmetColors.size; i++ )
556  {
557  ‪set_helmet_color( data_struct, i, colors[ i ] );
558  }
559 
560  render_options = GetCharacterHelmetRenderOptions( data_struct.characterIndex, data_struct.helmetIndex, data_struct.helmetColors[0], data_struct.helmetColors[1], data_struct.helmetColors[2] );
561  data_struct.helmet_render_options = render_options;
562 }
563 
564 function ‪set_helmet_color( data_struct, colorSlot, colorIndex )
565 {
566  data_struct.helmetColors[ colorSlot ] = colorIndex;
567 
568  render_options = GetCharacterHelmetRenderOptions( data_struct.characterIndex, data_struct.helmetIndex, data_struct.helmetColors[0], data_struct.helmetColors[1], data_struct.helmetColors[2] );
569  data_struct.helmet_render_options = render_options;
570 }
571 
572 function ‪update( localClientNum, data_struct, params )
573 {
574  data_struct.characterModel SetBodyRenderOptions( data_struct.mode_render_options, data_struct.body_render_options, data_struct.helmet_render_options, data_struct.head_render_options );
575 
576  helmet_model = "tag_origin";
577 
578  show_helmet = data_struct.show_helmets && ( !isdefined( params ) || !‪IS_TRUE( params.hide_helmet ) );
579  if ( show_helmet )
580  {
581  helmet_model = data_struct.helmetModel;
582  }
583 
584  ‪update_model_attachment( localClientNum, data_struct, helmet_model, "helmet", undefined, undefined, true );
585 
586  head_model = data_struct.headModel;
587  if ( show_helmet && isdefined( params ) && GetCharacterHelmetHidesHead( data_struct.characterIndex, data_struct.helmetIndex, ‪VAL( params.sessionMode, data_struct.characterMode ) ) )
588  {
589  assert( helmet_model != "tag_origin" );
590  head_model = "tag_origin";
591  }
592  ‪update_model_attachment( localClientNum, data_struct, head_model, "head", undefined, undefined, true );
593 
594  changed = ‪update_character_animation_and_attachments( localClientNum, data_struct, params );
595 
596  // Used by epic taunts to clone the model and match skins
597  data_struct.characterModel.bodyModel = data_struct.bodyModel;
598  data_struct.characterModel.helmetModel = data_struct.helmetModel;
599  data_struct.characterModel.modeRenderOptions = data_struct.mode_render_options;
600  data_struct.characterModel.bodyRenderOptions = data_struct.body_render_options;
601  data_struct.characterModel.helmetRenderOptions = data_struct.helmet_render_options;
602  data_struct.characterModel.headRenderOptions = data_struct.head_render_options;
603 
604  return changed;
605 }
606 
607 function ‪is_character_streamed( data_struct )
608 {
609  if( isDefined( data_struct.characterModel ) )
610  {
611  if( !( data_struct.characterModel isStreamed() ) )
612  {
613  return false;
614  }
615  }
616 
617  foreach( ent in data_struct.attached_entities )
618  {
619  if( isDefined( ent ) )
620  {
621  if( !( ent isStreamed() ) )
622  {
623  return false;
624  }
625  }
626  }
627 
628  return true;
629 }
630 
631 function ‪setup_character_streaming( data_struct )
632 {
633  // init, force high detail
634  if( isDefined( data_struct.characterModel ) )
635  {
636  data_struct.characterModel SetHighDetail( true, data_struct.alt_render_mode );
637  }
638 
639  foreach( ent in data_struct.attached_entities )
640  {
641  if( isDefined( ent ) )
642  {
643  ent SetHighDetail( true, data_struct.alt_render_mode );
644  }
645  }
646 }
647 
648 function ‪get_character_mode( localClientNum )
649 {
650  return GetEquippedHeroMode( localClientNum );
651 }
652 
653 function ‪get_character_body( localClientNum, characterMode, characterIndex, extracamData )
654 {
655  assert( isdefined( characterIndex ) );
656 
657  if ( characterMode === ‪SESSIONMODE_CAMPAIGN && SessionModeIsCampaignGame() && GetDvarString( "mapname" ) == "core_frontend" )
658  {
659  mapIndex = GetDStat( localClientNum, "highestMapReached" );
660  if ( isDefined( mapindex ) && mapIndex < 1) //robot after ethiopia mission
661  {
662  str_gender = GetHeroGender( GetEquippedHeroIndex( localClientNum, ‪SESSIONMODE_CAMPAIGN ), "cp" );
663  n_body_id = GetCharacterBodyStyleIndex( str_gender=="female", "CPUI_OUTFIT_PROLOGUE" );
664  return n_body_id;//always the flesh body in the frontend for cp - user edits body in safehouse
665  }
666  }
667 
668  if( isdefined( extracamData ) && ‪IS_TRUE(extracamData.isDefaultHero) )
669  {
670  return 0;
671  }
672  else if( isdefined( extracamData ) && extracamData.useLobbyPlayers )
673  {
674  return GetEquippedBodyIndexForHero( localClientNum, characterMode, extracamData.jobIndex, true );
675  }
676  else if ( isdefined( extracamData ) && isdefined( extracamData.useBodyIndex ) )
677  {
678  return extracamData.useBodyIndex;
679  }
680  else if ( isdefined( extracamData ) && ‪IS_TRUE( extracamData.defaultImageRender ) )
681  {
682  return 0;
683  }
684  else
685  {
686  return GetEquippedBodyIndexForHero( localClientNum, characterMode, characterIndex );
687  }
688 }
689 
690 function ‪get_character_body_color( localClientNum, characterMode, characterIndex, bodyIndex, colorSlot, extracamData )
691 {
692  if( isdefined( extracamData ) && ‪IS_TRUE(extracamData.isDefaultHero) )
693  {
694  return 0;
695  }
696  else if( isdefined( extracamData ) && extracamData.useLobbyPlayers )
697  {
698  return GetEquippedBodyAccentColorForHero( localClientNum, characterMode, extracamData.jobIndex, bodyIndex, colorSlot, true );
699  }
700  else if ( isdefined( extracamData ) && ‪IS_TRUE( extracamData.defaultImageRender ) )
701  {
702  return 0;
703  }
704  else
705  {
706  return GetEquippedBodyAccentColorForHero( localClientNum, characterMode, characterIndex, bodyIndex, colorSlot );
707  }
708 }
709 
710 function ‪get_character_body_colors( localClientNum, characterMode, characterIndex, bodyIndex, extracamData )
711 {
712  bodyAccentColorCount = GetBodyAccentColorCountForHero( localClientNum, characterMode, characterIndex, bodyIndex );
713 
714  colors = [];
715  for( i = 0; i < 3; i++ )
716  {
717  colors[ i ] = 0;
718  }
719 
720  for( i = 0; i < bodyAccentColorCount; i++ )
721  {
722  colors[ i ] = ‪get_character_body_color( localClientNum, characterMode, characterIndex, bodyIndex, i, extracamData );
723  }
724 
725  return colors;
726 }
727 
728 function ‪get_character_head( localClientNum, characterMode, extracamData )
729 {
730  if( isdefined( extracamData ) && ‪IS_TRUE(extracamData.isDefaultHero) )
731  {
732  return 0;
733  }
734  else if ( isdefined( extracamData ) && extracamData.useLobbyPlayers )
735  {
736  return GetEquippedHeadIndexForHero( localClientNum, characterMode, extracamData.jobIndex );
737  }
738  else if ( isdefined( extracamData ) && isdefined( extracamData.useHeadIndex ) )
739  {
740  return extracamData.useHeadIndex;
741  }
742  else if ( isdefined( extracamData ) && ‪IS_TRUE( extracamData.defaultImageRender ) )
743  {
744  return 0;
745  }
746  else
747  {
748  return GetEquippedHeadIndexForHero( localClientNum, characterMode );
749  }
750 }
751 
752 function ‪get_character_helmet( localClientNum, characterMode, characterIndex, extracamData )
753 {
754  if( isdefined( extracamData ) && ‪IS_TRUE(extracamData.isDefaultHero) )
755  {
756  return 0;
757  }
758  else if ( isdefined( extracamData ) && extracamData.useLobbyPlayers )
759  {
760  return GetEquippedHelmetIndexForHero( localClientNum, characterMode, extracamData.jobIndex, true );
761  }
762  else if ( isdefined( extracamData ) && isdefined( extracamData.useHelmetIndex ) )
763  {
764  return extracamData.useHelmetIndex;
765  }
766  else if ( isdefined( extracamData ) && ‪IS_TRUE( extracamData.defaultImageRender ) )
767  {
768  return 0;
769  }
770  else
771  {
772  return GetEquippedHelmetIndexForHero( localClientNum, characterMode, characterIndex );
773  }
774 }
775 
776 function ‪get_character_showcase_weapon( localClientNum, characterMode, characterIndex, extracamData )
777 {
778  if( isdefined( extracamData ) && ‪IS_TRUE(extracamData.isDefaultHero) )
779  {
780  return undefined;
781  }
782  else if ( isdefined( extracamData ) && extracamData.useLobbyPlayers )
783  {
784  return GetEquippedShowcaseWeaponForHero( localClientNum, characterMode, extracamData.jobIndex, true );
785  }
786  else if ( isdefined( extracamData ) && isdefined( extracamData.useShowcaseWeapon ) )
787  {
788  return extracamData.useShowcaseWeapon;
789  }
790  else
791  {
792  return GetEquippedShowcaseWeaponForHero( localClientNum, characterMode, characterIndex );
793  }
794 }
795 
796 function ‪get_character_helmet_color( localClientNum, characterMode, characterIndex, helmetIndex, colorSlot, extracamData )
797 {
798  if( isdefined( extracamData ) && ‪IS_TRUE(extracamData.isDefaultHero) )
799  {
800  return 0;
801  }
802  else if ( isdefined( extracamData ) && extracamData.useLobbyPlayers )
803  {
804  return GetEquippedHelmetAccentColorForHero( localClientNum, characterMode, extracamData.jobIndex, helmetIndex, colorSlot, true );
805  }
806  else if ( isdefined( extracamData ) && ‪IS_TRUE( extracamData.defaultImageRender ) )
807  {
808  return 0;
809  }
810  else
811  {
812  return GetEquippedHelmetAccentColorForHero( localClientNum, characterMode, characterIndex, helmetIndex, colorSlot );
813  }
814 }
815 
816 function ‪get_character_helmet_colors( localClientNum, characterMode, characterIndex, helmetIndex, extracamData )
817 {
818  helmetColorCount = GetHelmetAccentColorCountForHero( localClientNum, characterMode, characterIndex, helmetIndex );
819 
820  colors = [];
821  for( i = 0; i < 3; i++ )
822  {
823  colors[ i ] = 0;
824  }
825 
826  for( i = 0; i < helmetColorCount; i++ )
827  {
828  colors[ i ] = ‪get_character_helmet_color( localClientNum, characterMode, characterIndex, helmetIndex, i, extracamData );
829  }
830 
831  return colors;
832 }
833 
834 #using_animtree("all_player");
836 {
837  if ( !characterModel HasAnimTree() )
838  {
839  characterModel UseAnimTree( #animtree );
840  }
841 }
842 
843 function ‪reaper_body3_hack( params )
844 {
845  if ( IsDefined(params.weapon_right) && params.weapon_right == "wpn_t7_hero_reaper_minigun_prop" && isDefined( level.mp_lobby_data_struct.characterModel ) && IsSubStr(level.mp_lobby_data_struct.characterModel.model, "body3") )
846  {
847  params.weapon_right = "wpn_t7_loot_hero_reaper3_minigun_prop";
848  params.weapon = GetWeapon("hero_minigun_body3");
849  return true;
850  }
851  return false;
852 }
853 
854 function ‪get_current_frozen_moment_params( localClientNum, data_struct, params )
855 {
856  fields = GetCharacterFields( data_struct.characterIndex, data_struct.characterMode );
857 
858  if ( data_struct.frozenMomentStyle == "weapon" )
859  {
860  ‪SET_IF_DEFINED( params.anim_name, fields.weaponFrontendFrozenMomentXAnim );
861  params.scene = undefined;
862  ‪SET_IF_DEFINED( params.weapon_left, fields.weaponFrontendFrozenMomentWeaponLeftModel );
863  ‪SET_IF_DEFINED( params.weapon_left_anim, fields.weaponFrontendFrozenMomentWeaponLeftAnim );
864  ‪SET_IF_DEFINED( params.weapon_right, fields.weaponFrontendFrozenMomentWeaponRightModel );
865  ‪SET_IF_DEFINED( params.weapon_right_anim, fields.weaponFrontendFrozenMomentWeaponRightAnim );
866  ‪SET_IF_DEFINED( params.exploder_id, fields.weaponFrontendFrozenMomentExploder );
867  ‪SET_IF_DEFINED( params.align_struct, ‪struct::get( fields.weaponFrontendFrozenMomentAlignTarget ) );
868  ‪SET_IF_DEFINED( params.xcam, fields.weaponFrontendFrozenMomentXCam );
869  ‪SET_IF_DEFINED( params.subXCam, fields.weaponFrontendFrozenMomentXCamSubXCam );
870  ‪SET_IF_DEFINED( params.xcamFrame, fields.weaponFrontendFrozenMomentXCamFrame );
871  }
872  else if ( data_struct.frozenMomentStyle == "ability" )
873  {
874  ‪SET_IF_DEFINED( params.anim_name, fields.abilityFrontendFrozenMomentXAnim );
875  params.scene = undefined;
876  ‪SET_IF_DEFINED( params.weapon_left, fields.abilityFrontendFrozenMomentWeaponLeftModel );
877  ‪SET_IF_DEFINED( params.weapon_left_anim, fields.abilityFrontendFrozenMomentWeaponLeftAnim );
878  ‪SET_IF_DEFINED( params.weapon_right, fields.abilityFrontendFrozenMomentWeaponRightModel );
879  ‪SET_IF_DEFINED( params.weapon_right_anim, fields.abilityFrontendFrozenMomentWeaponRightAnim );
880  ‪SET_IF_DEFINED( params.exploder_id, fields.abilityFrontendFrozenMomentExploder );
881  ‪SET_IF_DEFINED( params.align_struct, ‪struct::get( fields.abilityFrontendFrozenMomentAlignTarget ) );
882  ‪SET_IF_DEFINED( params.xcam, fields.abilityFrontendFrozenMomentXCam );
883  ‪SET_IF_DEFINED( params.subXCam, fields.abilityFrontendFrozenMomentXCamSubXCam );
884  ‪SET_IF_DEFINED( params.xcamFrame, fields.abilityFrontendFrozenMomentXCamFrame );
885  }
886 
887  ‪reaper_body3_hack( params );
888 
889  if ( !isdefined( params.align_struct ) )
890  {
891  params.align_struct = data_struct; // moves the character back to their original position
892  }
893 }
894 
895 function ‪play_intro_and_animation( intro_anim_name, anim_name, b_keep_link )
896 {
897  self notify( "stop_vignette_animation" );
898  self endon( "stop_vignette_animation" );
899 
900  if ( isdefined(intro_anim_name) )
901  {
902  self ‪animation::play( intro_anim_name, self.chosenOrigin, self.chosenAngles, 1, 0, 0, 0, b_keep_link );
903  }
904  self ‪animation::play( anim_name, self.chosenOrigin, self.chosenAngles, 1, 0, 0, 0, b_keep_link );
905 }
906 
908 {
909  if ( !isdefined( params.weapon_right ) && !isdefined( params.weapon_left ) )
910  {
911  if ( isdefined( data_struct.anim_name ) )
912  {
913  params.anim_name = data_struct.anim_name;
914  }
915  }
916 }
917 
918 function ‪update_character_animation_and_attachments( localClientNum, data_struct, params )
919 {
920  changed = false;
921 
922  if ( !isdefined( params ) )
923  {
924  params = SpawnStruct();
925  }
926 
927  if ( data_struct.useFrozenMomentAnim && isdefined( data_struct.frozenMomentStyle ) )
928  {
929  ‪get_current_frozen_moment_params( localClientNum, data_struct, params );
930  }
931 
932  if ( !isdefined( params.exploder_id ) )
933  {
934  params.exploder_id = data_struct.default_exploder;
935  }
936 
937  align_changed = false;
938  ‪DEFAULT( params.align_struct, ‪struct::get( data_struct.align_target ) );
939  ‪DEFAULT( params.align_struct, data_struct );
940  if ( isdefined( params.align_struct ) && ( params.align_struct.origin !== data_struct.characterModel.chosenOrigin || params.align_struct.angles !== data_struct.characterModel.chosenAngles ) )
941  {
942  data_struct.characterModel.chosenOrigin = params.align_struct.origin;
943  data_struct.characterModel.chosenAngles = params.align_struct.angles;
944  params.anim_name = ( isdefined( params.anim_name ) ? params.anim_name : data_struct.currentAnimation );
945  align_changed = true;
946  }
947 
948  if ( ‪IS_TRUE( data_struct.allow_showcase_weapons ) )
949  {
951  }
952 
954  {
955  align_changed = true;
956  changed = true;
957  }
958 
959  if ( IsDefined( params.weapon_right ) && params.weapon_right !== data_struct.weapon_right )
960  {
961  align_changed = true;
962  }
963 
964  if ( isdefined( params.anim_name ) && ( params.anim_name !== data_struct.currentAnimation || align_changed ) )
965  {
966  changed = true;
967 
968  ‪end_game_taunts::cancelTaunt( localClientNum, data_struct.characterModel );
969  ‪end_game_taunts::cancelGesture( data_struct.characterModel );
970 
971  data_struct.currentAnimation = params.anim_name;
972  data_struct.weapon_right = params.weapon_right;
973  if ( !data_struct.characterModel HasAnimTree() )
974  {
975  data_struct.characterModel UseAnimTree( #animtree );
976  }
977 
978  data_struct.characterModel thread ‪play_intro_and_animation( params.anim_intro_name, params.anim_name, false );
979  }
980  else if ( isdefined( params.scene ) && params.scene !== data_struct.currentScene )
981  {
982  if ( isdefined( data_struct.currentScene ) )
983  {
984  level ‪scene::stop( data_struct.currentScene, false );
985  }
986 
987  ‪update_character_animation_tree_for_scene(data_struct.characterModel);
988 
989  data_struct.currentScene = params.scene;
990  level thread ‪scene::play( params.scene );
991  }
992 
993  if ( data_struct.exploder_id !== params.exploder_id )
994  {
995  if ( isdefined( data_struct.exploder_id ) )
996  {
997  KillRadiantExploder( localClientNum, data_struct.exploder_id );
998  }
999 
1000  if ( isdefined( params.exploder_id ) )
1001  {
1002  PlayRadiantExploder( localClientNum, params.exploder_id );
1003  }
1004 
1005  data_struct.exploder_id = params.exploder_id;
1006  }
1007 
1008  if ( isdefined( params.weapon_right ) || isdefined( params.weapon_left ) )
1009  {
1010  ‪update_model_attachment( localClientNum, data_struct, params.weapon_right, "tag_weapon_right", params.weapon_right_anim, params.weapon_right_anim_intro, align_changed );
1011  ‪update_model_attachment( localClientNum, data_struct, params.weapon_left, "tag_weapon_left", params.weapon_left_anim, params.weapon_left_anim_intro, align_changed );
1012  }
1013  else if ( isdefined( data_struct.showcaseWeaponModel ) )
1014  {
1015  if( isdefined( data_struct.attached_models["tag_weapon_right"] ) && data_struct.characterModel IsAttached( data_struct.attached_models["tag_weapon_right"], "tag_weapon_right" ) )
1016  {
1017  data_struct.characterModel Detach( data_struct.attached_models["tag_weapon_right"], "tag_weapon_right" );
1018  }
1019 
1020  if( isdefined( data_struct.attached_models["tag_weapon_left"] ) && data_struct.characterModel IsAttached( data_struct.attached_models["tag_weapon_left"], "tag_weapon_left" ) )
1021  {
1022  data_struct.characterModel Detach( data_struct.attached_models["tag_weapon_left"], "tag_weapon_left" );
1023  }
1024 
1025  data_struct.characterModel AttachWeapon( data_struct.showcaseWeaponModel, data_struct.weaponRenderOptions, data_struct.acvi );
1026  data_struct.characterModel UseWeaponHideTags( data_struct.showcaseWeaponModel );
1027 
1028  data_struct.characterModel.showcaseWeapon = data_struct.showcaseWeaponModel;
1029  data_struct.characterModel.showcaseWeaponRenderOptions = data_struct.weaponRenderOptions;
1030  data_struct.characterModel.showcaseWeaponACVI = data_struct.acvi;
1031  }
1032 
1033  return changed;
1034 }
1035 
1036 function ‪update_use_frozen_moments( localClientNum, data_struct, useFrozenMoments )
1037 {
1038  if ( data_struct.useFrozenMomentAnim != useFrozenMoments )
1039  {
1040  data_struct.useFrozenMomentAnim = useFrozenMoments;
1041  params = SpawnStruct();
1042  if ( !data_struct.useFrozenMomentAnim )
1043  {
1044  params.align_struct = ‪struct::get( ‪LIVE_CHARACTER_SPAWN_TARGET );
1045  params.anim_name = ‪HERO_CUSTOMIZE_IDLE_ANIM;
1046  }
1047 
1048  MarkAsDirty( data_struct.characterModel );
1049  ‪update_character_animation_and_attachments( localClientNum, data_struct, params );
1050 
1051  if ( data_struct.useFrozenMomentAnim )
1052  {
1053  level notify( "frozenMomentChanged" + localClientNum );
1054  }
1055  }
1056 }
1057 
1058 function ‪update_show_helmets( localClientNum, data_struct, show_helmets )
1059 {
1060  if ( data_struct.show_helmets != show_helmets )
1061  {
1062  data_struct.show_helmets = show_helmets;
1063 
1064  params = SpawnStruct();
1065  params.weapon_right = data_struct.attached_models["tag_weapon_right"];
1066  params.weapon_left = data_struct.attached_models["tag_weapon_left"];
1067  ‪update( localClientNum, data_struct, params );
1068  }
1069 }
1070 
1071 function ‪set_character_align( localClientNum, data_struct, align_target )
1072 {
1073  if ( data_struct.align_target !== align_target )
1074  {
1075  data_struct.align_target = align_target;
1076 
1077  params = SpawnStruct();
1078  params.weapon_right = data_struct.attached_models["tag_weapon_right"];
1079  params.weapon_left = data_struct.attached_models["tag_weapon_left"];
1080  ‪update( localClientNum, data_struct, params );
1081  }
1082 }
1083 
1085 // LIVE CHARACTER
1087 
1089 {
1090  characterEnt = GetEnt( localClientNum, ‪LIVE_CHARACTER_SPAWN_TARGET, "targetname" );
1091 
1092  if ( isdefined( characterEnt ) )
1093  {
1094  customization_data_struct = ‪character_customization::create_character_data_struct( characterEnt, localClientNum, true );
1095  customization_data_struct.default_exploder = ‪DEFAULT_LIVE_CHARACTER_EXPLODER;
1096  customization_data_struct.allow_showcase_weapons = true;
1097  level thread ‪updateEventThread( localClientNum, customization_data_struct );
1098 
1099  return customization_data_struct;
1100  }
1101 
1102  return undefined;
1103 }
1104 
1105 function ‪update_locked_shader( localClientNum, params )
1106 {
1107  if( IsDefined( params.isItemUnlocked ) && params.isItemUnlocked != 1 )
1108  {
1109  EnableFrontendLockedWeaponOverlay( localClientNum, true );
1110  }
1111  else
1112  {
1113  EnableFrontendLockedWeaponOverlay( localClientNum, false );
1114  }
1115 }
1116 
1117 function ‪updateEventThread( localClientNum, data_struct )
1118 {
1119  while( 1 )
1120  {
1121  level waittill( "updateHero" + localClientNum, eventType, param1, param2, param3, param4 );
1122 
1123  switch( eventType )
1124  {
1125  case "update_lcn":
1126  data_struct.splitScreenClient = param1;
1127  break;
1128 
1129  case "refresh":
1130  data_struct.splitScreenClient = param1;
1131 
1132  params = spawnstruct();
1133  params.anim_name = ‪HERO_CUSTOMIZE_IDLE_ANIM;
1134  params.sessionMode = param2;
1135  ‪character_customization::loadEquippedCharacterOnModel( localClientNum, data_struct, undefined, params );
1136  if (isdefined(param3) && param3 != "")
1137  {
1138  level.mp_lobby_data_struct.playSound = param3;
1139  }
1140 
1141  break;
1142 
1143  case "changeHero":
1144  // param1 = hero index
1145  // param2 = session mode
1146  params = spawnstruct();
1147  params.anim_name = ‪HERO_CUSTOMIZE_IDLE_ANIM;
1148  params.sessionMode = param2;
1149  ‪character_customization::loadEquippedCharacterOnModel( localClientNum, data_struct, param1, params );
1150  break;
1151 
1152  case "changeBody":
1153  //param1 = new body index
1154  //param2 = session mode
1155  //param3 = is item unlocked
1156  params = spawnstruct();
1157  params.sessionMode = param2;
1158  params.isItemUnlocked = param3;
1159  ‪character_customization::set_body( data_struct, param2, data_struct.characterIndex, param1, ‪get_character_body_colors( localClientNum, param2, data_struct.characterIndex, param1 ) );
1160  ‪character_customization::update( localClientNum, data_struct, params );
1161  //update the locked shader
1162  ‪update_locked_shader( localClientNum, params );
1163  break;
1164 
1165  case "changeHelmet":
1166  //param1 = new helmet index
1167  //param2 = session mode
1168  //param3 = is item unlocked
1169  params = spawnstruct();
1170  params.sessionMode = param2;
1171  params.isItemUnlocked = param3;
1172  ‪character_customization::set_helmet( data_struct, param2, data_struct.characterIndex, param1, ‪get_character_helmet_colors( localClientNum, param2, data_struct.characterIndex, param1 ) );
1173  ‪character_customization::update( localClientNum, data_struct, params );
1174  //update the locked shader
1175  ‪update_locked_shader( localClientNum, params );
1176  break;
1177 
1178  case "changeShowcaseWeapon":
1179  //param1 = showcase weapon name
1180  //param2 = attachment info
1181  //param3 = camo and paintjob info
1182  //param4 = session mode
1183  params = spawnstruct();
1184  params.sessionMode = param4;
1185  ‪character_customization::set_showcase_weapon( data_struct, param4, localClientNum, undefined, data_struct.characterIndex, param1, param2, param3, false, true );
1186  ‪character_customization::update( localClientNum, data_struct, params );
1187  break;
1188 
1189  case "changeHead":
1190  //param1 = head index
1191  params = spawnstruct();
1192  params.sessionMode = param2;
1193  ‪character_customization::set_head( data_struct, param2, param1 );
1194  ‪character_customization::update( localClientNum, data_struct, params );
1195  break;
1196 
1197  case "changeBodyAccentColor":
1198  //param1 = accent color slot
1199  //param2 = accent color index
1200  params = spawnstruct();
1201  params.sessionMode = param3;
1202  ‪character_customization::set_body_color( data_struct, param1, param2 );
1203  ‪character_customization::update( localClientNum, data_struct, params );
1204  break;
1205 
1206  case "changeHelmetAccentColor":
1207  //param1 = accent color slot
1208  //param2 = accent color index
1209  //param3 = sessionMode
1210  params = spawnstruct();
1211  params.sessionMode = param3;
1212  ‪character_customization::set_helmet_color( data_struct, param1, param2 );
1213  ‪character_customization::update( localClientNum, data_struct, params );
1214  break;
1215 
1216  case "changeFrozenMoment":
1217  //param1 = new frozen moment type
1218  data_struct.frozenMomentStyle = param1;
1219  if ( data_struct.useFrozenMomentAnim )
1220  {
1221  MarkAsDirty( data_struct.characterModel );
1222  ‪update_character_animation_and_attachments( localClientNum, data_struct, undefined );
1223  }
1224  level notify( "frozenMomentChanged" + localClientNum );
1225  break;
1226 
1227  case "previewGesture":
1228  //param1 = new anim name
1229  data_struct.currentAnimation = param1;
1230  thread ‪end_game_taunts::previewGesture( localClientNum, data_struct.characterModel, data_struct.anim_name, param1 );
1231  break;
1232 
1233  case "previewTaunt":
1234  //param1 = new anim name
1236  {
1237  data_struct.currentAnimation = param1;
1238  thread ‪end_game_taunts::previewTaunt( localClientNum, data_struct.characterModel, data_struct.anim_name, param1 );
1239  }
1240  break;
1241  }
1242  }
1243 }
1244 
1245 function ‪rotation_thread_spawner( localClientNum, data_struct, endOnEvent )
1246 {
1247  if ( !isdefined( endOnEvent ) )
1248  {
1249  return;
1250  }
1251 
1252  assert( isdefined( data_struct.characterModel ) );
1253  model = data_struct.characterModel;
1254  baseAngles = model.angles;
1255 
1256  level thread ‪update_model_rotation_for_right_stick( localClientNum, data_struct, endOnEvent );
1257  level waittill( endOnEvent );
1258 
1259  if ( !‪IS_TRUE( data_struct.characterModel.anglesOverride ) )
1260  {
1261  model.angles = baseAngles;
1262  }
1263 }
1264 
1265 function ‪update_model_rotation_for_right_stick( localClientNum, data_struct, endOnEvent )
1266 {
1267  level endon( endOnEvent );
1268  assert( isdefined( data_struct.characterModel ) );
1269  model = data_struct.characterModel;
1270 
1271  while ( true )
1272  {
1273  data_lcn = ‪VAL( data_struct.splitScreenClient, localClientNum );
1274 
1275  if ( LocalClientActive( data_lcn ) && !‪IS_TRUE( data_struct.characterModel.anglesOverride ) )
1276  {
1277  pos = GetControllerPosition( data_lcn );
1278 
1279  if ( isdefined( pos["rightStick"] ) )
1280  {
1281  model.angles = ( model.angles[0], AbsAngleClamp360( model.angles[1] + pos["rightStick"][0] * ‪RS_ROTATION_SPEED_MULTIPLIER ), model.angles[2] );
1282  }
1283  else
1284  {
1285  model.angles = ( model.angles[0], AbsAngleClamp360( model.angles[1] + pos["look"][0] * ‪RS_ROTATION_SPEED_MULTIPLIER ), model.angles[2] );
1286  }
1287 
1288  if ( IsPC() )
1289  {
1290  pos = GetXCamMouseControl( data_lcn );
1291  model.angles = ( model.angles[0], AbsAngleClamp360( model.angles[1] - pos["yaw"] * ‪RS_ROTATION_SPEED_MULTIPLIER ), model.angles[2] );
1292  }
1293  }
1295  }
1296 }
1297 
1299 // STATIC CHARACTER
1301 
1303 {
1304  characterEnt = GetEnt( localClientNum, "character_customization_staging", "targetname" );
1305  level.extra_cam_hero_data[localClientNum] = ‪setup_character_extracam_struct( "ui_cam_character_customization", "cam_menu_unfocus", ‪HERO_CUSTOMIZE_IDLE_ANIM, false );
1306  level.extra_cam_lobby_client_hero_data[localClientNum] = ‪setup_character_extracam_struct( "ui_cam_char_identity", "cam_bust", ‪HERO_LOBBY_CLIENT_IDLE_ANIM, true );
1307  level.extra_cam_headshot_hero_data[localClientNum] = ‪setup_character_extracam_struct( "ui_cam_char_identity", "cam_bust", ‪HERO_LOBBY_CLIENT_IDLE_ANIM, false );
1308  level.extra_cam_outfit_preview_data[localClientNum] = ‪setup_character_extracam_struct( "ui_cam_char_identity", "cam_bust", ‪HERO_CUSTOMIZE_IDLE_ANIM, false );
1309 
1310  if ( isdefined( characterEnt ) )
1311  {
1312  customization_data_struct = ‪character_customization::create_character_data_struct( characterEnt, localClientNum, false );
1313  level thread ‪update_character_extracam( localClientNum, customization_data_struct );
1314 
1315  return customization_data_struct;
1316  }
1317 
1318  return undefined;
1319 }
1320 
1321 function ‪setup_character_extracam_struct( xcam, subXCam, model_animation, useLobbyPlayers )
1322 {
1323  newStruct = SpawnStruct();
1324  newStruct.xcam = xcam;
1325  newStruct.subXCam = subXCam;
1326  newStruct.anim_name = model_animation;
1327  newStruct.useLobbyPlayers = useLobbyPlayers;
1328  return newStruct;
1329 }
1330 
1331 function ‪wait_for_extracam_close( localClientNum, camera_ent, extraCamIndex )
1332 {
1333  level waittill( "render_complete_" + localClientNum + "_" + extraCamIndex );
1334  ‪multi_extracam::extracam_reset_index( localClientNum, extraCamIndex );
1335 }
1336 
1337 function ‪setup_character_extracam_settings( localClientNum, data_struct, extracam_data_struct )
1338 {
1339  assert( isdefined( extracam_data_struct.jobIndex ) );
1340 
1341  ‪DEFAULT( level.camera_ents, [] );
1342 
1343  initializedExtracam = false;
1344  camera_ent = (isDefined(level.camera_ents[localClientNum]) ? level.camera_ents[localClientNum][extracam_data_struct.extraCamIndex] : undefined);
1345  if( !isdefined( camera_ent ) )
1346  {
1347  initializedExtracam = true;
1348  ‪multi_extracam::extracam_init_index( localClientNum, "character_staging_extracam" + (extracam_data_struct.extraCamIndex+1), extracam_data_struct.extraCamIndex);
1349  camera_ent = level.camera_ents[localClientNum][extracam_data_struct.extraCamIndex];
1350  }
1351 
1352  assert( isdefined( camera_ent ) );
1353 
1354  camera_ent PlayExtraCamXCam( extracam_data_struct.xcam, 0, extracam_data_struct.subXCam );
1355 
1356  params = spawnstruct();
1357  params.anim_name = extracam_data_struct.anim_name;
1358  params.extracam_data = extracam_data_struct;
1359  params.isDefaultHero = extracam_data_struct.isDefaultHero;
1360  params.sessionMode = extracam_data_struct.sessionMode;
1361  params.hide_helmet = ‪IS_TRUE( extracam_data_struct.hideHelmet );
1362 
1363  data_struct.alt_render_mode = false;
1364 
1365  ‪loadEquippedCharacterOnModel( localClientNum, data_struct, extracam_data_struct.characterIndex, params );
1366 
1367  while( !‪is_character_streamed( data_struct ) )
1368  {
1370  }
1371 
1372  if ( ‪IS_TRUE( extracam_data_struct.defaultImageRender ) )
1373  {
1374  wait 0.5; // we can afford longer waits for the default images just make sure they look pretty
1375  }
1376  else
1377  {
1378  wait 0.1; // wait for a bit to allow the models to get set up correctly and have the lighting update
1379  }
1380 
1381  setExtraCamRenderReady( extracam_data_struct.jobIndex );
1382 
1383  extracam_data_struct.jobIndex = undefined;
1384 
1385  if( initializedExtracam )
1386  {
1387  level thread ‪wait_for_extracam_close( localClientNum, camera_ent, extracam_data_struct.extraCamIndex );
1388  }
1389 }
1390 
1391 function ‪update_character_extracam( localClientNum, data_struct )
1392 {
1393  level endon( "disconnect" );
1394 
1395  while ( true )
1396  {
1397  level waittill( "process_character_extracam" + localClientNum, extracam_data_struct );
1398  ‪setup_character_extracam_settings( localClientNum, data_struct, extracam_data_struct );
1399  }
1400 }
1401 
1402 function ‪process_character_extracam_request( localClientNum, jobIndex, extraCamIndex, sessionMode, characterIndex )
1403 {
1404  level.extra_cam_hero_data[localClientNum].jobIndex = jobIndex;
1405  level.extra_cam_hero_data[localClientNum].extraCamIndex = extraCamIndex;
1406  level.extra_cam_hero_data[localClientNum].characterIndex = characterIndex;
1407  level.extra_cam_hero_data[localClientNum].sessionMode = sessionMode;
1408 
1409  level notify( "process_character_extracam" + localClientNum, level.extra_cam_hero_data[localClientNum] );
1410 }
1411 
1412 function ‪process_lobby_client_character_extracam_request( localClientNum, jobIndex, extraCamIndex, sessionMode )
1413 {
1414  level.extra_cam_lobby_client_hero_data[localClientNum].jobIndex = jobIndex;
1415  level.extra_cam_lobby_client_hero_data[localClientNum].extraCamIndex = extraCamIndex;
1416  level.extra_cam_lobby_client_hero_data[localClientNum].characterIndex = GetEquippedCharacterIndexForLobbyClientHero( localClientNum, jobIndex );
1417  level.extra_cam_lobby_client_hero_data[localClientNum].sessionMode = sessionMode;
1418 
1419  level notify( "process_character_extracam" + localClientNum, level.extra_cam_lobby_client_hero_data[localClientNum] );
1420 }
1421 
1422 function ‪process_current_hero_headshot_extracam_request( localClientNum, jobIndex, extraCamIndex, sessionMode, characterIndex, isDefaultHero )
1423 {
1424  level.extra_cam_headshot_hero_data[localClientNum].jobIndex = jobIndex;
1425  level.extra_cam_headshot_hero_data[localClientNum].extraCamIndex = extraCamIndex;
1426  level.extra_cam_headshot_hero_data[localClientNum].characterIndex = characterIndex;
1427  level.extra_cam_headshot_hero_data[localClientNum].isDefaultHero = isDefaultHero;
1428  level.extra_cam_headshot_hero_data[localClientNum].sessionMode = sessionMode;
1429 
1430  level notify( "process_character_extracam" + localClientNum, level.extra_cam_headshot_hero_data[localClientNum] );
1431 }
1432 
1433 function ‪process_outfit_preview_extracam_request( localClientNum, jobIndex, extraCamIndex, sessionMode, outfitIndex )
1434 {
1435  level.extra_cam_outfit_preview_data[localClientNum].jobIndex = jobIndex;
1436  level.extra_cam_outfit_preview_data[localClientNum].extraCamIndex = extraCamIndex;
1437  level.extra_cam_outfit_preview_data[localClientNum].characterIndex = outfitIndex;
1438  level.extra_cam_outfit_preview_data[localClientNum].sessionMode = sessionMode;
1439 
1440  level notify( "process_character_extracam" + localClientNum, level.extra_cam_outfit_preview_data[localClientNum] );
1441 }
1442 
1443 function ‪process_character_body_item_extracam_request( localClientNum, jobIndex, extraCamIndex, sessionMode, characterIndex, itemIndex, defaultImageRender )
1444 {
1445  extracam_data = undefined;
1446  if ( defaultImageRender )
1447  {
1448  extracam_data = ‪setup_character_extracam_struct( "ui_cam_char_customization_icons_render", "loot_body", ‪HERO_LOBBY_CLIENT_IDLE_ANIM, false );
1449  extracam_data.useHeadIndex = GetFirstHeadOfGender( GetHeroGender( characterIndex, sessionMode ), sessionMode );
1450  }
1451  else
1452  {
1453  extracam_data = ‪setup_character_extracam_struct( "ui_cam_char_customization_icons", "cam_body", ‪HERO_LOBBY_CLIENT_IDLE_ANIM, false );
1454  }
1455  extracam_data.jobIndex = jobIndex;
1456  extracam_data.extraCamIndex = extraCamIndex;
1457  extracam_data.sessionMode = sessionMode;
1458  extracam_data.characterIndex = characterIndex;
1459  extracam_data.useBodyIndex = itemIndex;
1460  extracam_data.defaultImageRender = defaultImageRender;
1461 
1462  level notify( "process_character_extracam" + localClientNum, extracam_data );
1463 }
1464 
1465 function ‪process_character_helmet_item_extracam_request( localClientNum, jobIndex, extraCamIndex, sessionMode, characterIndex, itemIndex, defaultImageRender )
1466 {
1467  extracam_data = undefined;
1468  if ( defaultImageRender )
1469  {
1470  extracam_data = ‪setup_character_extracam_struct( "ui_cam_char_customization_icons_render", "loot_helmet", ‪HERO_LOBBY_CLIENT_IDLE_ANIM, false );
1471 #if XFILE_VERSION >= 553
1472  extracam_data.useHeadIndex = GetFirstHeadOfGender( GetHeroGender( characterIndex, sessionMode ), sessionMode );
1473 #endif // #if XFILE_VERSION >= 553
1474  }
1475  else
1476  {
1477  extracam_data = ‪setup_character_extracam_struct( "ui_cam_char_customization_icons", "cam_helmet", ‪HERO_LOBBY_CLIENT_IDLE_ANIM, false );
1478  }
1479  extracam_data.jobIndex = jobIndex;
1480  extracam_data.extraCamIndex = extraCamIndex;
1481  extracam_data.sessionMode = sessionMode;
1482  extracam_data.characterIndex = characterIndex;
1483  extracam_data.useHelmetIndex = itemIndex;
1484  extracam_data.defaultImageRender = defaultImageRender;
1485 
1486  level notify( "process_character_extracam" + localClientNum, extracam_data );
1487 }
1488 
1489 function ‪process_character_head_item_extracam_request( localClientNum, jobIndex, extraCamIndex, sessionMode, headIndex, defaultImageRender )
1490 {
1491  extracam_data = undefined;
1492  if ( defaultImageRender )
1493  {
1494  extracam_data = ‪setup_character_extracam_struct( "ui_cam_char_customization_icons_render", "cam_head", ‪HERO_LOBBY_CLIENT_IDLE_ANIM, false );
1495 #if XFILE_VERSION >= 553
1496  extracam_data.characterIndex = GetFirstHeroOfGender( GetHeadGender( headIndex, sessionMode ), sessionMode );
1497 #endif // #if XFILE_VERSION >= 553
1498  }
1499  else
1500  {
1501  extracam_data = ‪setup_character_extracam_struct( "ui_cam_char_customization_icons", "cam_head", ‪HERO_LOBBY_CLIENT_IDLE_ANIM, false );
1502  }
1503  extracam_data.jobIndex = jobIndex;
1504  extracam_data.extraCamIndex = extraCamIndex;
1505  extracam_data.sessionMode = sessionMode;
1506  extracam_data.useHeadIndex = headIndex;
1507  extracam_data.hideHelmet = true;
1508  extracam_data.defaultImageRender = defaultImageRender;
1509 
1510  level notify( "process_character_extracam" + localClientNum, extracam_data );
1511 }
‪set_character_align
‪function set_character_align(localClientNum, data_struct, align_target)
Definition: _character_customization.csc:1071
‪HEAD_MESH_LODS
‪#define HEAD_MESH_LODS
Definition: _character_customization.csc:33
‪update_character_animation_tree_for_scene
‪function update_character_animation_tree_for_scene(characterModel)
Definition: _character_customization.csc:835
‪process_character_helmet_item_extracam_request
‪function process_character_helmet_item_extracam_request(localClientNum, jobIndex, extraCamIndex, sessionMode, characterIndex, itemIndex, defaultImageRender)
Definition: _character_customization.csc:1465
‪update_model_rotation_for_right_stick
‪function update_model_rotation_for_right_stick(localClientNum, data_struct, endOnEvent)
Definition: _character_customization.csc:1265
‪set_character_mode
‪function set_character_mode(data_struct, characterMode)
Definition: _character_customization.csc:304
‪update_character_animation_and_attachments
‪function update_character_animation_and_attachments(localClientNum, data_struct, params)
Definition: _character_customization.csc:918
‪set_helmet
‪function set_helmet(data_struct, mode, characterIndex, helmetIndex, helmetColors)
Definition: _character_customization.csc:363
‪update_model_attachment
‪function update_model_attachment(localClientNum, data_struct, attached_model, slot, model_anim, model_intro_anim, force_update)
Definition: _character_customization.csc:227
‪HEAD_TEXTURE_LODS
‪#define HEAD_TEXTURE_LODS
Definition: _character_customization.csc:34
‪update_character_animation_based_on_showcase_weapon
‪function update_character_animation_based_on_showcase_weapon(data_struct, params)
Definition: _character_customization.csc:907
‪reaper_body3_hack
‪function reaper_body3_hack(params)
Definition: _character_customization.csc:843
‪loadEquippedCharacterOnModel
‪function loadEquippedCharacterOnModel(localClientNum, data_struct, characterIndex, params)
Definition: _character_customization.csc:179
‪CUSTOMIZATION_INVALID_PAINTJOB_INDEX
‪#define CUSTOMIZATION_INVALID_PAINTJOB_INDEX
Definition: shared.gsh:896
‪get_current_frozen_moment_params
‪function get_current_frozen_moment_params(localClientNum, data_struct, params)
Definition: _character_customization.csc:854
‪get_character_showcase_weapon
‪function get_character_showcase_weapon(localClientNum, characterMode, characterIndex, extracamData)
Definition: _character_customization.csc:776
‪set_head
‪function set_head(data_struct, mode, headIndex)
Definition: _character_customization.csc:354
‪play
‪function play(animation, v_origin_or_ent, v_angles_or_tag, n_rate=1, n_blend_in=.2, n_blend_out=.2, n_lerp, b_link=false)
Definition: animation_shared.csc:44
‪HERO_HEAD_BONE
‪#define HERO_HEAD_BONE
Definition: _character_customization.csc:21
‪setup_character_extracam_settings
‪function setup_character_extracam_settings(localClientNum, data_struct, extracam_data_struct)
Definition: _character_customization.csc:1337
‪VAL
‪#define VAL(__var, __default)
Definition: shared.gsh:272
‪update_locked_shader
‪function update_locked_shader(localClientNum, params)
Definition: _character_customization.csc:1105
‪set_showcase_weapon
‪function set_showcase_weapon(data_struct, mode, localClientNum, xuid, characterIndex, showcaseWeaponName, showcaseWeaponAttachmentInfo, weaponRenderOptions, useShowcasePaintjob, useLocalPaintshop)
Definition: _character_customization.csc:371
‪HELMET_TEXTURE_LODS
‪#define HELMET_TEXTURE_LODS
Definition: _character_customization.csc:31
‪RS_ROTATION_SPEED_MULTIPLIER
‪#define RS_ROTATION_SPEED_MULTIPLIER
Definition: _character_customization.csc:25
‪HERO_CUSTOMIZE_IDLE_ANIM
‪#define HERO_CUSTOMIZE_IDLE_ANIM
Definition: _character_customization.csc:23
‪get_character_body_color
‪function get_character_body_color(localClientNum, characterMode, characterIndex, bodyIndex, colorSlot, extracamData)
Definition: _character_customization.csc:690
‪CUSTOMIZATION_INVALID_PAINTJOB_SLOT
‪#define CUSTOMIZATION_INVALID_PAINTJOB_SLOT
Definition: shared.gsh:897
‪IS_TRUE
‪#define IS_TRUE(__a)
Definition: shared.gsh:251
‪get_character_mode
‪function get_character_mode(localClientNum)
Definition: _character_customization.csc:648
‪HERO_TEXTURE_LODS
‪#define HERO_TEXTURE_LODS
Definition: _character_customization.csc:28
‪get
‪function get(kvp_value, kvp_key="targetname")
Definition: struct.csc:13
‪HERO_HELMET_BONE
‪#define HERO_HELMET_BONE
Definition: _character_customization.csc:20
‪cancelGesture
‪function cancelGesture(characterModel)
Definition: end_game_taunts.csc:391
‪process_character_extracam_request
‪function process_character_extracam_request(localClientNum, jobIndex, extraCamIndex, sessionMode, characterIndex)
Definition: _character_customization.csc:1402
‪setup_character_extracam_struct
‪function setup_character_extracam_struct(xcam, subXCam, model_animation, useLobbyPlayers)
Definition: _character_customization.csc:1321
‪set_body_color
‪function set_body_color(data_struct, colorSlot, colorIndex)
Definition: _character_customization.csc:346
‪HELMET_MESH_LODS
‪#define HELMET_MESH_LODS
Definition: _character_customization.csc:30
‪previewTaunt
‪function previewTaunt(localClientNum, characterModel, idleAnimName, tauntAnimName)
Definition: end_game_taunts.csc:239
‪update_character_extracam
‪function update_character_extracam(localClientNum, data_struct)
Definition: _character_customization.csc:1391
‪is_character_streamed
‪function is_character_streamed(data_struct)
Definition: _character_customization.csc:607
‪SESSIONMODE_INVALID
‪#define SESSIONMODE_INVALID
Definition: shared.gsh:23
‪get_character_body
‪function get_character_body(localClientNum, characterMode, characterIndex, extracamData)
Definition: _character_customization.csc:653
‪wait_for_extracam_close
‪function wait_for_extracam_close(localClientNum, camera_ent, extraCamIndex)
Definition: _character_customization.csc:1331
‪set_helmet_color
‪function set_helmet_color(data_struct, colorSlot, colorIndex)
Definition: _character_customization.csc:564
‪DEFAULT
‪#define DEFAULT(__var, __default)
Definition: shared.gsh:270
‪update_show_helmets
‪function update_show_helmets(localClientNum, data_struct, show_helmets)
Definition: _character_customization.csc:1058
‪process_outfit_preview_extracam_request
‪function process_outfit_preview_extracam_request(localClientNum, jobIndex, extraCamIndex, sessionMode, outfitIndex)
Definition: _character_customization.csc:1433
‪SESSIONMODE_ZOMBIES
‪#define SESSIONMODE_ZOMBIES
Definition: shared.gsh:20
‪set_body_colors
‪function set_body_colors(data_struct, mode, bodyColors)
Definition: _character_customization.csc:338
‪get_character_body_colors
‪function get_character_body_colors(localClientNum, characterMode, characterIndex, bodyIndex, extracamData)
Definition: _character_customization.csc:710
‪get_character_helmet_color
‪function get_character_helmet_color(localClientNum, characterMode, characterIndex, helmetIndex, colorSlot, extracamData)
Definition: _character_customization.csc:796
‪SESSIONMODE_CAMPAIGN
‪#define SESSIONMODE_CAMPAIGN
Definition: shared.gsh:22
‪HERO_MESH_LODS
‪#define HERO_MESH_LODS
Definition: _character_customization.csc:27
‪HERO_LOBBY_CLIENT_IDLE_ANIM
‪#define HERO_LOBBY_CLIENT_IDLE_ANIM
Definition: _character_customization.csc:24
‪LIVE_CHARACTER_SPAWN_TARGET
‪#define LIVE_CHARACTER_SPAWN_TARGET
Definition: _character_customization.csc:36
‪extracam_reset_index
‪function extracam_reset_index(localClientNum, index)
Definition: _multi_extracam.csc:13
‪setup_static_character_customization_target
‪function setup_static_character_customization_target(localClientNum)
Definition: _character_customization.csc:1302
‪cancelTaunt
‪function cancelTaunt(localClientNum, characterModel)
Definition: end_game_taunts.csc:301
‪previewGesture
‪function previewGesture(localClientNum, characterModel, idleAnimName, gestureAnimName)
Definition: end_game_taunts.csc:325
‪extracam_init_index
‪function extracam_init_index(localClientNum, target, index)
Definition: _multi_extracam.csc:28
‪updateEventThread
‪function updateEventThread(localClientNum, data_struct)
Definition: _character_customization.csc:1117
‪REGISTER_SYSTEM
‪#define REGISTER_SYSTEM(__sys, __func_init_preload, __reqs)
Definition: shared.gsh:204
‪array
‪function filter array
Definition: array_shared.csc:16
‪SET_IF_DEFINED
‪#define SET_IF_DEFINED(__target, __src)
Definition: shared.gsh:442
‪create_character_data_struct
‪function create_character_data_struct(characterModel, localClientNum, alt_render_mode=true)
Definition: _character_customization.csc:82
‪get_character_head
‪function get_character_head(localClientNum, characterMode, extracamData)
Definition: _character_customization.csc:728
‪Spawn
‪function Spawn(parent, onDeathCallback)
Definition: _flak_drone.gsc:427
‪process_current_hero_headshot_extracam_request
‪function process_current_hero_headshot_extracam_request(localClientNum, jobIndex, extraCamIndex, sessionMode, characterIndex, isDefaultHero)
Definition: _character_customization.csc:1422
‪rotation_thread_spawner
‪function rotation_thread_spawner(localClientNum, data_struct, endOnEvent)
Definition: _character_customization.csc:1245
‪set_character
‪function set_character(data_struct, characterIndex)
Definition: _character_customization.csc:299
‪process_character_head_item_extracam_request
‪function process_character_head_item_extracam_request(localClientNum, jobIndex, extraCamIndex, sessionMode, headIndex, defaultImageRender)
Definition: _character_customization.csc:1489
‪localClientConnect
‪function localClientConnect(localClientNum)
Definition: _character_customization.csc:70
‪get_character_helmet
‪function get_character_helmet(localClientNum, characterMode, characterIndex, extracamData)
Definition: _character_customization.csc:752
‪__init__
‪function __init__()
Definition: _character_customization.csc:49
‪SHOWCASE_WEAPON_PAINTSHOP_CLASS
‪#define SHOWCASE_WEAPON_PAINTSHOP_CLASS
Definition: _character_customization.csc:39
‪stop
‪function stop(n_blend=0.2)
Definition: animation_shared.gsc:97
‪handle_forced_streaming
‪function handle_forced_streaming(game_mode)
Definition: _character_customization.csc:148
‪set_helmet_colors
‪function set_helmet_colors(data_struct, colors)
Definition: _character_customization.csc:553
‪update_use_frozen_moments
‪function update_use_frozen_moments(localClientNum, data_struct, useFrozenMoments)
Definition: _character_customization.csc:1036
‪set_body
‪function set_body(data_struct, mode, characterIndex, bodyIndex, bodyColors)
Definition: _character_customization.csc:311
‪get_character_helmet_colors
‪function get_character_helmet_colors(localClientNum, characterMode, characterIndex, helmetIndex, extracamData)
Definition: _character_customization.csc:816
‪process_lobby_client_character_extracam_request
‪function process_lobby_client_character_extracam_request(localClientNum, jobIndex, extraCamIndex, sessionMode)
Definition: _character_customization.csc:1412
‪DEFAULT_LIVE_CHARACTER_EXPLODER
‪#define DEFAULT_LIVE_CHARACTER_EXPLODER
Definition: _character_customization.csc:37
‪process_character_body_item_extracam_request
‪function process_character_body_item_extracam_request(localClientNum, jobIndex, extraCamIndex, sessionMode, characterIndex, itemIndex, defaultImageRender)
Definition: _character_customization.csc:1443
‪LOCAL_WEAPON_PAINTSHOP_CLASS
‪#define LOCAL_WEAPON_PAINTSHOP_CLASS
Definition: _character_customization.csc:40
‪setup_character_streaming
‪function setup_character_streaming(data_struct)
Definition: _character_customization.csc:631
‪WEAPON_GROUP_FRONTEND_ANIMS
‪#define WEAPON_GROUP_FRONTEND_ANIMS
Definition: weapon_group_anims.gsh:191
‪WAIT_CLIENT_FRAME
‪#define WAIT_CLIENT_FRAME
Definition: shared.gsh:266
‪setup_live_character_customization_target
‪function setup_live_character_customization_target(localClientNum)
Definition: _character_customization.csc:1088
‪play_intro_and_animation
‪function play_intro_and_animation(intro_anim_name, anim_name, b_keep_link)
Definition: _character_customization.csc:895
‪update
‪function update(localClientNum, data_struct, params)
Definition: _character_customization.csc:572
‪INSPECTION_POSE_ZM
‪#define INSPECTION_POSE_ZM
Definition: weapon_group_anims.gsh:165