Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_EffectsModuleParticleChildComponent.c
Go to the documentation of this file.
1[ComponentEditorProps(category: "GameScripted/Misc", description: "")]
5
6class SCR_EffectsModuleParticleChildComponent : SCR_EffectsModuleChildComponent
7{
8 [Attribute("Trigger", desc: "Signal for particle sfx")]
9 protected string m_sParticleSoundEffectSignal;
10
11 protected SCR_ReplicatedParticleEffectEntity m_ParticleEntity;
12
13 //------------------------------------------------------------------------------------------------
14 //~ When particle state changes update the audio
15 protected void OnParticleStateChanged(EParticleEffectState oldState, EParticleEffectState newState)
16 {
18 if (!signalManager)
19 return;
20
21 int index = signalManager.AddOrFindSignal(m_sParticleSoundEffectSignal);
22 if (index < 0)
23 return;
24
25 //~ Play sound if playing state. Otherwise always stop playing
26 signalManager.SetSignalValue(index, newState == EParticleEffectState.PLAYING);
27 }
28
29 //------------------------------------------------------------------------------------------------
30 protected override void EditorOnParentRemoved(SCR_EffectsModuleComponent effectModule, SCR_EffectsModule effectConfig)
31 {
32 if (!m_ParticleEntity)
33 delete GetOwner();
34
37 }
38
39 //------------------------------------------------------------------------------------------------
40 [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
42 {
43 if (!m_ParticleEntity)
44 return;
45
46 m_ParticleEntity.StopEmission();
47 }
48
49 //------------------------------------------------------------------------------------------------
50 override void EOnInit(IEntity owner)
51 {
52 m_ParticleEntity = SCR_ReplicatedParticleEffectEntity.Cast(GetOwner());
53 if (m_ParticleEntity)
54 {
55 m_ParticleEntity.GetOnStateChanged().Insert(OnParticleStateChanged);
56
57 //~ Start playing Audio if state is already set to playing
58 if (m_ParticleEntity.GetState() == EParticleEffectState.PLAYING)
59 OnParticleStateChanged(EParticleEffectState.STOPPED, EParticleEffectState.PLAYING);
60 }
61 }
62
63 //------------------------------------------------------------------------------------------------
64 override void OnPostInit(IEntity owner)
65 {
66 SetEventMask(owner, EntityEvent.INIT);
67 }
68
69 //------------------------------------------------------------------------------------------------
70 override void OnDelete(IEntity owner)
71 {
72 if (m_ParticleEntity)
73 {
74 m_ParticleEntity.GetOnStateChanged().Remove(OnParticleStateChanged);
75 }
76 super.OnDelete(owner);
77 }
78}
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external int SetEventMask(notnull IEntity owner, int mask)
proto external GenericComponent FindComponent(typename typeName)
void Rpc(func method, void p0=NULL, void p1=NULL, void p2=NULL, void p3=NULL, void p4=NULL, void p5=NULL, void p6=NULL, void p7=NULL)
void EditorOnParentRemoved(SCR_EffectsModuleComponent effectModule, SCR_EffectsModule effectConfig)
proto external GenericEntity GetOwner()
Get owner entity.
void EOnInit(IEntity owner)
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
Definition EntityEvent.c:14
EParticleEffectState
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
Definition EnNetwork.c:95
RplRcver
Definition RplRcver.c:59
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.
Definition RplChannel.c:14