Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_EffectModuleChildComponent.c
Go to the documentation of this file.
1[ComponentEditorProps(category: "GameScripted/Misc", description: "")]
6{
8 protected bool m_bIsMaster;
9
11
12 protected bool m_bOnDeleteCalled;
13
14 //------------------------------------------------------------------------------------------------
15 void InitChildServer(notnull SCR_EffectsModuleComponent effectModule, notnull SCR_EffectsModule effectConfig)
16 {
17 m_bIsMaster = true;
18 m_vParentPosition = effectModule.GetOwner().GetOrigin();
19
20 InitChild(effectModule, effectConfig);
21 }
22
23 //------------------------------------------------------------------------------------------------
24 void InitChild(notnull SCR_EffectsModuleComponent effectModule, notnull SCR_EffectsModule effectConfig)
25 {
26 if (m_Parent)
27 return;
28
29 m_Parent = effectModule;
30 //effectModule.GetOnDelete().Insert(OnParentEffectsModuleDeleted);
31 effectModule.GetOnEditorOnRemovedFromParent().Insert(EditorOnParentRemoved);
32 effectModule.GetOnTransformChanged().Insert(OnParentEffectsModuleUpdate);
33 }
34
35 //------------------------------------------------------------------------------------------------
36 protected void OnParentEffectsModuleUpdate(notnull SCR_EffectsModuleComponent effectModule, notnull SCR_EffectsModule effectConfig)
37 {
38 if (!m_bIsMaster)
39 {
40 if (!effectConfig.m_bSnapToTerrain)
41 {
43 GetOwner().Update();
44 }
45
46 return;
47 }
48
49 m_vParentPosition = effectModule.GetOwner().GetOrigin();
50
51 //~ Snap to terrain
52 if (effectConfig.m_bSnapToTerrain)
53 {
56
59 }
60 else
61 {
63 GetOwner().Update();
64 }
65 }
66
67 //------------------------------------------------------------------------------------------------
68 protected void EditorOnParentRemoved(SCR_EffectsModuleComponent effectModule, SCR_EffectsModule effectConfig)
69 {
70 delete GetOwner();
71 }
72
73 //------------------------------------------------------------------------------------------------
74 //~ Update position
75 [RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
82
83 //------------------------------------------------------------------------------------------------
84 override void OnDelete(IEntity owner)
85 {
86 if (m_bIsMaster && m_Parent)
87 m_Parent.OnEffectsModuleChildDeleted();
88
89 if (m_Parent)
90 {
91 //m_Parent.GetOnDelete().Remove(OnParentEffectsModuleDeleted);
92 m_Parent.GetOnEditorOnRemovedFromParent().Remove(EditorOnParentRemoved);
93 m_Parent.GetOnTransformChanged().Remove(OnParentEffectsModuleUpdate);
94 }
95 }
96};
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
vector position
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)
proto external void OnTransformReset(bool isCorrection=false, vector newVelocity=vector.Zero)
proto external void SetOrigin(vector orig)
proto external vector GetOrigin()
proto external int Update()
void OnParentEffectsModuleUpdate(notnull SCR_EffectsModuleComponent effectModule, notnull SCR_EffectsModule effectConfig)
void EditorOnParentRemoved(SCR_EffectsModuleComponent effectModule, SCR_EffectsModule effectConfig)
void InitChildServer(notnull SCR_EffectsModuleComponent effectModule, notnull SCR_EffectsModule effectConfig)
void InitChild(notnull SCR_EffectsModuleComponent effectModule, notnull SCR_EffectsModule effectConfig)
static float GetTerrainY(vector pos, BaseWorld world=null, bool noUnderwater=false, TraceParam trace=null)
proto external GenericEntity GetOwner()
Get owner entity.
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