8 [
Attribute(defvalue:
"",
desc:
"Weather IDs are the same as used in the TimeAndWeatherManager. This sets the weather as soon as the game has been started. This weather will loop and never change automatically. If this is empty then the automated weather system will run instead")]
9 protected string m_sInitialStartingWeatherId;
11 [
Attribute(defvalue:
"0",
desc:
"If true it will make sure that the set weather will stay that weather state until the GM changes this")]
12 protected bool m_iSetWeatherConstant;
14 [
Attribute(defvalue:
"0.8",
desc:
"Takes float up to 24 (hours) and is used to randomize the inital weather duration. Must be lower then m_initialWeatherDurationMax. Is ignored if weather is constant.",
params:
"0.1 24")]
15 protected float m_initialWeatherDurationMin;
17 [
Attribute(defvalue:
"1.2",
desc:
"Takes float up to 24 (hours) and is used to randomize the inital weather duration. Must be higher then m_initialWeatherDurationMin. Is ignored if weather is constant.",
params:
"0.1 24")]
18 protected float m_initialWeatherDurationMax;
22 protected void InitWeatherServer()
24 if (!Replication.IsServer())
27 if (m_sInitialStartingWeatherId.IsEmpty())
33 Print(
"SCR_InitWeatherComponent is not inside a ChimeraWorld", LogLevel.WARNING);
37 TimeAndWeatherManagerEntity weatherManager = world.GetTimeAndWeatherManager();
40 Print(
"SCR_InitWeatherComponent could not find TimeAndWeatherManagerEntity", LogLevel.WARNING);
44 float weatherDuration = 0;
45 if (!m_iSetWeatherConstant)
47 if (m_initialWeatherDurationMin > m_initialWeatherDurationMax)
48 m_initialWeatherDurationMin = m_initialWeatherDurationMax;
50 weatherDuration = Math.RandomFloat(m_initialWeatherDurationMin, m_initialWeatherDurationMax);
53 weatherManager.ForceWeatherTo(m_iSetWeatherConstant, m_sInitialStartingWeatherId, weatherDuration * 0.5, weatherDuration * 0.5);
65 SetEventMask(owner, EntityEvent.INIT);