DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ScriptedLightBase.c
См. документацию.
1/*
2Please remember that:
3-Lights work only on client side!
4-Lights with Brightness or Radius of 0 (or less) are automatically deleted
5-Lights are very performance heavy. Especially if they cast shadows. Use them carefully!
6
7Script author: Boris Vacula
8*/
9
11{
13 float m_LifetimeEnd = -1; // -1 makes this light permanent
14 float m_FadeOutTime = -1;
15 float m_FadeInTime = -1;
16 float m_Radius;
19 float m_BrightnessPulse; // flicker effect
26 float m_OptimizeShadowsRadius = 0; // Within this range between the light source and camera the shadows will be automatically disabled to save on performance
27
30
32 protected int m_HiddenSelectionID;
33
34 bool m_IsDebugEnabled = false;
35
36 Object m_Parent; // Attachment parent
37 vector m_LocalPos; // Local position to my attachment parent
38 vector m_LocalOri; // Local orientation to my attachment parent
40
43
44 static ref set<ScriptedLightBase> m_NightTimeOnlyLights = new set<ScriptedLightBase>();
45
48 {
50 SetEnabled(true);
51 SetEventMask(EntityEvent.FRAME);
52 SetEventMask(EntityEvent.INIT);
53 }
54
56 {
58 {
59 int index = m_NightTimeOnlyLights.Find(this);
60 if (index != -1)
61 {
62 m_NightTimeOnlyLights.Remove(index);
63 }
64 }
65 }
66
67 override void EOnInit(IEntity other, int extra)
68 {
69 if (!IsVisibleDuringDaylight())
70 {
71 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
72 if (player && player.m_UndergroundPresence)
73 SetVisibleDuringDaylight(true);
74 m_NightTimeOnlyLights.Insert(this);
75 }
76 }
77
78 override bool IsScriptedLight()
79 {
80 return true;
81 }
82
84 {
85 ItemBase item = ItemBase.Cast(m_Parent);
86 if (item)
87 {
89 item.GetInventory().GetCurrentInventoryLocation( il );
90 string slotName;
91 if (il.GetType() == InventoryLocationType.GROUND)
92 {
93 slotName = "Ground";
94 }
95 else if (il.GetSlot() != -1)
96 {
98 }
100 }
101 }
102
103 private void UpdateLightMode(string slotName);
104
106 private void DeleteLightWithDelay()
107 {
108 DetachFromParent(); // This is the reason for the delay
109
110 if (GetGame())
111 {
112 if (!m_DeleteTimer)
114
115 m_DeleteTimer.Run( 0.03 , this, "DeleteLightNow", NULL, true);
116 }
117
118 }
119
120 // Deletes light now. Do not call this directly. Call Destroy() instead. Otherwise you might get errors related to hierarchy.
121 private void DeleteLightNow()
122 {
123 GetGame().ObjectDelete(this);
124 }
125
127 void AttachOnObject(Object parent, vector local_pos = "0 0 0", vector local_ori = "0 0 0")
128 {
129 if (!parent)
130 {
131 if (m_Parent)
132 {
133 m_Parent.RemoveChild(this);
134 }
135
136 return;
137 }
138 else
139 {
140 if (m_Parent)
141 {
142 m_Parent.RemoveChild(this);
143 }
144 }
145
146 m_Parent = parent;
147 m_LocalPos = local_pos;
148 m_LocalOri = local_ori;
149 SetOrientation(local_ori);
150 SetPosition(local_pos);
151 parent.AddChild(this, -1);
152 parent.Update();
153 }
154
157 {
158 return m_Parent;
159 }
160
162 void AttachOnMemoryPoint(Object parent, string memory_point_start, string memory_point_target = "")
163 {
164 if (parent.MemoryPointExists(memory_point_start))
165 {
166 m_LocalPos = parent.GetMemoryPointPos(memory_point_start);
167 vector local_ori;
168
169 if (memory_point_target != "" )
170 {
171 if (parent.MemoryPointExists(memory_point_target))
172 {
173 vector target_pos = parent.GetSelectionPositionLS(memory_point_target);
174 target_pos = vector.Direction(m_LocalPos, target_pos);
175 local_ori = target_pos.VectorToAngles();
176 }
177 else
178 {
179 ErrorEx("memory point 'memory_point_target' not found when attaching light");
180 }
181 }
182 AttachOnObject(parent, m_LocalPos, local_ori);
183 UpdateMode();
184 }
185 else
186 {
187 ErrorEx("memory point 'memory_point_start' not found when attaching light");
188 }
189 }
190
193 {
194 if (!m_Parent)
195 {
196 m_Parent = Object.Cast( GetParent() );
197 }
198
199 if (m_Parent)
200 {
201 if ( !m_Parent.ToDelete() && !ToDelete() )
202 {
203 m_Parent.RemoveChild(this);
204 }
205 }
206
207 m_Parent = null;
208 m_LocalPos = Vector(0,0,0);
209 m_LocalOri = Vector(0,0,0);
210 }
211
212 static ScriptedLightBase CreateLightAtObjMemoryPoint(typename name, notnull Object target, string memory_point_start, string memory_point_target = "", vector global_pos = "0 0 0", float fade_in_time_in_s = 0)
213 {
214 ScriptedLightBase light;
215 if (target.MemoryPointExists(memory_point_start))
216 {
217 light = CreateLight(name, global_pos, fade_in_time_in_s);
218 light.AttachOnMemoryPoint(target, memory_point_start, memory_point_target);
219 }
220 return light;
221 }
222
224 static ScriptedLightBase CreateLight(typename name, vector global_pos = "0 0 0", float fade_in_time_in_s = 0)
225 {
226 ScriptedLightBase light_instance;
227
228 if ( !GetGame().IsServer() || !GetGame().IsMultiplayer() ) // Client side
229 {
230 light_instance = ScriptedLightBase.Cast( GetGame().CreateObject(name.ToString(), global_pos, true) );
231
232 if (!light_instance)
233 {
234 Error("Error! Light entity of name " + name.ToString() + " cannot be spawned! This name is incorrect or not inherited from ScriptedLightBase." );
235 return null;
236 }
237
238 if (fade_in_time_in_s != 0)
239 {
240 light_instance.FadeIn(fade_in_time_in_s);
241 }
242 }
243 else // Server side
244 {
245 if ( GetGame().IsDebug() )
246 {
247 Error("An instance of ScriptedLightBase was attempted to spawn on server side! Lights are CLIENT SIDE ONLY!");
248 }
249 }
250
251 return light_instance;
252 }
253
255 void SetBrightnessTo(float value)
256 {
257 m_Brightness = value;
258 m_BrightnessTarget = value;
259 SetBrightness(m_Brightness * m_BrightnessPulse);
261 }
262
265 {
266 if (m_Brightness < 100)
267 {
268 float v = m_Brightness * 0.01;
269
270 if (v > 0)
271 {
272 float brightness_compesation = 1 / v;
273 float compenset_brightness = (m_Brightness * m_BrightnessPulse) * brightness_compesation;
274 SetBrightness(compenset_brightness);
275 SetPulseCoef(v);
276 }
277 }
278 else
279 {
280 SetPulseCoef(1);
281 }
282 }
283
285 void FadeBrightnessTo( float value, float time_in_s )
286 {
287 m_BrightnessTarget = value;
288
289 if (time_in_s == 0)
290 {
292 }
293 else
294 {
296 }
297 }
298
300 void SetRadiusTo(float value)
301 {
302 m_Radius = value;
303 m_RadiusTarget = value;
305 }
306
308 void FadeRadiusTo( float value, float time_in_s )
309 {
310 m_RadiusTarget = value;
311
312 if (time_in_s == 0)
313 {
315 }
316 else
317 {
319 }
320 }
321
323 void Destroy()
324 {
325 ClearEventMask(EntityEvent.FRAME);
326 SetEnabled(false);
327 if (m_Parent)
329 else
331 }
332
334 void SetLifetime(float life_in_s)
335 {
336 if(GetGame())
337 m_LifetimeEnd = GetGame().GetTime() + life_in_s * 1000;
338 }
339
341 void SetFadeOutTime(float time_in_s)
342 {
343 m_FadeOutTime = time_in_s * 1000;
344 }
345
347 void FadeOut(float time_in_s = -1)
348 {
349 float time_in_ms = time_in_s * 1000;
350
351 if (time_in_s == -1)
352 {
353 float kill_time_in_s = m_FadeOutTime*0.001;
354
355 FadeBrightnessTo(0, kill_time_in_s);
356 FadeRadiusTo(0, kill_time_in_s);
357 SetLifetime(kill_time_in_s);
358 }
359 else
360 {
361 FadeBrightnessTo(0, time_in_s);
362 FadeRadiusTo(0, time_in_s);
363 SetLifetime(time_in_s);
364 }
365 }
366
368 void FadeIn(float time_in_s)
369 {
370 float brightness = m_Brightness;
372 FadeBrightnessTo(brightness, time_in_s);
373 }
374
376 void AddLifetime(float life_in_s)
377 {
378 m_LifetimeEnd += life_in_s * 1000;
379 }
380
382 void OnFrameLightSource(IEntity other, float timeSlice)
383 {
384 // ...
385 }
386
388 override void EOnFrame(IEntity other, float timeSlice)
389 {
390 // Control lifetime of the light
391 int current_time = GetGame().GetTime();
392
393 if ( CheckLifetime(current_time) )
394 {
396 }
397 else
398 {
399 return;
400 }
401
402 HandleFlickering(current_time - m_LifetimeStart, timeSlice);
403 HandleDancingShadows(current_time - m_LifetimeStart, timeSlice);
404 CheckFadeOut(current_time);
405 HandleBrightnessFadeing(timeSlice);
406 HandleRadiusFadeing(timeSlice);
407
408 if (m_LightDimming)
409 m_LightDimming.HandleDimming(timeSlice);
410
413 OnFrameLightSource(other, timeSlice);
414
415 HandleBlinking(current_time);
416 }
417
419 void SetDancingShadowsAmplitude(float max_deviation_in_meters)
420 {
421 m_DancingShadowsAmplitude = Math.AbsFloat(max_deviation_in_meters);
422 }
423
425 void SetDancingShadowsMovementSpeed(float speed_in_meters_per_frame)
426 {
427 m_DancingShadowsSpeed = Math.AbsFloat(speed_in_meters_per_frame);
428 }
429
435
441
442 // Object and hidden selection ID which we can link to light source object
443 void SetSelectionID(int id)
444 {
446 }
447
448 // Update linked source object's material
450 {
451 EntityAI parent = EntityAI.Cast(m_Parent);
452 if (parent)
453 parent.SetObjectMaterial(m_HiddenSelectionID, path);
454 }
455
457 void EnableDebug(bool state)
458 {
459 m_IsDebugEnabled = state;
460 }
461
462 // Handles subtle movement of the light point to create the effect of dancing shadows
463 void HandleDancingShadows(float time, float timeSlice)
464 {
466 {
467 for (int i = 0; i < 3; i++ )
468 {
470
473
476
477 }
478
479 if (m_Parent && !m_Parent.ToDelete())
480 {
481 // In order to move with the light, it must be detached from its parent first
482
483 m_Parent.RemoveChild(this);
485
486 m_Parent.AddChild(this, -1);
487 m_Parent.Update();
488 }
489
491 {
492 Particle p = ParticleManager.GetInstance().PlayInWorld( ParticleList.DEBUG_DOT, GetPosition() );
493 p.SetParticleParam( EmitorParam.SIZE, 0.01);
494 }
495 }
496 else
497 {
499 }
500 }
501
502 // Updates flickering light
521
523 void SetFlickerSpeed(float speed)
524 {
526 }
527
534
535 void SetFlickerAmplitudeMax(float coef)
536 {
538 }
539
540 void SetFlickerAmplitudeMin(float coef)
541 {
543 }
544
547 {
549 }
550
556
562
565 {
567 {
568 float distance_to_camera = vector.Distance( GetPosition(), GetGame().GetCurrentCameraPosition() );
569
570 if (distance_to_camera < m_OptimizeShadowsRadius)
571 {
572 SetCastShadow(false);
573 }
574 else
575 {
576 SetCastShadow(true);
577 }
578 }
579 }
580
582 void SetDisableShadowsWithinRadius(float radius_in_m)
583 {
584 m_OptimizeShadowsRadius = radius_in_m;
585 }
586
592
594 {
595 // TO DO: OPTIMIZE AND REFACTOR! THIS MUST BE HANDLED IN AN EVENT, NOT PER FRAME!
596
597 if (m_Parent)
598 {
599 EntityAI parent_EAI = EntityAI.Cast( m_Parent );
600
601 if (parent_EAI) // Check if the Cast was successfull
602 {
603 GameInventory GI = parent_EAI.GetInventory();
604
605 if (GI) // Prevents handling of light on the parent item when it's projected in inventory as the item in inventory character's hands.
606 {
607 bool is_in_cargo = GI.IsInCargo();
608
609 if (!is_in_cargo)
610 {
611 EntityAI parent2 = parent_EAI.GetHierarchyParent();
612
613 if (parent2 && parent2.GetInventory())
614 {
615 is_in_cargo = parent2.GetInventory().IsInCargo();
616 }
617 }
618
619 if ( is_in_cargo )
620 {
621 SetEnabled(false);
622 }
623 else
624 {
625 SetEnabled(true);
626 }
627 }
628 }
629 }
630 }
631
632 // Destroys this light if it's past it lifetime
633 private bool CheckLifetime(int current_time)
634 {
635 if ( current_time > m_LifetimeEnd && m_LifetimeEnd != -1 )
636 {
637 Destroy();
638 return false;
639 }
640
641 return true;
642 }
643
644 // Handles fade out effect at the end of lifetime
645 private void CheckFadeOut( int current_time)
646 {
647 // Control fade out of the light
648 if ( m_FadeOutTime != -1 && m_LifetimeEnd != -1 && current_time > m_LifetimeEnd - m_FadeOutTime )
649 {
650 m_FadeOutTime = -1;
651 m_FadeInTime = -1; // Stop fade in process
652 float time_left_in_s = (m_LifetimeEnd - current_time) * 0.001;
653 FadeBrightnessTo(0, time_left_in_s);
654 FadeRadiusTo(0, time_left_in_s);
655 }
656 }
657
658 // handles fading of brightness
659 private void HandleBrightnessFadeing(float timeSlice)
660 {
662 {
663 float brightness_difference = m_Brightness - m_BrightnessTarget;
664
665 if (brightness_difference > m_BrightnessSpeedOfChange*timeSlice)
666 brightness_difference = m_BrightnessSpeedOfChange*timeSlice;
667
668 if (brightness_difference < -m_BrightnessSpeedOfChange*timeSlice)
669 brightness_difference = -m_BrightnessSpeedOfChange*timeSlice;
670
671 m_Brightness -= brightness_difference;
672
673 if ( m_Brightness > 0 || m_BrightnessTarget > 0)
674 {
675 SetBrightness(m_Brightness * m_BrightnessPulse);
677 }
678 else
679 {
680 Destroy();
681 return;
682 }
683 }
684 else
685 {
686 SetBrightness(m_Brightness * m_BrightnessPulse);
688 }
689 }
690
691 // handles fading of radius
692 private void HandleRadiusFadeing(float timeSlice)
693 {
694 if ( m_Radius != m_RadiusTarget )
695 {
696 float radius_difference = m_Radius - m_RadiusTarget;
697
698 if (radius_difference > m_RadiusSpeedOfChange*timeSlice)
699 radius_difference = m_RadiusSpeedOfChange*timeSlice;
700
701 if (radius_difference < -m_RadiusSpeedOfChange*timeSlice)
702 radius_difference = -m_RadiusSpeedOfChange*timeSlice;
703
704 m_Radius -= radius_difference;
705
706 if ( m_Radius > 0 || m_RadiusTarget > 0)
707 {
709 }
710 else
711 {
712 Destroy();
713 return;
714 }
715 }
716 else
717 {
719 }
720 }
721
723 void SetBlinkingSpeed(float _speed)
724 {
725 m_BlinkingSpeed = _speed;
726 }
727
730 {
731 return m_BlinkingSpeed;
732 }
733
734 // handles blinking. Turns light on and off on regular intervals
735 private void HandleBlinking(float time)
736 {
737 if ( m_BlinkingSpeed <= 0 )
738 return;
739
740 float multiplier;
741
742 multiplier = Math.Sin(time * 0.001 * m_BlinkingSpeed); // Oscillate the multiplier overtime (time normalized to sec)
743 multiplier = (multiplier + 1)/2; // Normalized the value to 0-1
744
745 multiplier = Math.Round(multiplier); // Rounding to 0 or 1 to make it blink instantly
746 SetBrightness(m_Brightness * multiplier);
747 }
748
749 // Dimming
750 void EnableDimming(float baseBrightness, DimmingConfig dimCfg)
751 {
752 if (!m_LightDimming)
753 m_LightDimming = new LightDimming(this, baseBrightness, dimCfg);
754 }
755
757 {
758 return m_LightDimming;
759 }
760
762 {
763 m_LightDimming = null;
764 }
765};
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
void CreateLight()
Определения ExplosivesBase.c:175
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
void LightDimming(ScriptedLightBase light, float baseBrightness, DimmingConfig dimCfg)
Определения LightDimming.c:47
PlayerBase GetPlayer()
Определения ModifierBase.c:51
string path
Определения OptionSelectorMultistate.c:142
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Определения ParticleManager.c:88
void SetEnabled()
prevents insider adding in the wrong position, HOTFIX
Определения TrapTrigger.c:119
void SetRadius(float radius)
Определения WoodBase.c:295
proto int GetTime()
returns mission time in milliseconds
proto native void ObjectDelete(Object obj)
Определения DimmingConfig.c:2
Определения Building.c:6
void HandleBrightnessFadeing(float timeSlice)
Определения ScriptedLightBase.c:659
float m_BrightnessPulse
Определения ScriptedLightBase.c:19
float m_Brightness
Определения ScriptedLightBase.c:18
float m_BrightnessPulseSpeed
Определения ScriptedLightBase.c:20
Object GetAttachmentParent()
Returns attachment parent.
Определения ScriptedLightBase.c:156
float m_FadeInTime
Определения ScriptedLightBase.c:15
void EnableDimming(float baseBrightness, DimmingConfig dimCfg)
Определения ScriptedLightBase.c:750
void HandleBlinking(float time)
Определения ScriptedLightBase.c:735
float m_Radius
Определения ScriptedLightBase.c:16
void UpdateLightSourceMaterial(string path)
Определения ScriptedLightBase.c:449
vector m_LocalPos
Определения ScriptedLightBase.c:37
float m_FadeOutTime
Определения ScriptedLightBase.c:14
float m_BrightnessTarget
Определения ScriptedLightBase.c:23
void SetLifetime(float life_in_s)
Makes the light destroy itself after the given time in seconds. The light will fade out if it's set t...
Определения ScriptedLightBase.c:334
void FadeIn(float time_in_s)
Makes the light fade into existence. Works only at the moment the light is created....
Определения ScriptedLightBase.c:368
float m_BrightnessSpeedOfChange
Определения ScriptedLightBase.c:24
void SetFadeOutTime(float time_in_s)
Sets the fade out time in seconds. Fade out begins automatically as the light nears the end of its li...
Определения ScriptedLightBase.c:341
override void EOnFrame(IEntity other, float timeSlice)
On frame event. If you want to control your light within your own rules then override the event OnFra...
Определения ScriptedLightBase.c:388
void ~ScriptedLightBase()
Определения ScriptedLightBase.c:55
float m_BlinkingSpeed
Определения ScriptedLightBase.c:31
bool m_IsDebugEnabled
Определения ScriptedLightBase.c:34
void TryShadowOptimization()
Optimizes shadows by disabling them on this light source while it's within the given radius around th...
Определения ScriptedLightBase.c:564
float m_LifetimeStart
Определения ScriptedLightBase.c:12
void HandleRadiusFadeing(float timeSlice)
Определения ScriptedLightBase.c:692
void SetBrightnessTo(float value)
Sets the brightness of the light.
Определения ScriptedLightBase.c:255
float m_RadiusSpeedOfChange
Определения ScriptedLightBase.c:25
void DeleteLightWithDelay()
Correct way of deleting light from memory. It is necesarry to have this delay due to hierarchy.
Определения ScriptedLightBase.c:106
static ScriptedLightBase CreateLightAtObjMemoryPoint(typename name, notnull Object target, string memory_point_start, string memory_point_target="", vector global_pos="0 0 0", float fade_in_time_in_s=0)
Определения ScriptedLightBase.c:212
static ref set< ScriptedLightBase > m_NightTimeOnlyLights
Определения ScriptedLightBase.c:44
static ScriptedLightBase CreateLight(typename name, vector global_pos="0 0 0", float fade_in_time_in_s=0)
Creates an instance of light on the given position. Optionally, use fade_in_time_in_s parameter to ma...
Определения ScriptedLightBase.c:224
override bool IsScriptedLight()
Определения ScriptedLightBase.c:78
void SetDancingShadowsMovementSpeed(float speed_in_meters_per_frame)
Sets the maximum speed of the point light within the dancing shadows effect.
Определения ScriptedLightBase.c:425
float GetDisableShadowsWithinRadius()
Returns the range you put inside SetDisableShadowsWithinRadius(...)
Определения ScriptedLightBase.c:588
float GetBlinkingSpeed()
Returns the speed of blinks.
Определения ScriptedLightBase.c:729
float m_BrightnessPulseAmplitudeMax
Определения ScriptedLightBase.c:21
void HandleDancingShadows(float time, float timeSlice)
Определения ScriptedLightBase.c:463
void SetBlinkingSpeed(float _speed)
Sets blinking speed (no blinking if speed <= 0)
Определения ScriptedLightBase.c:723
void AddLifetime(float life_in_s)
Prolongs the lifetime of the light in seconds. Use negative number to shorten its lifetime.
Определения ScriptedLightBase.c:376
float m_RadiusTarget
Определения ScriptedLightBase.c:17
void Destroy()
Switches off the light and deletes it from memory.
Определения ScriptedLightBase.c:323
void UpdateMode()
Определения ScriptedLightBase.c:83
void SetDancingShadowsAmplitude(float max_deviation_in_meters)
Sets the maximum range of the point light within the dancing shadows effect.
Определения ScriptedLightBase.c:419
void CheckIfParentIsInCargo()
Определения ScriptedLightBase.c:593
void DetachFromParent()
Detaches this light from its parent entity.
Определения ScriptedLightBase.c:192
void ScriptedLightBase()
Constructor. Everything here is executed before the constructor of all children.
Определения ScriptedLightBase.c:47
float GetFlickerAmplitudeCoefMin()
Returns flicker amplitude minimum.
Определения ScriptedLightBase.c:558
ref LightDimming m_LightDimming
Определения ScriptedLightBase.c:42
LightDimming GetDimming()
Определения ScriptedLightBase.c:756
void SetFlickerSpeed(float speed)
Sets speed of light flickering (random brightness coefficient change per second)
Определения ScriptedLightBase.c:523
void SetFlickerAmplitudeMax(float coef)
Определения ScriptedLightBase.c:535
override void EOnInit(IEntity other, int extra)
Определения ScriptedLightBase.c:67
Object m_Parent
Определения ScriptedLightBase.c:36
float GetDancingShadowsAmplitude()
Returns max movement range of pointlight within the dancing shadow effect.
Определения ScriptedLightBase.c:431
void AttachOnMemoryPoint(Object parent, string memory_point_start, string memory_point_target="")
Attaches this light on the parent entity's memory point, with optional direction target memory point.
Определения ScriptedLightBase.c:162
float GetDancingShadowsMovementSpeed()
Returns max movement speed of pointlight within the dancing shadow effect.
Определения ScriptedLightBase.c:437
void AttachOnObject(Object parent, vector local_pos="0 0 0", vector local_ori="0 0 0")
Attaches this light on the parent entity, with optional position and orientation offset.
Определения ScriptedLightBase.c:127
vector m_DancingShadowsLocalPos
Определения ScriptedLightBase.c:39
float m_OptimizeShadowsRadius
Определения ScriptedLightBase.c:26
float GetFlickerSpeed()
Returns flicker speed.
Определения ScriptedLightBase.c:546
void CorrectLightPulseDuringDaylight()
Call this after using SetBrightness(...) to fix light's intensity during daytime.
Определения ScriptedLightBase.c:264
void SetFlickerAmplitude(float coef)
Sets the change coefficient of flickering light. (0.0 - 1.0 values, result of greater values are peri...
Определения ScriptedLightBase.c:529
float GetFlickerAmplitudeCoefMax()
Returns flicker amplitude maximum.
Определения ScriptedLightBase.c:552
void HandleFlickering(float time, float timeSlice)
Определения ScriptedLightBase.c:503
void SetRadiusTo(float value)
Sets the radius of the light.
Определения ScriptedLightBase.c:300
void FadeOut(float time_in_s=-1)
Starts the fade out process and destroys the light when its done. Optional parameter allows you to se...
Определения ScriptedLightBase.c:347
void FadeBrightnessTo(float value, float time_in_s)
Fades the brightness of the light to the given value.
Определения ScriptedLightBase.c:285
void SetFlickerAmplitudeMin(float coef)
Определения ScriptedLightBase.c:540
void SetDisableShadowsWithinRadius(float radius_in_m)
When the light source gets within this radius (radius_in_m) around the camera, then it's shadows are ...
Определения ScriptedLightBase.c:582
vector m_LocalOri
Определения ScriptedLightBase.c:38
void OnFrameLightSource(IEntity other, float timeSlice)
Override this for custom functionality.
Определения ScriptedLightBase.c:382
float m_LifetimeEnd
Определения ScriptedLightBase.c:13
void SetSelectionID(int id)
Определения ScriptedLightBase.c:443
void FadeRadiusTo(float value, float time_in_s)
Fades the radius of the light to the given value.
Определения ScriptedLightBase.c:308
float m_BrightnessPulseAmplitudeMin
Определения ScriptedLightBase.c:22
ref Timer m_DeleteTimer
Определения ScriptedLightBase.c:41
void StopDimming()
Определения ScriptedLightBase.c:761
void EnableDebug(bool state)
Enables some debug functionality of this light.
Определения ScriptedLightBase.c:457
int m_HiddenSelectionID
Определения ScriptedLightBase.c:32
void CheckFadeOut(int current_time)
Определения ScriptedLightBase.c:645
float m_DancingShadowsSpeed
Определения ScriptedLightBase.c:29
void UpdateLightMode(string slotName)
bool CheckLifetime(int current_time)
Определения ScriptedLightBase.c:633
void DeleteLightNow()
Определения ScriptedLightBase.c:121
float m_DancingShadowsAmplitude
Определения ScriptedLightBase.c:28
bool IsInCargo()
Returns true if this Inventory owner is in cargo of something.
Определения Inventory.c:395
script counterpart to engine's class Inventory
Определения Inventory.c:79
Определения EnEntity.c:165
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetType()
returns type of InventoryLocation
InventoryLocation.
Определения InventoryLocation.c:29
static proto native owned string GetSlotName(int id)
converts slot_id to string
provides access to slot configuration
Определения InventorySlots.c:6
Определения InventoryItem.c:731
Определения EnMath.c:7
Определения ObjectTyped.c:2
void SetParticleParam(int parameter_id, float value)
Set the value of a parameter of all emitors in the particle.
Определения Particle.c:611
Legacy way of using particles in the game.
Определения Particle.c:7
static const int DEBUG_DOT
Определения ParticleList.c:23
Определения ParticleList.c:12
Определения PlayerBaseClient.c:2
Определения DayZPlayerImplement.c:63
static vector Direction(vector p1, vector p2)
Returns direction vector from point p1 to point p2.
Определения EnConvert.c:220
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
Определения EnConvert.c:106
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90
enum ShapeType ErrorEx
proto native void SetPosition(vector position)
Set the world position of the Effect.
Определения Effect.c:438
proto native void Destroy()
Cleans up the Effect, including unregistering if needed.
Определения Effect.c:214
EntityEvent
Entity events for event-mask, or throwing event from code.
Определения EnEntity.c:45
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Round(float f)
Returns mathematical round of value.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
static proto float Sin(float angle)
Returns sinus of angle in radians.
static proto float AbsFloat(float f)
Returns absolute value.
EmitorParam
Определения EnVisual.c:114
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9
const int CALL_CATEGORY_SYSTEM
Определения tools.c:8
proto native Widget GetParent()
Get parent of the Effect.
Определения Effect.c:407