DayZ 1.24
Loading...
Searching...
No Matches
SpookyArea.c File Reference

Go to the source code of this file.

Classes

class  SpookyArea
 

Functions

SpookyArea EffectArea OnPlayerEnterServer (PlayerBase player, EffectTrigger trigger)
 
override void EEInit ()
 
override void InitZoneServer ()
 
override void InitZoneClient ()
 
override void OnPlayerExitServer (PlayerBase player, EffectTrigger trigger)
 

Function Documentation

◆ EEInit()

override void OnPlayerEnterServer::EEInit ( )

Definition at line 55 of file SpookyArea.c.

61 {
62 super.OnPlayerExitServer(player, trigger);
63
65 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(player, types);
66 }
67}
this entity gets attached to each player while present in the spooky area

◆ InitZoneClient()

override void OnPlayerEnterServer::InitZoneClient ( )

Definition at line 88 of file SpookyArea.c.

90{
91 // ----------------------------------------------
92 // INITIAL SETUP
93 // ----------------------------------------------
94 override void EEInit()
95 {
96 // We make sure we have the particle array
97 if (!m_ToxicClouds)
98 m_ToxicClouds = new array<Particle>;
99
100 SetSynchDirty();
101
102#ifdef DEVELOPER
103 // Debugs when placing entity by hand using internal tools
104 if (GetGame().IsServer() && !GetGame().IsMultiplayer())
105 {
106 Debug.Log("YOU CAN IGNORE THE FOLLOWING DUMP");
107 InitZone();
108 Debug.Log("YOU CAN USE FOLLOWING DATA PROPERLY");
109 }
110#endif
111
112 if (GetGame().IsClient() && GetGame().IsMultiplayer())
113 InitZone();
114
115 super.EEInit();
116 }
117
118 override void InitZoneServer()
119 {
120 super.InitZoneServer();
121
122 // We create the trigger on server
123 if (m_TriggerType != "")
125 }
126
127 override void InitZoneClient()
128 {
129 super.InitZoneClient();
130
131 // We spawn VFX on client
132 PlaceParticles(GetWorldPosition(), m_Radius, m_InnerRings, m_InnerSpacing, m_OuterRingToggle, m_OuterSpacing, m_OuterRingOffset, m_ParticleID);
133 }
134}
135
137{
139 {
140 super.OnPlayerEnterServer(player, trigger);
141
142 EntityAI spookyEntity = EntityAI.Cast(GetGame().CreateObjectEx("SpookyPlayerStalker", "0 0 0", ECE_SETUP));
143 int boneIdx = player.GetBoneIndexByName("Head");
144 player.AddChild(spookyEntity, boneIdx, true);
145 }
146
148 {
149 super.OnPlayerExitServer(player, trigger);
150
152 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(player, types);
153 }
154}
float m_Radius
const int ECE_SETUP
override void OnPlayerEnterServer(PlayerBase player, EffectTrigger trigger)
override void OnPlayerExitServer(PlayerBase player, EffectTrigger trigger)
vector m_Position
Cached world position.
Definition Effect.c:41
override void EEInit()
Definition SpookyArea.c:55
override void InitZoneClient()
Definition SpookyArea.c:88
override void InitZoneServer()
Definition SpookyArea.c:79
void CreateTrigger()
Definition TrapBase.c:468
Definition Debug.c:14
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:133
proto native CGame GetGame()

◆ InitZoneServer()

override void OnPlayerEnterServer::InitZoneServer ( )

Definition at line 79 of file SpookyArea.c.

81{
82 // ----------------------------------------------
83 // INITIAL SETUP
84 // ----------------------------------------------
85 override void EEInit()
86 {
87 // We make sure we have the particle array
88 if (!m_ToxicClouds)
89 m_ToxicClouds = new array<Particle>;
90
91 SetSynchDirty();
92
93#ifdef DEVELOPER
94 // Debugs when placing entity by hand using internal tools
95 if (GetGame().IsServer() && !GetGame().IsMultiplayer())
96 {
97 Debug.Log("YOU CAN IGNORE THE FOLLOWING DUMP");
98 InitZone();
99 Debug.Log("YOU CAN USE FOLLOWING DATA PROPERLY");
100 }
101#endif
102
103 if (GetGame().IsClient() && GetGame().IsMultiplayer())
104 InitZone();
105
106 super.EEInit();
107 }
108
109 override void InitZoneServer()
110 {
111 super.InitZoneServer();
112
113 // We create the trigger on server
114 if (m_TriggerType != "")
116 }
117
118 override void InitZoneClient()
119 {
120 super.InitZoneClient();
121
122 // We spawn VFX on client
123 PlaceParticles(GetWorldPosition(), m_Radius, m_InnerRings, m_InnerSpacing, m_OuterRingToggle, m_OuterSpacing, m_OuterRingOffset, m_ParticleID);
124 }
125}
126
128{
130 {
131 super.OnPlayerEnterServer(player, trigger);
132
133 EntityAI spookyEntity = EntityAI.Cast(GetGame().CreateObjectEx("SpookyPlayerStalker", "0 0 0", ECE_SETUP));
134 int boneIdx = player.GetBoneIndexByName("Head");
135 player.AddChild(spookyEntity, boneIdx, true);
136 }
137
139 {
140 super.OnPlayerExitServer(player, trigger);
141
143 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(player, types);
144 }
145}

◆ OnPlayerEnterServer()

SpookyArea EffectArea OnPlayerEnterServer ( PlayerBase player,
EffectTrigger trigger )

Definition at line 1 of file SpookyArea.c.

52 {
53 super.OnPlayerEnterServer(player, trigger);
54
55 EntityAI spookyEntity = EntityAI.Cast(GetGame().CreateObjectEx("SpookyPlayerStalker", "0 0 0", ECE_SETUP));
56 int boneIdx = player.GetBoneIndexByName("Head");
57 player.AddChild(spookyEntity, boneIdx, true);
58 }

◆ OnPlayerExitServer()

override void OnPlayerExitServer ( PlayerBase player,
EffectTrigger trigger )

Definition at line 60 of file SpookyArea.c.

61 {
62 super.OnPlayerExitServer(player, trigger);
63
65 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(player, types);
66 }