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

Protected Member Functions

void FlareSimulation ()
 
void OnActivation (Entity flare)
 
void OnTermination (Entity flare)
 
void OnFire (Entity flare)
 
void Simulate (Entity flare)
 
void CastFlareAINoise (vector position)
 
void TurnOffDistantLight ()
 
void ~FlareSimulation ()
 

Protected Attributes

Particle m_ParMainFire
 
EffectSound m_BurningSound
 
FlareLight m_FlareLight
 
float m_LastNoiseTime = -1
 
float m_NoiseTimer = 0
 
const float NOISE_DELAY = 5
 

Static Protected Attributes

static const float MAX_FARLIGHT_DIST = 40
 
static const float MIN_FARLIGHT_DIST = 5
 
static ref NoiseParams m_NoisePar
 
 m_ScriptedLight
 
int m_ParticleId
 

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 FlareSimulation.c.

Constructor & Destructor Documentation

◆ FlareSimulation()

void FlareSimulation::FlareSimulation ( )
inlineprotected

◆ ~FlareSimulation()

void FlareSimulation::~FlareSimulation ( )
inlineprotected

Definition at line 105 of file FlareSimulation.c.

106 {
107 if (m_ParMainFire)
109
110 if (m_BurningSound)
112
113 if (m_FlareLight)
114 m_FlareLight.FadeOut();
115 }
void SoundStop()
Stops sound.
EffectSound m_BurningSound
Particle m_ParMainFire
FlareLight m_FlareLight
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
Definition Particle.c:262

References m_BurningSound, m_FlareLight, m_ParMainFire, EffectSound::SoundStop(), and Particle::Stop().

Member Function Documentation

◆ CastFlareAINoise()

void FlareSimulation::CastFlareAINoise ( vector position)
inlineprotected

Definition at line 76 of file FlareSimulation.c.

77 {
78 if (m_LastNoiseTime < 0)
79 m_LastNoiseTime = GetGame().GetTime() * 0.0033;
80
81 float delta_time = GetGame().GetTime() * 0.0033 - m_LastNoiseTime;
82 m_LastNoiseTime = GetGame().GetTime() * 0.0033;
83
85
87 {
88 MiscGameplayFunctions.GenerateAINoiseAtPosition(position, NOISE_DELAY, m_NoisePar);
89
90 m_NoiseTimer = 0;
91 }
92 }
static ref NoiseParams m_NoisePar
const float NOISE_DELAY
proto native CGame GetGame()

References GetGame(), m_LastNoiseTime, m_NoisePar, m_NoiseTimer, and NOISE_DELAY.

◆ OnActivation()

void FlareSimulation::OnActivation ( Entity flare)
inlineprotected

Definition at line 23 of file FlareSimulation.c.

24 {
25 if (!GetGame().IsServer() || !GetGame().IsMultiplayer())
26 {
27 m_FlareLight = FlareLight.Cast(ScriptedLightBase.CreateLight(m_ScriptedLight, Vector(0, 0, 0)));
28 if (m_FlareLight)
29 m_FlareLight.AttachOnObject(flare);
30
31 if (m_ParMainFire)
33
34 m_ParMainFire = ParticleManager.GetInstance().PlayOnObject(m_ParticleId, flare);
36
37 flare.PlaySoundSetLoop(m_BurningSound, "roadflareLoop_SoundSet", 0, 0);
38 }
39
40 if (GetGame().IsServer())
41 {
42 // Create and load noise parameters
43 m_NoisePar = new NoiseParams();
44 m_NoisePar.LoadFromPath("cfgWeapons Flaregun_Base NoiseFlare");
45 }
46 }
class NoiseSystem NoiseParams()
Definition Noise.c:15
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
void SetWiggle(float random_angle, float random_interval)
Makes the particle change direction by random_angle every random_interval seconds.
Definition Particle.c:742
proto native vector Vector(float x, float y, float z)
Vector constructor from components.

References GetGame(), m_BurningSound, m_FlareLight, m_NoisePar, m_ParMainFire, m_ParticleId, m_ScriptedLight, NoiseParams(), ParticleManager(), Particle::SetWiggle(), Particle::Stop(), and Vector().

◆ OnFire()

void FlareSimulation::OnFire ( Entity flare)
inlineprotected

Definition at line 53 of file FlareSimulation.c.

54 {
55 //m_ParMainFire = ParticleManager.GetInstance().PlayOnObject( ParticleList.FLAREPROJ_FIRE, flare);
56 //m_ParMainFire.SetWiggle( 7, 0.3);
57 }

◆ OnTermination()

void FlareSimulation::OnTermination ( Entity flare)
inlineprotected

Definition at line 48 of file FlareSimulation.c.

49 {
50 //MiscGameplayFunctions.GenerateAINoiseAtPosition(flare.GetPosition(), NOISE_DELAY, m_NoisePar);
51 }

◆ Simulate()

void FlareSimulation::Simulate ( Entity flare)
inlineprotected

Definition at line 59 of file FlareSimulation.c.

60 {
61 DayZPlayer player = GetGame().GetPlayer();
62 if (player)
63 vector playerPos = player.GetPosition();
64
65 float dist = vector.DistanceSq(flare.GetPosition(), playerPos);
66
69
72
73 //CastFlareAINoise( flare.GetPosition() );
74 }
static const float MAX_FARLIGHT_DIST
static const float MIN_FARLIGHT_DIST
void SetParameter(int emitter, int parameter, float value)
Set the value of a parameter of an emitor in the particle.
Definition Particle.c:603
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
EmitorParam
Definition EnVisual.c:114

References vector::DistanceSq(), GetGame(), m_ParMainFire, MAX_FARLIGHT_DIST, MIN_FARLIGHT_DIST, Particle::SetParameter(), and TurnOffDistantLight().

◆ TurnOffDistantLight()

void FlareSimulation::TurnOffDistantLight ( )
inlineprotected

Definition at line 94 of file FlareSimulation.c.

95 {
96 if (m_ParMainFire)
97 {
99 m_ParMainFire.SetParameter(0, EmitorParam.LIFETIME_RND, 0);
102 }
103 }

References m_ParMainFire, and Particle::SetParameter().

Referenced by Simulate().

Member Data Documentation

◆ m_BurningSound

EffectSound FlareSimulation::m_BurningSound
protected

Definition at line 4 of file FlareSimulation.c.

Referenced by OnActivation(), and ~FlareSimulation().

◆ m_FlareLight

FlareLight FlareSimulation::m_FlareLight
protected

Definition at line 5 of file FlareSimulation.c.

Referenced by OnActivation(), and ~FlareSimulation().

◆ m_LastNoiseTime

float FlareSimulation::m_LastNoiseTime = -1
protected

Definition at line 10 of file FlareSimulation.c.

Referenced by CastFlareAINoise().

◆ m_NoisePar

ref NoiseParams FlareSimulation::m_NoisePar
staticprotected

Definition at line 9 of file FlareSimulation.c.

Referenced by CastFlareAINoise(), and OnActivation().

◆ m_NoiseTimer

float FlareSimulation::m_NoiseTimer = 0
protected

Definition at line 11 of file FlareSimulation.c.

Referenced by CastFlareAINoise().

◆ m_ParMainFire

Particle FlareSimulation::m_ParMainFire
protected

Definition at line 3 of file FlareSimulation.c.

Referenced by OnActivation(), Simulate(), TurnOffDistantLight(), and ~FlareSimulation().

◆ m_ParticleId

int FlareSimulation::m_ParticleId
staticprotected

Definition at line 15 of file FlareSimulation.c.

Referenced by FlareSimulation(), and OnActivation().

◆ m_ScriptedLight

FlareSimulation::m_ScriptedLight
staticprotected

Definition at line 14 of file FlareSimulation.c.

Referenced by FlareSimulation(), and OnActivation().

◆ MAX_FARLIGHT_DIST

const float FlareSimulation::MAX_FARLIGHT_DIST = 40
staticprotected

Definition at line 6 of file FlareSimulation.c.

Referenced by Simulate().

◆ MIN_FARLIGHT_DIST

const float FlareSimulation::MIN_FARLIGHT_DIST = 5
staticprotected

Definition at line 7 of file FlareSimulation.c.

Referenced by Simulate().

◆ NOISE_DELAY

const float FlareSimulation::NOISE_DELAY = 5
protected

Definition at line 12 of file FlareSimulation.c.

Referenced by CastFlareAINoise().


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