Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_VehicleSoundComponent.c
Go to the documentation of this file.
1 [EntityEditorProps(category: "GameScripted/Sound", description: "Testing component")]
3 {
4  [Attribute("", UIWidgets.Auto, "HitZone State Signals")]
5  ref array<ref SCR_HitZoneStateSignalData> m_aHitZoneStateSignalData;
6 }
7 
8 class SCR_VehicleSoundComponent : VehicleSoundComponent
9 {
10  protected ref array<ref SCR_HitZoneStateSignal> m_aHitZoneStateSignal = {};
11 
12  //------------------------------------------------------------------------------------------------
13  protected array<ref SCR_HitZoneStateSignalData> GetHitZoneStateSignalData()
14  {
15  SCR_VehicleSoundComponentClass prefabData = SCR_VehicleSoundComponentClass.Cast(GetComponentData(GetOwner()));
16  if (prefabData)
17  {
18  return prefabData.m_aHitZoneStateSignalData;
19  }
20 
21  return null;
22  }
23 
24  //------------------------------------------------------------------------------------------------
25  override void OnInit(IEntity owner)
26  {
27  super.OnInit(owner);
28 
30  }
31 
32  //------------------------------------------------------------------------------------------------
33  protected void RegisterHitZoneSignals(IEntity owner)
34  {
35  SignalsManagerComponent signalsManagerComponent = SignalsManagerComponent.Cast(owner.FindComponent(SignalsManagerComponent) );
36  if (!signalsManagerComponent)
37  return;
38 
39  SCR_DamageManagerComponent hitZoneContainerComponent = SCR_DamageManagerComponent.Cast(GetOwner().FindComponent(SCR_DamageManagerComponent));
40  if (!hitZoneContainerComponent)
41  return;
42 
43  array<ref SCR_HitZoneStateSignalData> hitZoneStateSignalData = GetHitZoneStateSignalData();
44  if (!hitZoneStateSignalData)
45  return;
46 
47  foreach(SCR_HitZoneStateSignalData data : hitZoneStateSignalData)
48  {
50  if (hitZoneSignal.RegisterSignal(hitZoneContainerComponent, data, signalsManagerComponent))
51  m_aHitZoneStateSignal.Insert(hitZoneSignal);
52  }
53  }
54 
55  //------------------------------------------------------------------------------------------------
56  protected void UnregisterHitZoneSignals()
57  {
58  foreach(SCR_HitZoneStateSignal hitZoneStateSignal : m_aHitZoneStateSignal)
59  {
60  hitZoneStateSignal.UnregisterSignal();
61  }
62 
63  m_aHitZoneStateSignal.Clear();
64  }
65 
66  //------------------------------------------------------------------------------------------------
67  override void OnPostInit(IEntity owner)
68  {
69  // Collision sounds setup
71  }
72 
73  //------------------------------------------------------------------------------------------------
74  // constructor
78  void SCR_VehicleSoundComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
79  {
80  }
81 
82  //------------------------------------------------------------------------------------------------
83  // destructor
85  {
87  }
88 }
SCR_HitZoneStateSignalData
Definition: SCR_HitZoneStateSignalData.c:2
UnregisterHitZoneSignals
protected void UnregisterHitZoneSignals()
Definition: SCR_VehicleSoundComponent.c:56
EntityEditorProps
enum EQueryType EntityEditorProps(category:"GameScripted/Sound", description:"THIS IS THE SCRIPT DESCRIPTION.", color:"0 0 255 255")
Definition: SCR_AmbientSoundsComponent.c:12
SCR_VehicleSoundComponent
void SCR_VehicleSoundComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_VehicleSoundComponent.c:78
m_aHitZoneStateSignal
SCR_VehicleSoundComponentClass m_aHitZoneStateSignal
VehicleSoundComponentClass
Definition: VehicleSoundComponent.c:12
Attribute
typedef Attribute
Post-process effect of scripted camera.
OnPostInit
override void OnPostInit(IEntity owner)
Called on PostInit when all components are added.
Definition: SCR_VehicleSoundComponent.c:67
SCR_HitZoneStateSignal
Definition: SCR_HitZoneStateSignal.c:1
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition: SCR_FuelNode.c:128
SCR_VehicleSoundComponentClass
Definition: SCR_VehicleSoundComponent.c:2
SetMinTimeAfterImpact
VehicleSoundComponentClass SoundComponentClass SetMinTimeAfterImpact(float timeMs)
RegisterHitZoneSignals
protected void RegisterHitZoneSignals(IEntity owner)
Definition: SCR_VehicleSoundComponent.c:33
GetHitZoneStateSignalData
protected array< ref SCR_HitZoneStateSignalData > GetHitZoneStateSignalData()
Definition: SCR_VehicleSoundComponent.c:13
data
Get all prefabs that have the spawner data
Definition: SCR_EntityCatalogManagerComponent.c:305
OnInit
override void OnInit(IEntity owner)
Definition: SCR_VehicleSoundComponent.c:25
~SCR_VehicleSoundComponent
void ~SCR_VehicleSoundComponent()
Definition: SCR_VehicleSoundComponent.c:84
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180