Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
WeatherCinematicTrack.c
Go to the documentation of this file.
1[CinematicTrackAttribute(name:"Weather Track", description:"Allows you to change weather options")]
3{
4 [Attribute("0.0", params:"0.0 23.9")]
5 float m_fTimeOfDay;
6
7 [Attribute("0", params:"0 3")]
8 int m_iWeatherType;
9
10 [Attribute("false")]
11 bool setSpecifics;
12
13 [Attribute("0.0", params:"0.0 20.0")]
14 float m_fWindSpeed;
15
16 [Attribute("0.0", params:"0.0 360.0")]
17 float m_fWindDirection;
18
19 [Attribute("0.0", params:"0.0 1.0")]
20 float m_fWetness;
21
22 [Attribute("0.0", params:"0.0 1.0")]
23 float m_fPuddles;
24
25 [Attribute("0.0", params:"0.0 1.0")]
26 float m_fFog;
27
28 [Attribute("0.0", params:"0.0 1.0")]
29 float m_fFogHeight;
30
31
32 [Attribute("false")]
33 bool setDate;
34
35 [Attribute("1989")]
36 int m_iYear;
37
38 [Attribute("4")]
39 int m_iMonth;
40
41 [Attribute("1")]
42 int m_iDay;
43
44 float m_fActualTimeOfDay;
45 float m_fActualWindSpeed;
46 float m_fActualWindDirection;
47 int m_iActualWeatherType;
48
49 ChimeraWorld chimWorld;
50
51 TimeAndWeatherManagerEntity weatherManager;
52
53 override void OnInit(World world)
54 {
55 chimWorld = world;
56
57 m_iActualWeatherType = -1;
58
59 if(chimWorld)
60 weatherManager = chimWorld.GetTimeAndWeatherManager();
61
62
63 m_fActualTimeOfDay = -1;
64 m_fActualWindSpeed = -1;
65 m_fActualWindDirection = -1;
66 }
67
68 override void OnApply(float time)
69 {
70
71 if (weatherManager)
72 {
73
74 WeatherState weatherState = weatherManager.GetCurrentWeatherState();
75
76 if (setSpecifics)
77 {
78 weatherManager.SetFogAmountOverride(true, m_fFog);
79 weatherManager.SetFogHeightDensityOverride(true, m_fFogHeight);
80 weatherManager.SetCurrentWetness(m_fWetness);
81 weatherManager.SetCurrentWaterAccumulation(0,m_fPuddles);
82
83 //Wind speed and direction
84 if (m_fWindSpeed != m_fActualWindSpeed)
85 {
86 weatherManager.SetWindSpeedOverride(true, m_fWindSpeed);
87 m_fActualWindSpeed = m_fWindSpeed;
88 }
89
90 if (m_fWindDirection != m_fActualWindDirection)
91 {
92 weatherManager.SetWindDirectionOverride(true, m_fWindDirection);
93 m_fActualWindDirection = m_fWindDirection;
94 }
95 }
96
97 //Time of day
98 if (m_fTimeOfDay != m_fActualTimeOfDay)
99 {
100 weatherManager.SetTimeOfTheDay(m_fTimeOfDay, true);
101
102 if (setDate)
103 {
104 weatherManager.SetDate(m_iYear, m_iMonth, m_iDay);
105 }
106 m_fActualTimeOfDay = m_fTimeOfDay;
107 }
108
109
110 if ( m_iWeatherType == 0 && weatherState.GetStateName() != "Clear")
111 {
112 weatherManager.ForceWeatherTo(false, "Clear");
113
114 } else if ( m_iWeatherType == 1 && weatherState.GetStateName() != "Cloudy") {
115
116 weatherManager.ForceWeatherTo(false, "Cloudy");
117
118 } else if ( m_iWeatherType == 2 && weatherState.GetStateName() != "Overcast") {
119
120 weatherManager.ForceWeatherTo(false, "Overcast");
121
122 } else if (m_iWeatherType == 3 && weatherState.GetStateName() != "Rainy") {
123
124 weatherManager.ForceWeatherTo(false, "Rainy");
125 }
126
127 weatherManager.UpdateWeather(0.01);
128 }
129 }
130}
Definition World.c:16
SCR_FieldOfViewSettings Attribute