14 {
15 string root_path =
"cfgCharacterScenes " +
g_Game.GetWorldName();
16
17 int count =
g_Game.ConfigGetChildrenCount(root_path);
18 int index = Math.RandomInt(0, count - 1);
19 string childName;
20 g_Game.ConfigGetChildName(root_path, index, childName);
21
22 string scene_path = root_path + " " + childName;
24 vector position =
SwapYZ(
g_Game.ConfigGetVector(scene_path +
" position"));
27 g_Game.ConfigGetIntArray(scene_path +
" date", date);
28 float fov =
g_Game.ConfigGetFloat(scene_path +
" fov");
29 float overcast =
g_Game.ConfigGetFloat(scene_path +
" overcast");
30 float rain =
g_Game.ConfigGetFloat(scene_path +
" rain");
31 float snowfall =
g_Game.ConfigGetFloat(scene_path +
" snowfall");
32 float fog =
g_Game.ConfigGetFloat(scene_path +
" fog");
33 float windspeed = -1;
34 if (
g_Game.ConfigIsExisting(scene_path +
" windspeed") ) windspeed =
g_Game.ConfigGetFloat(scene_path +
" windspeed");
35 g_Game.ConfigGetFloatArray(scene_path +
" storm", storm);
36
37 World world =
g_Game.GetWorld();
38
39 if (world && date.Count() >= 5)
40 {
41 world.
SetDate(date.Get(0), date.Get(1), date.Get(2), date.Get(3), date.Get(4));
42 }
43
46
48
50 {
51
55
57
61
64 float pos_y =
g_Game.SurfaceY(pos_x, pos_z);
65 vector ground_demo_pos =
Vector(pos_x, pos_y, pos_z);
67
69 m_CharacterRot[0] = Math.Atan2(to_cam_dir[0], to_cam_dir[2]) * Math.RAD2DEG;
70 }
71
73 m_Weather.GetOvercast().SetLimits( overcast, overcast );
74 m_Weather.GetRain().SetLimits( rain, rain );
75 m_Weather.GetSnowfall().SetLimits( snowfall, snowfall );
77
78 m_Weather.GetOvercast().Set( overcast, 0, 0);
80 m_Weather.GetSnowfall().Set( snowfall, 0, 0);
82
83 if ( storm.Count() == 3 )
84 {
85 m_Weather.SetStorm(storm.Get(0),storm.Get(1),storm.Get(2));
86 }
87
88 if ( windspeed != -1 )
89 {
93 }
94
97
98 PPEffects.Init();
99
101 }
vector SwapYZ(vector vec)
void SetInitPostprocesses()
Since this can get created at the same time as DayZGame, non-static postprocesses need to be deffered...
ref IntroSceneCharacter m_Character
vector SnapToGround(vector pos)
void IntroSceneCharacter()
proto native void SetDate(int year, int month, int day, int hour, int minute)
Sets actual ingame world time.
proto vector Multiply4(vector mat[4])
Transforms position.
array< float > TFloatArray
proto native vector Vector(float x, float y, float z)
Vector constructor from components.