Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
dimmingconfig.c
Go to the documentation of this file.
2{
3 //randomization
4 float m_DimBrigthnessMin = 0.1;
5 float m_DimBrigthnessMax = 1;
6 float m_DimSpeedMin = 0.1;
7 float m_DimSpeedMax = 1;
8 float m_DimBrigthnessDurationMin = 0.1;
9 float m_DimBrigthnessDurationMax = 1;
10 float m_BrightenSpeedMin = 0.1;
11 float m_BrightenSpeedMax = 1;
12 float m_DimBrigthnessPauseMin = 1;
13 float m_DimBrigthnessPauseMax = 4;
14
15 // patterns
16 bool m_UsePatterns;
17 int m_PatternRepeatCount = -1; // -1 = infinite
18 int m_CurrentPatternID;
19 int m_PatternCount;
20 int m_CurrentEntryID;
21 ref array<ref array<int>> m_BrightnessPatterns = new array<ref array<int>>();
22 ref array<ref array<float>> m_DimSpeedPatterns = new array<ref array<float>>();
23 ref array<ref array<float>> m_DurationPatterns = new array<ref array<float>>();
24 ref array<ref array<float>> m_BrightenSpeedPatterns = new array<ref array<float>>();
25 ref array<ref array<float>> m_PausePatterns = new array<ref array<float>>();
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
53 m_DimBrigthnessDurationMin = min;
54 m_DimBrigthnessDurationMax = max;
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
63 m_BrightenSpeedMin = min;
64 m_BrightenSpeedMax = max;
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
73 m_DimBrigthnessPauseMin = min;
74 m_DimBrigthnessPauseMax = max;
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
95 m_PatternCount++;
96 }
97
98 // Set how many times should the patterns repeat before stopping, default -1 = infinite repeat
99 void SetPatternQueueRepeat(int val)
100 {
101 m_PatternRepeatCount = val;
102 }
103}
Definition enmath.c:7
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString()
enum ShapeType ErrorEx