Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
dimmingconfig.c
Go to the documentation of this file.
2{
3 //randomization
4 float m_DimBrigthnessMin = 0.1;
6 float m_DimSpeedMin = 0.1;
7 float m_DimSpeedMax = 1;
10 float m_BrightenSpeedMin = 0.1;
14
15 // patterns
17 int m_PatternRepeatCount = -1; // -1 = infinite
26
27 // Percentage of base brightness, how strong can the dim be
28 void SetRandomBrigthnessLimits(float min, float max)
29 {
30 min = Math.Clamp(min, 0, 100);
31 max = Math.Clamp(max, 0, 100);
32
33 m_DimBrigthnessMin = min * 0.01;
34 m_DimBrigthnessMax = max * 0.01;
35 }
36
37 // Speed limits of of random dimming
38 void SetRandomDimSpeedLimits(float min, float max)
39 {
40 min = Math.Clamp(min, 0.01, 10);
41 max = Math.Clamp(max, 0.01, 10);
42
43 m_DimSpeedMin = min;
44 m_DimSpeedMax = max;
45 }
46
47 // Duration of paused dimmed state
48 void SetRandomDurationLimits(float min, float max)
49 {
50 min = Math.Clamp(min, 0.01, 100);
51 max = Math.Clamp(max, 0.01, 100);
52
55 }
56
57 // Speed limits of of random brightening
58 void SetRandomBrightenSpeedLimits(float min, float max)
59 {
60 min = Math.Clamp(min, 0.01, 10);
61 max = Math.Clamp(max, 0.01, 10);
62
65 }
66
67 // Duration of paused state without dimming in seconds
68 void SetRandomPauseDurationLimits(float min, float max)
69 {
70 min = Math.Clamp(min, 0.01, 100);
71 max = Math.Clamp(max, 0.01, 100);
72
75 }
76
77 // Adding a pattern will disable randomized dimming
78 void AddDimmingPattern(array<int> brightnessTarget, array<float> dimSpeed, array<float> dimDuration, array<float> brightenSpeed, array<float> pause)
79 {
80 int count = brightnessTarget.Count();
81 if ( count != dimSpeed.Count() || count != dimDuration.Count() || count != brightenSpeed.Count() || count != pause.Count())
82 {
83 ErrorEx(this.ToString() + ": Invalid dimming pattern");
84 return;
85 }
86
87 m_UsePatterns = true;
88
89 m_BrightnessPatterns.Insert(brightnessTarget);
90 m_DimSpeedPatterns.Insert(dimSpeed);
91 m_DurationPatterns.Insert(dimDuration);
92 m_BrightenSpeedPatterns.Insert(brightenSpeed);
93 m_PausePatterns.Insert(pause);
94
96 }
97
98 // Set how many times should the patterns repeat before stopping, default -1 = infinite repeat
100 {
102 }
103}
float m_DimSpeedMax
float m_BrightenSpeedMin
float m_BrightenSpeedMax
ref array< ref array< float > > m_DurationPatterns
ref array< ref array< float > > m_BrightenSpeedPatterns
void SetRandomPauseDurationLimits(float min, float max)
void AddDimmingPattern(array< int > brightnessTarget, array< float > dimSpeed, array< float > dimDuration, array< float > brightenSpeed, array< float > pause)
void SetPatternQueueRepeat(int val)
float m_DimBrigthnessPauseMin
void SetRandomDurationLimits(float min, float max)
ref array< ref array< float > > m_DimSpeedPatterns
void SetRandomBrightenSpeedLimits(float min, float max)
float m_DimBrigthnessMin
float m_DimBrigthnessMax
ref array< ref array< int > > m_BrightnessPatterns
float m_DimBrigthnessDurationMin
ref array< ref array< float > > m_PausePatterns
float m_DimBrigthnessDurationMax
float m_DimBrigthnessPauseMax
void SetRandomBrigthnessLimits(float min, float max)
float m_DimSpeedMin
void SetRandomDimSpeedLimits(float min, float max)
Definition enmath.c:7
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString()
enum ShapeType ErrorEx
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.