DayZ 1.24
Loading...
Searching...
No Matches
DayZIntroScene Class Reference
Inheritance diagram for DayZIntroScene:
[legend]
Collaboration diagram for DayZIntroScene:
[legend]

Protected Member Functions

void DayZIntroScene ()
 
void ~DayZIntroScene ()
 
IntroSceneCharacter GetIntroCharacter ()
 
Camera GetIntroCamera ()
 
void ResetIntroCamera ()
 
void SetInitPostprocesses ()
 Since this can get created at the same time as DayZGame, non-static postprocesses need to be deffered.
 
void GetSelectedUserName ()
 
vector SwapYZ (vector vec)
 
vector SnapToGround (vector pos)
 

Protected Attributes

ref IntroSceneCharacter m_Character
 
Camera m_Camera
 
vector m_CameraTrans [4]
 
vector m_CharacterPos
 
vector m_CharacterRot
 
Weather m_Weather
 
vector m_Target
 
ref OptionsMenu m_OptionsMenu
 

Additional Inherited Members

- Private Member Functions inherited from Managed
void IntroSceneCharacter ()
 
void ~IntroSceneCharacter ()
 
bool IsDefaultCharacter ()
 
void SetToDefaultCharacter ()
 
void SetCharacterID (int char_id)
 
int GetCharacterID ()
 
PlayerBase GetCharacterObj ()
 
TStringArray GetCharGenderList ()
 
TStringArray GetCharList (ECharGender gender)
 
TStringArray GetCharShirtsList ()
 
TStringArray GetCharPantsList ()
 
TStringArray GetCharShoesList ()
 
void SetCharacterGender (ECharGender gender)
 
bool IsCharacterFemale ()
 
ECharGender GetCharacterGender ()
 
vector GetPosition ()
 
int GetNextCharacterID ()
 
int GetPrevCharacterID ()
 
void CreateNewCharacterRandom ()
 
void CreateNewCharacterById (int character_id)
 
void CreateNewCharacterByName (string character_name, bool randomize_equip=true)
 
void CreateDefaultCharacter ()
 
void GetLastPlayedServer (int characterID, out string address, out string name, out int port)
 
void CreateNewCharacter ()
 
void LoadCharacterData (vector char_pos, vector char_rot, bool default_char=false)
 Generates random equip for the new IntroSceneCharacter, whatever is defined in 'cfgCharacterCreation'.
 
void CharacterUnload ()
 
void CharacterLoad (int character_id, vector char_pos, vector char_rot)
 
void SetupPlayerName (bool new_name)
 
void SetAttachment (string type, int slot)
 
string GetCharacterNameById (int char_id)
 
string GetCharacterName ()
 
void SaveCharName (string name)
 
void SaveDefaultCharacter ()
 
void TransferValues (PlayerBase player)
 
void Init ()
 
void OnScheduledTick (float deltatime)
 
void CheckValues ()
 
float GetBlood ()
 
float GetHealth ()
 
void CheckHealth ()
 
void CheckBlood ()
 
void SendInitValues ()
 Sends values on object creation.
 
void SendValue (int value_type, float value)
 
void ReceiveValue (int value_type, float value)
 
void OnRPC (ParamsReadContext ctx)
 
void ShowDebugValues (bool show)
 
void BleedingIndicator (int source_ID, int severity, GameplayEffectsDataBleeding parent)
 
void InitIndicator (vector position)
 
void StopIndicator (bool instant=false)
 
void StartRunningDrops ()
 
bool IsRunningDrops ()
 Are any drops currently being animated?
 
void TrySpawnNextDrop ()
 
void ResetSequence ()
 
void ResetIndicator ()
 
void Update (float timeSlice)
 
bool GetEndNow ()
 
int GetSeverity ()
 
void GameplayEffectsData (array< ref Widget > input, int type, int user_override=-1)
 
void Init (array< ref Widget > input, int type, Widget layout_root, int user_override=-1)
 
array< ref WidgetGetWidgetSet ()
 
int GetWidgetSetType ()
 
int GetWidgetSetID ()
 
bool HasDefinedHandle ()
 Returns 'true' if this class contains update info.
 
bool DataInitialized ()
 
void UpdateVisibility (bool state)
 
void RegisterData (Param p)
 
void Update (float timeSlice=0, Param p=null, int handle=-1)
 
void ForceStop ()
 
- Private Attributes inherited from Managed
int m_CharacterId
 
string m_CharacterType
 
MenuData m_CharacterDta
 
PlayerBase m_CharacterObj
 
vector m_CharacterPos
 
vector m_CharacterRot
 
ref TStringArray m_CharGenderList = new TStringArray
 
ref TStringArray m_CharShirtList = new TStringArray
 
ref TStringArray m_CharPantsList = new TStringArray
 
ref TStringArray m_CharShoesList = new TStringArray
 
ref map< ECharGender, ref array< string > > m_Characters = new map<ECharGender, ref array<string>>
 
ECharGender m_CharGender
 
bool m_InitialSyncSent
 
bool m_Initialized
 
bool m_Terminating = false
 
bool m_EndNow = false
 
bool m_IsRunning = false
 
int m_DropSpawnsQueued
 
int m_ActiveDropsCount
 
int m_Severity
 
int m_SourceID
 
GameplayEffectsDataBleeding m_ParentMetaData
 
array< floatm_DropProbabilityArray
 
float m_AverageFrequency
 
float m_SequenceTick
 
float m_SequenceDuration
 
float m_TimeElapsedTotal
 
float m_TimeElapsedSequence
 
float m_LastDropSpawnTime
 
float m_DropSpawnMinDelay
 
float m_DropSpawnMaxDelay
 
int m_CurrentDropProbabilityStep
 
int m_DropProbabilityRollsCount
 
vector m_BasePosition
 
ref set< ref BleedingIndicatorDropDatam_ActiveDrops
 
ref set< intm_CleanupQueue
 
ref array< ref Widgetm_WidgetArray
 
int m_Type
 
int m_WidgetSetIdentifier
 
Widget m_LayoutRoot
 

Detailed Description

Definition at line 1 of file DayZIntroScene.c.

Constructor & Destructor Documentation

◆ DayZIntroScene()

void DayZIntroScene::DayZIntroScene ( )
inlineprotected

Definition at line 13 of file DayZIntroScene.c.

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;
23 m_Target = SwapYZ(g_Game.ConfigGetVector(scene_path + " target"));
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 fog = g_Game.ConfigGetFloat(scene_path + " fog");
32 float windspeed = -1;
33 if (g_Game.ConfigIsExisting(scene_path + " windspeed")) windspeed = g_Game.ConfigGetFloat(scene_path + " windspeed");
34 g_Game.ConfigGetFloatArray(scene_path + " storm", storm);
35
36 World world = g_Game.GetWorld();
37
38 if (world && date.Count() >= 5)
39 world.SetDate(date.Get(0), date.Get(1), date.Get(2), date.Get(3), date.Get(4));
40
41 GetGame().ObjectDelete(m_Camera);
42 Class.CastTo(m_Camera, g_Game.CreateObject("staticcamera", SnapToGround(position), true)); //Vector(position[0] , position[1] + 1, position[2])
43
45
46 if (m_Camera)
47 {
48 //m_Camera.SetPosition(Vector(m_Camera.GetPosition()[0],m_Camera.GetPosition()[1]+0,m_Camera.GetPosition()[2]));
49 m_Camera.LookAt(m_Target);
50 m_Camera.SetFOV(fov);
51 m_Camera.SetFocus(5.0, 0.0); //5.0, 1.0
52
53 m_Camera.SetActive(true);
54
56 m_CameraTrans[3] = m_Camera.GetPosition();
57 m_CharacterPos = Vector(0.685547, -0.988281, 3.68823).Multiply4(m_CameraTrans);
58
59 float pos_x = m_CharacterPos[0];
60 float pos_z = m_CharacterPos[2];
61 float pos_y = GetGame().SurfaceY(pos_x, pos_z);
64
65 vector to_cam_dir = m_Camera.GetPosition() - m_CharacterPos;
67 }
68
69 m_Weather = g_Game.GetWeather();
71 m_Weather.GetRain().SetLimits(rain, rain);
72 m_Weather.GetFog().SetLimits(fog, fog);
73
74 m_Weather.GetOvercast().Set(overcast, 0, 0);
75 m_Weather.GetRain().Set(rain, 0, 0);
76 m_Weather.GetFog().Set(fog, 0, 0);
77
78 if (storm.Count() == 3)
79 m_Weather.SetStorm(storm.Get(0), storm.Get(1), storm.Get(2));
80
81 if (windspeed != -1)
82 {
86 }
87
89 m_Character.LoadCharacterData(m_CharacterPos, m_CharacterRot);
90
91 PPEffects.Init(); //Deprecated, left in for legacy purposes only
92
94 }
DayZGame g_Game
Definition DayZGame.c:3528
Super root of all classes in Enforce script.
Definition EnScript.c:11
vector m_CharacterPos
vector SwapYZ(vector vec)
void SetInitPostprocesses()
Since this can get created at the same time as DayZGame, non-static postprocesses need to be deffered...
vector m_CameraTrans[4]
ref IntroSceneCharacter m_Character
vector m_CharacterRot
vector SnapToGround(vector pos)
void IntroSceneCharacter()
Definition EnMath.c:7
Deprecated; 'PPEManager' used instead.
Definition PPEffects.c:3
static void Init()
Definition PPEffects.c:52
proto native Fog GetFog()
Returns a fog phenomenon object.
proto native void SetStorm(float density, float threshold, float timeOut)
Sets the thunderstorm properties.
proto native void SetWindSpeed(float speed)
Sets the actual wind speed in metre per second.
proto native void SetWindFunctionParams(float fnMin, float fnMax, float fnSpeed)
Sets function parameters that controls the wind behaviour (change in time).
proto native Rain GetRain()
Returns a rain phenomenon object.
proto native Overcast GetOvercast()
Returns an overcast phenomenon object.
proto native void SetWindMaximumSpeed(float maxSpeed)
Sets the maximal wind speed in metre per second.
Definition World.c:2
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
array< float > TFloatArray
Definition EnScript.c:667
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 void MatrixIdentity4(out vector mat[4])
Creates identity matrix.
Definition EnMath3D.c:233
static proto void DirectionAndUpMatrix(vector dir, vector up, out vector mat[4])
Creates rotation matrix from direction and up vector.
static proto float Atan2(float y, float x)
Returns angle in radians from tangent.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static const float RAD2DEG
Definition EnMath.c:16
const int CALL_CATEGORY_GUI
Definition tools.c:9

References Math::Atan2(), CALL_CATEGORY_GUI, Class::CastTo(), Math3D::DirectionAndUpMatrix(), g_Game, Weather::GetFog(), GetGame(), Weather::GetOvercast(), Weather::GetRain(), PPEffects::Init(), Managed::IntroSceneCharacter(), m_Camera, m_CameraTrans, m_Character, m_CharacterPos, m_CharacterRot, m_Target, m_Weather, Math3D::MatrixIdentity4(), Math::RAD2DEG, Math::RandomInt(), SetInitPostprocesses(), Weather::SetStorm(), Weather::SetWindFunctionParams(), Weather::SetWindMaximumSpeed(), Weather::SetWindSpeed(), SnapToGround(), SwapYZ(), and Vector().

◆ ~DayZIntroScene()

void DayZIntroScene::~DayZIntroScene ( )
inlineprotected

Definition at line 96 of file DayZIntroScene.c.

97 {
100 }
PPERequesterCategory
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

References PPEManagerStatic::GetPPEManager().

Member Function Documentation

◆ GetIntroCamera()

Camera DayZIntroScene::GetIntroCamera ( )
inlineprotected

Definition at line 113 of file DayZIntroScene.c.

114 {
115 return m_Camera;
116 }

References m_Camera.

Referenced by UIScriptedMenu::OnShow(), and ResetIntroCamera().

◆ GetIntroCharacter()

◆ GetSelectedUserName()

void DayZIntroScene::GetSelectedUserName ( )
inlineprotected

Definition at line 136 of file DayZIntroScene.c.

137 {
138 string name;
139 BiosUserManager user_manager = GetGame().GetUserManager();
140 if (user_manager)
141 {
142 BiosUser user = user_manager.GetSelectedUser();
143 if (user)
144 {
145 g_Game.SetPlayerGameName(user.GetName());
146 return;
147 }
148 }
150 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
const string DEFAULT_CHARACTER_NAME
Definition constants.c:838

References GameConstants::DEFAULT_CHARACTER_NAME, g_Game, GetGame(), and name.

◆ ResetIntroCamera()

void DayZIntroScene::ResetIntroCamera ( )
inlineprotected

Definition at line 121 of file DayZIntroScene.c.

122 {
124 {
125 GetIntroCamera().LookAt(GetIntroCharacter().GetPosition() + Vector(0, 1, 0));
126 //GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater( SceneCharacterSetPos, 250 );
127 }
128 }
IntroSceneCharacter GetIntroCharacter()
Camera GetIntroCamera()
PlayerBase GetCharacterObj()
vector GetPosition()

References Managed::GetCharacterObj(), GetIntroCamera(), GetIntroCharacter(), Managed::GetPosition(), and Vector().

Referenced by UIScriptedMenu::Init().

◆ SetInitPostprocesses()

void DayZIntroScene::SetInitPostprocesses ( )
inlineprotected

Since this can get created at the same time as DayZGame, non-static postprocesses need to be deffered.

Definition at line 131 of file DayZIntroScene.c.

132 {
134 }

Referenced by DayZIntroScene().

◆ SnapToGround()

vector DayZIntroScene::SnapToGround ( vector pos)
inlineprotected

Definition at line 164 of file DayZIntroScene.c.

165 {
166 float pos_x = pos[0];
167 float pos_z = pos[2];
168 float pos_y = GetGame().SurfaceY(pos_x, pos_z);
170 tmp_pos[1] = tmp_pos[1] + pos[1];
171
172 return tmp_pos;
173 }

References GetGame(), and Vector().

Referenced by DayZIntroScene().

◆ SwapYZ()

vector DayZIntroScene::SwapYZ ( vector vec)
inlineprotected

Definition at line 153 of file DayZIntroScene.c.

154 {
155 vector tmp;
156 tmp[0] = vec[0];
157 tmp[1] = vec[2];
158 tmp[2] = vec[1];
159
160 return tmp;
161 }

Referenced by DayZIntroScene().

Member Data Documentation

◆ m_Camera

Camera DayZIntroScene::m_Camera
protected

◆ m_CameraTrans

vector DayZIntroScene::m_CameraTrans[4]
protected

Definition at line 5 of file DayZIntroScene.c.

Referenced by DayZIntroScene().

◆ m_Character

◆ m_CharacterPos

vector DayZIntroScene::m_CharacterPos
protected

Definition at line 6 of file DayZIntroScene.c.

Referenced by DayZIntroScene(), and DayZIntroScenePC::DayZIntroScenePC().

◆ m_CharacterRot

vector DayZIntroScene::m_CharacterRot
protected

◆ m_OptionsMenu

ref OptionsMenu DayZIntroScene::m_OptionsMenu
protected

Definition at line 11 of file DayZIntroScene.c.

◆ m_Target

vector DayZIntroScene::m_Target
protected

Definition at line 9 of file DayZIntroScene.c.

Referenced by DayZIntroScene().

◆ m_Weather

Weather DayZIntroScene::m_Weather
protected

Definition at line 8 of file DayZIntroScene.c.

Referenced by DayZIntroScene().


The documentation for this class was generated from the following file: