DayZ 1.24
Loading...
Searching...
No Matches
DayZIntroSceneXbox.c
Go to the documentation of this file.
2{
3 protected bool m_IsCharFemale;
5
13
16 protected Weather m_Weather;
17 protected Object m_Clutter;
20 protected ref TIntArray m_Date = new TIntArray;
21
23
27
32
33 //==================================
34 // DayZIntroSceneXbox
35 //==================================
37 {
38 m_MenuData = g_Game.GetMenuData();
39
41 m_CharacterPos = "0 0 0";
42 m_CharacterDir = "0 0 0";
43
44 //g_Game.m_PlayerName = "Survivor"; //default
47
50
51 // Camera Setup
53 camera_position[0] = 1323.0; // X
54 camera_position[1] = 1.0; // Y
55 camera_position[2] = 1590.37; // Z
56 float camera_rotation_h = 100;
57 float camera_rotation_v = -3;
58 float camera_fov = 0.85;
59 float camera_focus_distance = 0.0;
60 float camera_focus_streght = 0.0;
61
62 // Character
63 float character_distance = 2.25;
64
65 // Camera Setup
67 m_SceneCamera.SetActive(true);
68
69 PPEffects.Init(); //Deprecated, left in for legacy purposes only
70
71 // Character Setup
72 vector cam_dir = m_SceneCamera.GetDirection();
76
77 float overcast = 0.42;
78 float rain = 0.0;
79 float fog = 0.0;
80
81 m_Weather = g_Game.GetWeather();
83 m_Weather.GetRain().SetLimits(rain, rain);
84 m_Weather.GetFog().SetLimits(fog, fog);
85
86 m_Weather.GetOvercast().Set(overcast, 0, 0);
87 m_Weather.GetRain().Set(rain, 0, 0);
88 m_Weather.GetFog().Set(fog, 0, 0);
89
91 m_Character.LoadCharacterData(m_CharacterPos, m_CharacterDir);
92
93 m_TimerParticle.Run(0.1, this, "SetupParticles", null, false);
94 //m_TimerDate.Run(2.0, this, "SetupDate", null, false);
95 m_TimerUpdate.Run(0.5, this, "SetupCharacter", null, true);
96
98 m_Clutter = GetGame().CreateObject("ClutterCutter2x2", clut_pos, true);
99
100 // Xbox check update
102
103 g_Game.SetHudBrightness(g_Game.GetHUDBrightnessSetting());
104
105 GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(SetInitPostprocesses);
106 }
107
109 {
110 if (m_TimerUpdate)
111 {
112 m_TimerUpdate.Stop();
113 delete m_TimerUpdate;
115 }
116
117 if (m_TimerParticle)
118 {
119 m_TimerParticle.Stop();
120 delete m_TimerParticle;
122 }
123
124
125 if (m_TimerDate)
126 {
127 m_TimerDate.Stop();
128 delete m_TimerDate;
130 }
131
133
134 GetGame().ObjectDelete(m_SceneCamera);
135
136 if (m_MenuData)
138
142
144 }
145
146 protected void SetInitPostprocesses()
147 {
150
151 requester.SetVignetteIntensity(0.3);
152 PPERequesterBank.GetRequester(PPERequester_IntroChromAbb).Start();
153 }
154
155 //==============================================
156 // GetIntroSceneCharacter
157 //==============================================
162
163 //==================================
164 // SetupCharacter
165 //==================================
167 {
168 if (m_Character.GetCharacterObj())
169 {
170 vector v = m_Character.GetCharacterObj().GetOrientation();
171 v[0] = -75;
172 m_Character.GetCharacterObj().SetOrientation(v);
173 }
174 }
175
176 //==================================
177 // SetupParticles
178 //==================================
180 {
182 //SEffectManager.PlayInWorld(m_FXParticleCarSmoke, "1330.36 2.11628 1594.31");
183 //SEffectManager.PlayInWorld(m_FXParticleCarSmoke, "1333.88 1.51392 1594.88");
184 SEffectManager.PlayInWorld(m_FXParticleCarSmoke, "1331.52 2.34052 1593.55");
185
186 vector pos = m_SceneCamera.GetPosition() + m_SceneCamera.GetDirection() * 1.5;
187 vector dir = m_SceneCamera.GetDirection();
188 float temp = dir[0];
189 dir[0] = dir[2];
190 dir[2] = -temp;
191
192 vector pos_right = pos + (dir * 1.5);
193 vector pos_left = pos + (-dir * 1.5);
194
197
200 }
201
202 //==================================
203 // SetupDate
204 //==================================
206 {
207 //g_Game.GetWorld().SetDate(m_Date.Get(0), m_Date.Get(1), m_Date.Get(2), m_Date.Get(3), m_Date.Get(4));
208 //g_Game.GetWorld().SetDate(2020, 10, 15, 18, 20);
209 }
210
211 //==================================
212 // CheckXboxClientUpdateLoopStart
213 //==================================
215 {
217 m_TimerClientUpdate.Run(30, this, "CheckXboxClientUpdate", null, true);
218 }
219
220 //==================================
221 // CheckXboxClientUpdateLoopStop
222 //==================================
224 {
226 {
227 m_TimerClientUpdate.Stop();
228 delete m_TimerClientUpdate;
230 }
231 }
232
233 //==================================
234 // CheckXboxClientUpdate
235 //==================================
237 {
239 }
240
241 //==================================
242 // CameraCreate
243 //==================================
245 {
246 Camera cam = Camera.Cast(g_Game.CreateObject("staticcamera", SnapToGround(cam_pos), true));
247 cam.SetOrientation(Vector(cam_rot_h, cam_rot_v, 0));
248 cam.SetFOV(cam_fov);
250
251 return cam;
252 }
253
254 //==================================
255 // GetCamera
256 //==================================
258 {
259 return m_SceneCamera;
260 }
261
262 //==================================
263 // ResetIntroCamera
264 //==================================
266 {
267
268 }
269
270 //==================================
271 // SetCharacterFemale
272 //==================================
274 {
276 }
277
278 //==================================
279 // IsCharacterFemale
280 //==================================
282 {
283 return m_IsCharFemale;
284 }
285
286 //==================================
287 // CreateRandomCharacter
288 //==================================
290 {
291 string character_name;
292 string params[2];
293
295
296 if (m_IsCharFemale)
297 character_name = m_CharPersonalityFemaleList.GetRandomElement();
298 else
299 character_name = m_CharPersonalityMaleList.GetRandomElement();
300
301 GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(UpdateCharacterPos, 250);
302 }
303
305 {
306 string name;
307 BiosUserManager user_manager = GetGame().GetUserManager();
308 if (user_manager)
309 {
310 BiosUser user = user_manager.GetSelectedUser();
311 if (user)
312 {
313 g_Game.SetPlayerGameName(user.GetName());
314 return;
315 }
316 }
318 }
319
321 {
322 if (m_Character.GetCharacterObj())
323 {
324 m_Character.GetCharacterObj().SetPosition(m_CharacterPos);
325 m_Character.GetCharacterObj().SetDirection(m_CharacterDir.Normalized());
326 }
327 }
328
329 void SaveCharName(string name)
330 {
331 GetDayZGame().InitCharacterMenuDataInfo(m_MenuData.GetCharactersCount());
332
333 //if (!GetDayZGame().IsNewCharacter() && m_LastPlayedCharacterID > -1)
334 //{
336 //}
337 if (m_Character.IsDefaultCharacter())
338 GetGame().GetMenuDefaultCharacterData().SetCharacterName(name);
340 }
341
342 // ------------------------------------------------------------
344 {
345 float pos_x = pos[0];
346 float pos_z = pos[2];
347 float pos_y = GetGame().SurfaceY(pos_x, pos_z);
349 tmp_pos[1] = tmp_pos[1] + pos[1];
350
351 return tmp_pos;
352 }
353};
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Definition DayZGame.c:3528
DayZGame GetDayZGame()
Definition DayZGame.c:3530
PPERequesterCategory
Super root of all classes in Enforce script.
Definition EnScript.c:11
vector SnapToGround(vector pos)
ref TStringArray m_CharShirtList
Camera CameraCreate(vector cam_pos, float cam_rot_h, float cam_rot_v, float cam_fov, float cam_focus_dist, float cam_focus_strg)
ref TStringArray m_CharPersonalityFemaleList
ref TStringArray m_CharShoesList
ref MenuEvaporation m_FXParticleStreamLeft
ref TStringArray m_CharPantsList
ref TStringArray m_genderList
ref MenuEvaporation m_FXParticleStreamRight
ref IntroSceneCharacter m_Character
void SaveCharName(string name)
ref TStringArray m_CharPersonalityMaleList
IntroSceneCharacter GetIntroCharacter()
ref TStringArray m_AllCharacters
void SetCharacterFemale(bool fem)
ref MenuCarEngineSmoke m_FXParticleCarSmoke
TODO doc.
Definition EnScript.c:118
void IntroSceneCharacter()
Definition EnMath.c:7
proto native int GetLastPlayedCharacter()
proto void GetCharacterName(int index, out string name)
proto native void ClearCharacters()
proto native int GetCharactersCount()
proto native void SaveCharactersLocal()
Saves characters menu data to file.
proto native void SetCharacterName(int index, string newName)
static bool CheckUpdate()
Static component of PPE manager, used to hold the instance.
Definition PPEManager.c:3
static PPEManager GetPPEManager()
Returns the manager instance singleton.
Definition PPEManager.c:27
Deprecated; 'PPEManager' used instead.
Definition PPEffects.c:3
static void Init()
Definition PPEffects.c:52
Manager class for managing Effect (EffectParticle, EffectSound)
static int PlayInWorld(notnull Effect eff, vector pos)
Play an Effect.
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
proto native Fog GetFog()
Returns a fog phenomenon object.
proto native Rain GetRain()
Returns a rain phenomenon object.
proto native Overcast GetOvercast()
Returns an overcast phenomenon object.
proto vector Normalized()
return normalized vector (keeps orginal vector untouched)
proto native CGame GetGame()
const string DEFAULT_CHARACTER_NAME
Definition constants.c:838
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
array< int > TIntArray
Definition EnScript.c:668
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
const int CALL_CATEGORY_GAMEPLAY
Definition tools.c:10
const int CALL_CATEGORY_GUI
Definition tools.c:9