Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_EffectsModuleParticleChildComponent.c
Go to the documentation of this file.
1
[
ComponentEditorProps
(
category
:
"GameScripted/Misc"
, description:
""
)]
2
class
SCR_EffectsModuleParticleChildComponentClass
:
SCR_EffectsModuleChildComponentClass
3
{
4
}
5
6
class
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
{
17
SignalsManagerComponent
signalManager =
SignalsManagerComponent
.Cast(
GetOwner
().
FindComponent
(
SignalsManagerComponent
));
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
35
RemovedFromParentBroadcast
();
36
Rpc
(
RemovedFromParentBroadcast
);
37
}
38
39
//------------------------------------------------------------------------------------------------
40
[
RplRpc
(
RplChannel
.Reliable,
RplRcver
.Broadcast)]
41
protected
void
RemovedFromParentBroadcast
()
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
}
ComponentEditorProps
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
Definition
SCR_AIGroupUtilityComponent.c:12
index
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
Definition
SCR_DestructionSynchronizationComponent.c:17
RemovedFromParentBroadcast
void RemovedFromParentBroadcast()
Definition
SCR_EffectsModuleParticleChildComponent.c:41
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
GenericComponent::SetEventMask
proto external int SetEventMask(notnull IEntity owner, int mask)
GenericComponent::FindComponent
proto external GenericComponent FindComponent(typename typeName)
GenericComponent::Rpc
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)
IEntity
Definition
IEntity.c:13
SCR_EffectsModuleChildComponentClass
Definition
SCR_EffectModuleChildComponent.c:3
SCR_EffectsModuleChildComponent
Definition
SCR_EffectModuleChildComponent.c:6
SCR_EffectsModuleChildComponent::EditorOnParentRemoved
void EditorOnParentRemoved(SCR_EffectsModuleComponent effectModule, SCR_EffectsModule effectConfig)
Definition
SCR_EffectModuleChildComponent.c:68
SCR_EffectsModuleComponent
Definition
SCR_EffectModuleComponent.c:11
SCR_EffectsModule
Definition
SCR_EffectModule.c:3
SCR_EffectsModuleParticleChildComponentClass
Definition
SCR_EffectsModuleParticleChildComponent.c:3
ScriptComponent::GetOwner
proto external GenericEntity GetOwner()
Get owner entity.
ScriptComponent::EOnInit
void EOnInit(IEntity owner)
SignalsManagerComponent
Definition
SignalsManagerComponent.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EntityEvent
EntityEvent
Various entity events.
Definition
EntityEvent.c:14
EParticleEffectState
EParticleEffectState
Definition
EParticleEffectState.c:13
RplRpc
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
Definition
EnNetwork.c:95
RplRcver
RplRcver
Definition
RplRcver.c:59
RplChannel
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.
Definition
RplChannel.c:14
OnPostInit
@ OnPostInit
Definition
SndComponentCallbacks.c:15
OnDelete
@ OnDelete
Definition
SndComponentCallbacks.c:16
scripts
Game
Components
SCR_EffectsModuleParticleChildComponent.c
Generated by
1.17.0