DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
DayZIntroSceneXbox.c
См. документацию.
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
40 m_LastPlayedCharacterID = m_MenuData.GetLastPlayedCharacter();
41 m_CharacterPos = "0 0 0";
42 m_CharacterDir = "0 0 0";
43
44 //g_Game.m_PlayerName = "Survivor"; //default
45 if ( m_MenuData.GetCharactersCount() == 0 )
46 {
48 }
49
50 if ( m_LastPlayedCharacterID > -1 )
51 {
52 string characterName = g_Game.GetPlayerGameName();
53 m_MenuData.GetCharacterName(m_LastPlayedCharacterID, characterName);
54 g_Game.SetPlayerGameName(characterName);
55 }
56
57 // Camera Setup
58 vector camera_position;
59 camera_position[0] = 1323.0; // X
60 camera_position[1] = 1.0; // Y
61 camera_position[2] = 1590.37; // Z
62 float camera_rotation_h = 100;
63 float camera_rotation_v = -3;
64 float camera_fov = 0.85;
65 float camera_focus_distance = 0.0;
66 float camera_focus_streght = 0.0;
67
68 // Character
69 float character_distance = 2.25;
70
71 // Camera Setup
72 m_SceneCamera = CameraCreate(camera_position, camera_rotation_h, camera_rotation_v, camera_fov, camera_focus_distance, camera_focus_streght);
73 m_SceneCamera.SetActive(true);
74
75 PPEffects.Init(); //Deprecated, left in for legacy purposes only
76
77 // Character Setup
78 vector cam_dir = m_SceneCamera.GetDirection();
79 m_CharacterPos = camera_position + ( cam_dir * character_distance );
81 m_CharacterDir = (camera_position - m_CharacterPos);
82
83 float overcast = 0.42;
84 float rain = 0.0;
85 float snowfall = 0.0;
86 float fog = 0.0;
87
88
89 m_Weather = g_Game.GetWeather();
90 m_Weather.GetOvercast().SetLimits(overcast, overcast);
91 m_Weather.GetRain().SetLimits(rain, rain);
92 m_Weather.GetSnowfall().SetLimits(snowfall, snowfall);
93 m_Weather.GetFog().SetLimits(fog, fog);
94
95 m_Weather.GetOvercast().Set(overcast, 0, 0);
96 m_Weather.GetRain().Set(rain, 0, 0);
97 m_Weather.GetSnowfall().Set(snowfall, 0, 0);
98 m_Weather.GetFog().Set(fog, 0, 0);
99
100 if (m_Weather.GetSandstorm().IsActive())
101 m_Weather.GetSandstorm().Stop(0, false);
102
104 m_Character.LoadCharacterData(m_CharacterPos, m_CharacterDir);
105
106 m_TimerParticle.Run(0.1, this, "SetupParticles", null, false);
107 //m_TimerDate.Run(2.0, this, "SetupDate", null, false);
108 m_TimerUpdate.Run(0.5, this, "SetupCharacter", null, true);
109
110 vector clut_pos = SnapToGround( m_CharacterPos + "-1 0 0" );
111 m_Clutter = g_Game.CreateObject( "ClutterCutter2x2", clut_pos, true );
112
113 // Xbox check update
115
116 g_Game.SetHudBrightness(g_Game.GetHUDBrightnessSetting());
117
119 }
120
122 {
123 if ( m_TimerUpdate )
124 {
125 m_TimerUpdate.Stop();
126 delete m_TimerUpdate;
127 m_TimerUpdate = null;
128 }
129
130 if ( m_TimerParticle )
131 {
132 m_TimerParticle.Stop();
133 delete m_TimerParticle;
134 m_TimerParticle = null;
135 }
136
137
138 if ( m_TimerDate )
139 {
140 m_TimerDate.Stop();
141 delete m_TimerDate;
142 m_TimerDate = null;
143 }
144
146
147 g_Game.ObjectDelete( m_SceneCamera );
148
149 if ( m_MenuData )
150 {
151 m_MenuData.ClearCharacters();
152 }
153
157
159 }
160
161 protected void SetInitPostprocesses()
162 {
163 PPERequester_MenuEffects requester;
164 Class.CastTo(requester,PPERequesterBank.GetRequester(PPERequester_MenuEffects));
165
166 requester.SetVignetteIntensity(0.3);
167 PPERequesterBank.GetRequester(PPERequester_IntroChromAbb).Start();
168 }
169
170 //==============================================
171 // GetIntroSceneCharacter
172 //==============================================
177
178 //==================================
179 // SetupCharacter
180 //==================================
182 {
183 if ( m_Character.GetCharacterObj() )
184 {
185 vector v = m_Character.GetCharacterObj().GetOrientation();
186 v[0] = -75;
187 m_Character.GetCharacterObj().SetOrientation(v);
188 }
189 }
190
191 //==================================
192 // SetupParticles
193 //==================================
195 {
197 //SEffectManager.PlayInWorld(m_FXParticleCarSmoke, "1330.36 2.11628 1594.31");
198 //SEffectManager.PlayInWorld(m_FXParticleCarSmoke, "1333.88 1.51392 1594.88");
199 SEffectManager.PlayInWorld(m_FXParticleCarSmoke, "1331.52 2.34052 1593.55");
200
201 vector pos = m_SceneCamera.GetPosition() + m_SceneCamera.GetDirection() * 1.5;
202 vector dir = m_SceneCamera.GetDirection();
203 float temp = dir[0];
204 dir[0] = dir[2];
205 dir[2] = -temp;
206
207 vector pos_right = pos + (dir * 1.5);
208 vector pos_left = pos + (-dir * 1.5);
209
212
215 }
216
217 //==================================
218 // SetupDate
219 //==================================
221 {
222 //g_Game.GetWorld().SetDate(m_Date.Get(0), m_Date.Get(1), m_Date.Get(2), m_Date.Get(3), m_Date.Get(4));
223 //g_Game.GetWorld().SetDate(2020, 10, 15, 18, 20);
224 }
225
226 //==================================
227 // CheckXboxClientUpdateLoopStart
228 //==================================
230 {
231 if ( CheckXboxClientUpdate() )
232 {
233 m_TimerClientUpdate.Run(30, this, "CheckXboxClientUpdate", null, true);
234 }
235 }
236
237 //==================================
238 // CheckXboxClientUpdateLoopStop
239 //==================================
241 {
243 {
244 m_TimerClientUpdate.Stop();
245 delete m_TimerClientUpdate;
246 m_TimerClientUpdate = null;
247 }
248 }
249
250 //==================================
251 // CheckXboxClientUpdate
252 //==================================
254 {
256 }
257
258 //==================================
259 // CameraCreate
260 //==================================
261 protected Camera CameraCreate(vector cam_pos, float cam_rot_h, float cam_rot_v, float cam_fov, float cam_focus_dist, float cam_focus_strg)
262 {
263 Camera cam = Camera.Cast( g_Game.CreateObject("staticcamera", SnapToGround(cam_pos), true));
264 cam.SetOrientation( Vector( cam_rot_h, cam_rot_v, 0) );
265 cam.SetFOV( cam_fov );
266 cam.SetFocus(cam_focus_dist, cam_focus_strg);
267
268 return cam;
269 }
270
271 //==================================
272 // GetCamera
273 //==================================
275 {
276 return m_SceneCamera;
277 }
278
279 //==================================
280 // ResetIntroCamera
281 //==================================
283 {
284
285 }
286
287 //==================================
288 // SetCharacterFemale
289 //==================================
290 void SetCharacterFemale(bool fem)
291 {
292 m_IsCharFemale = fem;
293 }
294
295 //==================================
296 // IsCharacterFemale
297 //==================================
299 {
300 return m_IsCharFemale;
301 }
302
303 //==================================
304 // CreateRandomCharacter
305 //==================================
307 {
308 string character_name;
309 string params[2];
310
312
313 if (m_IsCharFemale)
314 {
315 character_name = m_CharPersonalityFemaleList.GetRandomElement();
316 }
317 else
318 {
319 character_name = m_CharPersonalityMaleList.GetRandomElement();
320 }
321
322 g_Game.GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(UpdateCharacterPos, 250);
323 }
324
326 {
327 string name;
328 BiosUserManager user_manager = g_Game.GetUserManager();
329 if( user_manager )
330 {
331 BiosUser user = user_manager.GetSelectedUser();
332 if( user )
333 {
334 g_Game.SetPlayerGameName( user.GetName() );
335 return;
336 }
337 }
339 }
340
342 {
343 if (m_Character.GetCharacterObj())
344 {
345 m_Character.GetCharacterObj().SetPosition(m_CharacterPos);
346 m_Character.GetCharacterObj().SetDirection(m_CharacterDir.Normalized() );
347 }
348 }
349
350 void SaveCharName( string name )
351 {
352 GetDayZGame().InitCharacterMenuDataInfo(m_MenuData.GetCharactersCount());
353
354 //if (!GetDayZGame().IsNewCharacter() && m_LastPlayedCharacterID > -1)
355 //{
356 m_MenuData.SetCharacterName(m_LastPlayedCharacterID, name);
357 //}
358 if (m_Character.IsDefaultCharacter())
359 {
360 g_Game.GetMenuDefaultCharacterData().SetCharacterName(name);
361 }
362 m_MenuData.SaveCharactersLocal();
363 }
364
365 // ------------------------------------------------------------
367 {
368 float pos_x = pos[0];
369 float pos_z = pos[2];
370 float pos_y = g_Game.SurfaceY(pos_x, pos_z);
371 vector tmp_pos = Vector(pos_x, pos_y, pos_z);
372 tmp_pos[1] = tmp_pos[1] + pos[1];
373
374 return tmp_pos;
375 }
376};
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
DayZGame g_Game
Определения DayZGame.c:4074
DayZGame GetDayZGame()
Определения DayZGame.c:4076
PPERequesterCategory
Определения PPEConstants.c:29
proto native owned string GetName()
Определения BiosUserManager.c:9
proto native BiosUser GetSelectedUser()
Returns the currently selected user.
Определения Camera.c:85
Super root of all classes in Enforce script.
Определения EnScript.c:11
bool IsCharacterFemale()
Определения DayZIntroSceneXbox.c:298
vector SnapToGround(vector pos)
Определения DayZIntroSceneXbox.c:366
ref TStringArray m_CharShirtList
Определения DayZIntroSceneXbox.c:9
Camera m_SceneCamera
Определения DayZIntroSceneXbox.c:15
ref Timer m_TimerParticle
Определения DayZIntroSceneXbox.c:29
Camera CameraCreate(vector cam_pos, float cam_rot_h, float cam_rot_v, float cam_fov, float cam_focus_dist, float cam_focus_strg)
Определения DayZIntroSceneXbox.c:261
ref TStringArray m_CharPersonalityFemaleList
Определения DayZIntroSceneXbox.c:8
ref TStringArray m_CharShoesList
Определения DayZIntroSceneXbox.c:11
ref MenuEvaporation m_FXParticleStreamLeft
Определения DayZIntroSceneXbox.c:25
MenuData m_MenuData
Определения DayZIntroSceneXbox.c:22
void CreateRandomCharacter()
Определения DayZIntroSceneXbox.c:306
ref TStringArray m_CharPantsList
Определения DayZIntroSceneXbox.c:10
void SetupParticles()
Определения DayZIntroSceneXbox.c:194
ref TStringArray m_genderList
Определения DayZIntroSceneXbox.c:6
void ~DayZIntroSceneXbox()
Определения DayZIntroSceneXbox.c:121
ref MenuEvaporation m_FXParticleStreamRight
Определения DayZIntroSceneXbox.c:26
void SetupCharacter()
Определения DayZIntroSceneXbox.c:181
Weather m_Weather
Определения DayZIntroSceneXbox.c:16
void CheckXboxClientUpdateLoopStart()
Определения DayZIntroSceneXbox.c:229
ref Timer m_TimerDate
Определения DayZIntroSceneXbox.c:30
bool m_IsCharFemale
Определения DayZIntroSceneXbox.c:3
ref IntroSceneCharacter m_Character
Определения DayZIntroSceneXbox.c:14
bool CheckXboxClientUpdate()
Определения DayZIntroSceneXbox.c:253
void SetInitPostprocesses()
Определения DayZIntroSceneXbox.c:161
void UpdateCharacterPos()
Определения DayZIntroSceneXbox.c:341
void UpdateSelectedUserName()
Определения DayZIntroSceneXbox.c:325
vector m_CharacterPos
Определения DayZIntroSceneXbox.c:18
void SetupDate()
Определения DayZIntroSceneXbox.c:220
void SaveCharName(string name)
Определения DayZIntroSceneXbox.c:350
ref TStringArray m_CharPersonalityMaleList
Определения DayZIntroSceneXbox.c:7
ref Timer m_TimerClientUpdate
Определения DayZIntroSceneXbox.c:31
void DayZIntroSceneXbox()
Определения DayZIntroSceneXbox.c:36
ref TIntArray m_Date
Определения DayZIntroSceneXbox.c:20
Camera GetCamera()
Определения DayZIntroSceneXbox.c:274
int m_LastPlayedCharacterID
Определения DayZIntroSceneXbox.c:4
vector m_CharacterDir
Определения DayZIntroSceneXbox.c:19
IntroSceneCharacter GetIntroCharacter()
Определения DayZIntroSceneXbox.c:173
void CheckXboxClientUpdateLoopStop()
Определения DayZIntroSceneXbox.c:240
void ResetIntroCamera()
Определения DayZIntroSceneXbox.c:282
ref Timer m_TimerUpdate
Определения DayZIntroSceneXbox.c:28
ref TStringArray m_AllCharacters
Определения DayZIntroSceneXbox.c:12
Object m_Clutter
Определения DayZIntroSceneXbox.c:17
void SetCharacterFemale(bool fem)
Определения DayZIntroSceneXbox.c:290
ref MenuCarEngineSmoke m_FXParticleCarSmoke
Определения DayZIntroSceneXbox.c:24
void IntroSceneCharacter()
Определения IntroSceneCharacter.c:19
TODO doc.
Определения EnScript.c:118
Определения EnMath.c:7
Определения gameplay.c:917
Определения MenuEvaporation.c:2
Определения ObjectTyped.c:2
static bool CheckUpdate()
Определения OnlineServices.c:734
Определения OnlineServices.c:2
static PPEManager GetPPEManager()
Returns the manager instance singleton.
Определения PPEManager.c:27
Static component of PPE manager, used to hold the instance.
Определения PPEManager.c:3
static void Init()
Определения PPEffects.c:52
Deprecated; 'PPEManager' used instead.
Определения PPEffects.c:3
static int PlayInWorld(notnull Effect eff, vector pos)
Play an Effect.
Определения EffectManager.c:47
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Определения EffectManager.c:280
Manager class for managing Effect (EffectParticle, EffectSound)
Определения EffectManager.c:6
Определения DayZPlayerImplement.c:39
Определения Weather.c:168
Определения EnConvert.c:119
const string DEFAULT_CHARACTER_NAME
Определения 3_Game/DayZ/constants.c:1043
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
array< int > TIntArray
Определения EnScript.c:733
class array< Class T > TStringArray
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
Определения 3_Game/DayZ/tools/tools.c:10
const int CALL_CATEGORY_GUI
Определения 3_Game/DayZ/tools/tools.c:9