DayZ 1.30
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 {
49 m_LifetimeStart = g_Game.GetTime();
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(g_Game.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 (g_Game)
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 g_Game.ObjectDelete(this);
124 }
125
127 void AttachOnObject(Object parent, vector local_pos = vector.Zero, vector local_ori = vector.Zero)
128 {
129 AttachOnObjectPivot(parent, -1, local_pos, local_ori);
130 }
131
132 void AttachOnObjectPivot(Object parent, int pivotIndex, vector localPosition = vector.Zero, vector localOrientation = vector.Zero)
133 {
134 if (!parent)
135 {
136 if (m_Parent)
137 m_Parent.RemoveChild(this);
138
139 return;
140 }
141 else
142 {
143 if (m_Parent)
144 m_Parent.RemoveChild(this);
145 }
146
147 m_Parent = parent;
148 m_LocalPos = localPosition;
149 m_LocalOri = localOrientation;
150
151 SetOrientation(localOrientation);
152 SetPosition(localPosition);
153
154 parent.AddChild(this, pivotIndex);
155 parent.Update();
156 }
157
160 {
161 return m_Parent;
162 }
163
165 void AttachOnMemoryPoint(Object parent, string memory_point_start, string memory_point_target = "")
166 {
167 if (parent.MemoryPointExists(memory_point_start))
168 {
169 m_LocalPos = parent.GetMemoryPointPos(memory_point_start);
170 vector local_ori;
171
172 if (memory_point_target != "" )
173 {
174 if (parent.MemoryPointExists(memory_point_target))
175 {
176 vector target_pos = parent.GetSelectionPositionLS(memory_point_target);
177 target_pos = vector.Direction(m_LocalPos, target_pos);
178 local_ori = target_pos.VectorToAngles();
179 }
180 else
181 {
182 ErrorEx("memory point 'memory_point_target' not found when attaching light");
183 }
184 }
185 AttachOnObject(parent, m_LocalPos, local_ori);
186 UpdateMode();
187 }
188 else
189 {
190 ErrorEx("memory point 'memory_point_start' not found when attaching light");
191 }
192 }
193
196 {
197 if (!m_Parent)
198 {
199 m_Parent = Object.Cast( GetParent() );
200 }
201
202 if (m_Parent)
203 {
204 if ( !m_Parent.ToDelete() && !ToDelete() )
205 {
206 m_Parent.RemoveChild(this);
207 }
208 }
209
210 m_Parent = null;
211 m_LocalPos = Vector(0,0,0);
212 m_LocalOri = Vector(0,0,0);
213 }
214
215 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)
216 {
217 ScriptedLightBase light;
218 if (target.MemoryPointExists(memory_point_start))
219 {
220 light = CreateLight(name, global_pos, fade_in_time_in_s);
221 light.AttachOnMemoryPoint(target, memory_point_start, memory_point_target);
222 }
223 return light;
224 }
225
227 static ScriptedLightBase CreateLight(typename name, vector global_pos = "0 0 0", float fade_in_time_in_s = 0)
228 {
229 ScriptedLightBase light_instance;
230
231 if ( !g_Game.IsServer() || !g_Game.IsMultiplayer() ) // Client side
232 {
233 light_instance = ScriptedLightBase.Cast( g_Game.CreateObject(name.ToString(), global_pos, true) );
234
235 if (!light_instance)
236 {
237 Error("Error! Light entity of name " + name.ToString() + " cannot be spawned! This name is incorrect or not inherited from ScriptedLightBase." );
238 return null;
239 }
240
241 if (fade_in_time_in_s != 0)
242 {
243 light_instance.FadeIn(fade_in_time_in_s);
244 }
245 }
246 else // Server side
247 {
248 if ( g_Game.IsDebug() )
249 {
250 Error("An instance of ScriptedLightBase was attempted to spawn on server side! Lights are CLIENT SIDE ONLY!");
251 }
252 }
253
254 return light_instance;
255 }
256
258 void SetBrightnessTo(float value)
259 {
260 m_Brightness = value;
261 m_BrightnessTarget = value;
262 SetBrightness(m_Brightness * m_BrightnessPulse);
264 }
265
268 {
269 if (m_Brightness < 100)
270 {
271 float v = m_Brightness * 0.01;
272
273 if (v > 0)
274 {
275 float brightness_compesation = 1 / v;
276 float compenset_brightness = (m_Brightness * m_BrightnessPulse) * brightness_compesation;
277 SetBrightness(compenset_brightness);
278 SetPulseCoef(v);
279 }
280 }
281 else
282 {
283 SetPulseCoef(1);
284 }
285 }
286
288 void FadeBrightnessTo( float value, float time_in_s )
289 {
290 m_BrightnessTarget = value;
291
292 if (time_in_s == 0)
293 {
295 }
296 else
297 {
299 }
300 }
301
303 void SetRadiusTo(float value)
304 {
305 m_Radius = value;
306 m_RadiusTarget = value;
308 }
309
311 void FadeRadiusTo( float value, float time_in_s )
312 {
313 m_RadiusTarget = value;
314
315 if (time_in_s == 0)
316 {
318 }
319 else
320 {
322 }
323 }
324
326 void Destroy()
327 {
328 ClearEventMask(EntityEvent.FRAME);
329 SetEnabled(false);
330 if (m_Parent)
332 else
334 }
335
337 void SetLifetime(float life_in_s)
338 {
339 if(g_Game)
340 m_LifetimeEnd = g_Game.GetTime() + life_in_s * 1000;
341 }
342
344 void SetFadeOutTime(float time_in_s)
345 {
346 m_FadeOutTime = time_in_s * 1000;
347 }
348
350 void FadeOut(float time_in_s = -1)
351 {
352 float time_in_ms = time_in_s * 1000;
353
354 if (time_in_s == -1)
355 {
356 float kill_time_in_s = m_FadeOutTime*0.001;
357
358 FadeBrightnessTo(0, kill_time_in_s);
359 FadeRadiusTo(0, kill_time_in_s);
360 SetLifetime(kill_time_in_s);
361 }
362 else
363 {
364 FadeBrightnessTo(0, time_in_s);
365 FadeRadiusTo(0, time_in_s);
366 SetLifetime(time_in_s);
367 }
368 }
369
371 void FadeIn(float time_in_s)
372 {
373 float brightness = m_Brightness;
375 FadeBrightnessTo(brightness, time_in_s);
376 }
377
379 void AddLifetime(float life_in_s)
380 {
381 m_LifetimeEnd += life_in_s * 1000;
382 }
383
385 void OnFrameLightSource(IEntity other, float timeSlice)
386 {
387 // ...
388 }
389
391 override void EOnFrame(IEntity other, float timeSlice)
392 {
393 // Control lifetime of the light
394 int current_time = g_Game.GetTime();
395
396 if ( CheckLifetime(current_time) )
397 {
399 }
400 else
401 {
402 return;
403 }
404
405 HandleFlickering(current_time - m_LifetimeStart, timeSlice);
406 HandleDancingShadows(current_time - m_LifetimeStart, timeSlice);
407 CheckFadeOut(current_time);
408 HandleBrightnessFadeing(timeSlice);
409 HandleRadiusFadeing(timeSlice);
410
411 if (m_LightDimming)
412 m_LightDimming.HandleDimming(timeSlice);
413
416 OnFrameLightSource(other, timeSlice);
417
418 HandleBlinking(current_time);
419 }
420
422 void SetDancingShadowsAmplitude(float max_deviation_in_meters)
423 {
424 m_DancingShadowsAmplitude = Math.AbsFloat(max_deviation_in_meters);
425 }
426
428 void SetDancingShadowsMovementSpeed(float speed_in_meters_per_frame)
429 {
430 m_DancingShadowsSpeed = Math.AbsFloat(speed_in_meters_per_frame);
431 }
432
438
444
445 // Object and hidden selection ID which we can link to light source object
446 void SetSelectionID(int id)
447 {
449 }
450
451 // Update linked source object's material
453 {
454 EntityAI parent = EntityAI.Cast(m_Parent);
455 if (parent)
456 parent.SetObjectMaterial(m_HiddenSelectionID, path);
457 }
458
460 void EnableDebug(bool state)
461 {
462 m_IsDebugEnabled = state;
463 }
464
465 // Handles subtle movement of the light point to create the effect of dancing shadows
466 void HandleDancingShadows(float time, float timeSlice)
467 {
469 {
470 for (int i = 0; i < 3; i++ )
471 {
473
476
479
480 }
481
482 if (m_Parent && !m_Parent.ToDelete())
483 {
484 // In order to move with the light, it must be detached from its parent first
485
486 m_Parent.RemoveChild(this);
488
489 m_Parent.AddChild(this, -1);
490 m_Parent.Update();
491 }
492
494 {
495 Particle p = ParticleManager.GetInstance().PlayInWorld( ParticleList.DEBUG_DOT, GetPosition() );
496 p.SetParticleParam( EmitorParam.SIZE, 0.01);
497 }
498 }
499 else
500 {
502 }
503 }
504
505 // Updates flickering light
524
526 void SetFlickerSpeed(float speed)
527 {
529 }
530
537
538 void SetFlickerAmplitudeMax(float coef)
539 {
541 }
542
543 void SetFlickerAmplitudeMin(float coef)
544 {
546 }
547
550 {
552 }
553
559
565
568 {
570 {
571 float distance_to_camera = vector.Distance( GetPosition(), g_Game.GetCurrentCameraPosition() );
572
573 if (distance_to_camera < m_OptimizeShadowsRadius)
574 {
575 SetCastShadow(false);
576 }
577 else
578 {
579 SetCastShadow(true);
580 }
581 }
582 }
583
585 void SetDisableShadowsWithinRadius(float radius_in_m)
586 {
587 m_OptimizeShadowsRadius = radius_in_m;
588 }
589
595
597 {
598 // TO DO: OPTIMIZE AND REFACTOR! THIS MUST BE HANDLED IN AN EVENT, NOT PER FRAME!
599
600 if (m_Parent)
601 {
602 EntityAI parent_EAI = EntityAI.Cast( m_Parent );
603
604 if (parent_EAI) // Check if the Cast was successfull
605 {
606 GameInventory GI = parent_EAI.GetInventory();
607
608 if (GI) // Prevents handling of light on the parent item when it's projected in inventory as the item in inventory character's hands.
609 {
610 bool is_in_cargo = GI.IsInCargo();
611
612 if (!is_in_cargo)
613 {
614 EntityAI parent2 = parent_EAI.GetHierarchyParent();
615
616 if (parent2 && parent2.GetInventory())
617 {
618 is_in_cargo = parent2.GetInventory().IsInCargo();
619 }
620 }
621
622 if ( is_in_cargo )
623 {
624 SetEnabled(false);
625 }
626 else
627 {
628 SetEnabled(true);
629 }
630 }
631 }
632 }
633 }
634
635 // Destroys this light if it's past it lifetime
636 private bool CheckLifetime(int current_time)
637 {
638 if ( current_time > m_LifetimeEnd && m_LifetimeEnd != -1 )
639 {
640 Destroy();
641 return false;
642 }
643
644 return true;
645 }
646
647 // Handles fade out effect at the end of lifetime
648 private void CheckFadeOut( int current_time)
649 {
650 // Control fade out of the light
651 if ( m_FadeOutTime != -1 && m_LifetimeEnd != -1 && current_time > m_LifetimeEnd - m_FadeOutTime )
652 {
653 m_FadeOutTime = -1;
654 m_FadeInTime = -1; // Stop fade in process
655 float time_left_in_s = (m_LifetimeEnd - current_time) * 0.001;
656 FadeBrightnessTo(0, time_left_in_s);
657 FadeRadiusTo(0, time_left_in_s);
658 }
659 }
660
661 // handles fading of brightness
662 private void HandleBrightnessFadeing(float timeSlice)
663 {
665 {
666 float brightness_difference = m_Brightness - m_BrightnessTarget;
667
668 if (brightness_difference > m_BrightnessSpeedOfChange*timeSlice)
669 brightness_difference = m_BrightnessSpeedOfChange*timeSlice;
670
671 if (brightness_difference < -m_BrightnessSpeedOfChange*timeSlice)
672 brightness_difference = -m_BrightnessSpeedOfChange*timeSlice;
673
674 m_Brightness -= brightness_difference;
675
676 if ( m_Brightness > 0 || m_BrightnessTarget > 0)
677 {
678 SetBrightness(m_Brightness * m_BrightnessPulse);
680 }
681 else
682 {
683 Destroy();
684 return;
685 }
686 }
687 else
688 {
689 SetBrightness(m_Brightness * m_BrightnessPulse);
691 }
692 }
693
694 // handles fading of radius
695 private void HandleRadiusFadeing(float timeSlice)
696 {
697 if ( m_Radius != m_RadiusTarget )
698 {
699 float radius_difference = m_Radius - m_RadiusTarget;
700
701 if (radius_difference > m_RadiusSpeedOfChange*timeSlice)
702 radius_difference = m_RadiusSpeedOfChange*timeSlice;
703
704 if (radius_difference < -m_RadiusSpeedOfChange*timeSlice)
705 radius_difference = -m_RadiusSpeedOfChange*timeSlice;
706
707 m_Radius -= radius_difference;
708
709 if ( m_Radius > 0 || m_RadiusTarget > 0)
710 {
712 }
713 else
714 {
715 Destroy();
716 return;
717 }
718 }
719 else
720 {
722 }
723 }
724
726 void SetBlinkingSpeed(float _speed)
727 {
728 m_BlinkingSpeed = _speed;
729 }
730
733 {
734 return m_BlinkingSpeed;
735 }
736
737 // handles blinking. Turns light on and off on regular intervals
738 private void HandleBlinking(float time)
739 {
740 if ( m_BlinkingSpeed <= 0 )
741 return;
742
743 float multiplier;
744
745 multiplier = Math.Sin(time * 0.001 * m_BlinkingSpeed); // Oscillate the multiplier overtime (time normalized to sec)
746 multiplier = (multiplier + 1)/2; // Normalized the value to 0-1
747
748 multiplier = Math.Round(multiplier); // Rounding to 0 or 1 to make it blink instantly
749 SetBrightness(m_Brightness * multiplier);
750 }
751
752 // Dimming
753 void EnableDimming(float baseBrightness, DimmingConfig dimCfg)
754 {
755 if (!m_LightDimming)
756 m_LightDimming = new LightDimming(this, baseBrightness, dimCfg);
757 }
758
760 {
761 return m_LightDimming;
762 }
763
765 {
766 m_LightDimming = null;
767 }
768};
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DayZGame g_Game
Определения DayZGame.c:4074
void CreateLight()
Определения ExplosivesBase.c:155
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
void LightDimming(ScriptedLightBase light, float baseBrightness, DimmingConfig dimCfg)
Определения LightDimming.c:47
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
Определения DimmingConfig.c:2
void HandleBrightnessFadeing(float timeSlice)
Определения ScriptedLightBase.c:662
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:159
float m_FadeInTime
Определения ScriptedLightBase.c:15
void AttachOnObjectPivot(Object parent, int pivotIndex, vector localPosition=vector.Zero, vector localOrientation=vector.Zero)
Определения ScriptedLightBase.c:132
void EnableDimming(float baseBrightness, DimmingConfig dimCfg)
Определения ScriptedLightBase.c:753
void HandleBlinking(float time)
Определения ScriptedLightBase.c:738
float m_Radius
Определения ScriptedLightBase.c:16
void UpdateLightSourceMaterial(string path)
Определения ScriptedLightBase.c:452
vector m_LocalPos
Определения ScriptedLightBase.c:37
float m_FadeOutTime
Определения ScriptedLightBase.c:14
void AttachOnObject(Object parent, vector local_pos=vector.Zero, vector local_ori=vector.Zero)
Attaches this light on the parent entity, with optional position and orientation offset.
Определения ScriptedLightBase.c:127
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:337
void FadeIn(float time_in_s)
Makes the light fade into existence. Works only at the moment the light is created....
Определения ScriptedLightBase.c:371
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:344
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:391
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:567
float m_LifetimeStart
Определения ScriptedLightBase.c:12
void HandleRadiusFadeing(float timeSlice)
Определения ScriptedLightBase.c:695
void SetBrightnessTo(float value)
Sets the brightness of the light.
Определения ScriptedLightBase.c:258
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:215
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:227
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:428
float GetDisableShadowsWithinRadius()
Returns the range you put inside SetDisableShadowsWithinRadius(...)
Определения ScriptedLightBase.c:591
float GetBlinkingSpeed()
Returns the speed of blinks.
Определения ScriptedLightBase.c:732
float m_BrightnessPulseAmplitudeMax
Определения ScriptedLightBase.c:21
void HandleDancingShadows(float time, float timeSlice)
Определения ScriptedLightBase.c:466
void SetBlinkingSpeed(float _speed)
Sets blinking speed (no blinking if speed <= 0)
Определения ScriptedLightBase.c:726
void AddLifetime(float life_in_s)
Prolongs the lifetime of the light in seconds. Use negative number to shorten its lifetime.
Определения ScriptedLightBase.c:379
float m_RadiusTarget
Определения ScriptedLightBase.c:17
void Destroy()
Switches off the light and deletes it from memory.
Определения ScriptedLightBase.c:326
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:422
void CheckIfParentIsInCargo()
Определения ScriptedLightBase.c:596
void DetachFromParent()
Detaches this light from its parent entity.
Определения ScriptedLightBase.c:195
void ScriptedLightBase()
Constructor. Everything here is executed before the constructor of all children.
Определения ScriptedLightBase.c:47
float GetFlickerAmplitudeCoefMin()
Returns flicker amplitude minimum.
Определения ScriptedLightBase.c:561
ref LightDimming m_LightDimming
Определения ScriptedLightBase.c:42
LightDimming GetDimming()
Определения ScriptedLightBase.c:759
void SetFlickerSpeed(float speed)
Sets speed of light flickering (random brightness coefficient change per second)
Определения ScriptedLightBase.c:526
void SetFlickerAmplitudeMax(float coef)
Определения ScriptedLightBase.c:538
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:434
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:165
float GetDancingShadowsMovementSpeed()
Returns max movement speed of pointlight within the dancing shadow effect.
Определения ScriptedLightBase.c:440
vector m_DancingShadowsLocalPos
Определения ScriptedLightBase.c:39
float m_OptimizeShadowsRadius
Определения ScriptedLightBase.c:26
float GetFlickerSpeed()
Returns flicker speed.
Определения ScriptedLightBase.c:549
void CorrectLightPulseDuringDaylight()
Call this after using SetBrightness(...) to fix light's intensity during daytime.
Определения ScriptedLightBase.c:267
void SetFlickerAmplitude(float coef)
Sets the change coefficient of flickering light. (0.0 - 1.0 values, result of greater values are peri...
Определения ScriptedLightBase.c:532
float GetFlickerAmplitudeCoefMax()
Returns flicker amplitude maximum.
Определения ScriptedLightBase.c:555
void HandleFlickering(float time, float timeSlice)
Определения ScriptedLightBase.c:506
void SetRadiusTo(float value)
Sets the radius of the light.
Определения ScriptedLightBase.c:303
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:350
void FadeBrightnessTo(float value, float time_in_s)
Fades the brightness of the light to the given value.
Определения ScriptedLightBase.c:288
void SetFlickerAmplitudeMin(float coef)
Определения ScriptedLightBase.c:543
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:585
vector m_LocalOri
Определения ScriptedLightBase.c:38
void OnFrameLightSource(IEntity other, float timeSlice)
Override this for custom functionality.
Определения ScriptedLightBase.c:385
float m_LifetimeEnd
Определения ScriptedLightBase.c:13
void SetSelectionID(int id)
Определения ScriptedLightBase.c:446
void FadeRadiusTo(float value, float time_in_s)
Fades the radius of the light to the given value.
Определения ScriptedLightBase.c:311
float m_BrightnessPulseAmplitudeMin
Определения ScriptedLightBase.c:22
ref Timer m_DeleteTimer
Определения ScriptedLightBase.c:41
void StopDimming()
Определения ScriptedLightBase.c:764
void EnableDebug(bool state)
Enables some debug functionality of this light.
Определения ScriptedLightBase.c:460
int m_HiddenSelectionID
Определения ScriptedLightBase.c:32
void CheckFadeOut(int current_time)
Определения ScriptedLightBase.c:648
float m_DancingShadowsSpeed
Определения ScriptedLightBase.c:29
void UpdateLightMode(string slotName)
bool CheckLifetime(int current_time)
Определения ScriptedLightBase.c:636
void DeleteLightNow()
Определения ScriptedLightBase.c:121
float m_DancingShadowsAmplitude
Определения ScriptedLightBase.c:28
bool IsInCargo()
Returns true if this Inventory owner is in cargo of something.
script counterpart to engine's class Inventory
Определения 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:30
static proto native owned string GetSlotName(int id)
converts slot_id to string
provides access to slot configuration
Определения InventorySlots.c:6
Определения 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:39
static const vector Zero
Определения EnConvert.c:123
static vector Direction(vector p1, vector p2)
Returns direction vector from point p1 to point p2.
Определения EnConvert.c:254
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:119
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:463
proto native void Destroy()
Cleans up the Effect, including unregistering if needed.
Определения Effect.c:216
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
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473
const int CALL_CATEGORY_SYSTEM
Определения 3_Game/DayZ/tools/tools.c:8
proto native Widget GetParent()
Get parent of the Effect.
Определения Effect.c:422