DayZ
1.24
Loading...
Searching...
No Matches
EngineSmoke.c
Go to the documentation of this file.
1
class
EffEngineSmoke
:
EffVehicleSmoke
2
{
3
private
float
m_Time
;
4
static
private
float
m_UpdateInterval
= 2;
5
6
void
EffEngineSmoke
()
7
{
8
SetEnableEventFrame
(
true
);
9
}
10
11
override
void
SetParticleStateLight
()
12
{
13
SetParticleState
(
ParticleList
.
HATCHBACK_ENGINE_OVERHEATING
);
14
}
15
16
override
void
SetParticleStateHeavy
()
17
{
18
SetParticleState
(
ParticleList
.
HATCHBACK_ENGINE_OVERHEATED
);
19
}
20
21
override
void
Event_OnFrameUpdate
(
float
time_delta
)
22
{
23
m_Time
+=
time_delta
;
24
25
if
(
m_Time
>=
m_UpdateInterval
)
26
{
27
m_Time
= 0;
28
29
Car
parent =
Car
.Cast(
GetAttachmentParent
());
30
31
if
(parent)
32
{
33
Particle
p
=
GetParticle
();
34
if
(
p
)
35
{
36
SetParticleState
(
p
.GetParticleID());
37
38
float
speed = parent.GetSpeedometerAbsolute();
39
float
lifetime_scale
;
40
41
if
(speed < 100)
42
lifetime_scale
= (100 - speed) / 100;
43
else
44
lifetime_scale
= 0.1;
45
46
float
birthrate_scale
= 1 + (speed * 0.02);
47
48
p
.ScaleParticleParamFromOriginal(
EmitorParam
.LIFETIME,
lifetime_scale
);
49
p
.ScaleParticleParamFromOriginal(
EmitorParam
.LIFETIME_RND,
lifetime_scale
);
50
p
.ScaleParticleParamFromOriginal(
EmitorParam
.BIRTH_RATE,
birthrate_scale
);
51
p
.ScaleParticleParamFromOriginal(
EmitorParam
.BIRTH_RATE_RND,
birthrate_scale
);
52
}
53
}
54
}
55
}
56
}
GetAttachmentParent
Object GetAttachmentParent()
Get the parent set by SetAttachmentParent.
Definition
Effect.c:554
EffEngineSmoke
Definition
EngineSmoke.c:2
EffEngineSmoke::EffEngineSmoke
void EffEngineSmoke()
Definition
EngineSmoke.c:6
EffEngineSmoke::m_Time
float m_Time
Definition
EngineSmoke.c:3
EffEngineSmoke::m_UpdateInterval
float m_UpdateInterval
Definition
EngineSmoke.c:4
EffEngineSmoke::SetParticleStateHeavy
override void SetParticleStateHeavy()
Definition
EngineSmoke.c:16
EffEngineSmoke::Event_OnFrameUpdate
override void Event_OnFrameUpdate(float time_delta)
Definition
EngineSmoke.c:21
EffEngineSmoke::SetParticleStateLight
override void SetParticleStateLight()
Definition
EngineSmoke.c:11
EffVehicleSmoke
Definition
VehicleSmoke.c:2
EffVehicleSmoke::SetParticleState
void SetParticleState(int state)
Definition
VehicleSmoke.c:20
EffectParticle::GetParticle
Particle GetParticle()
Gets the main particle which this Effect is managing.
Definition
EffectParticle.c:155
Param3
Definition
EntityAI.c:95
Particle
Legacy way of using particles in the game.
Definition
Particle.c:7
ParticleList
Definition
ParticleList.c:12
ParticleList::HATCHBACK_ENGINE_OVERHEATING
static const int HATCHBACK_ENGINE_OVERHEATING
Definition
ParticleList.c:263
ParticleList::HATCHBACK_ENGINE_OVERHEATED
static const int HATCHBACK_ENGINE_OVERHEATED
Definition
ParticleList.c:264
SetEnableEventFrame
void SetEnableEventFrame(bool enable)
Enable Event_OnFrameUpdate for the effect.
Definition
Effect.c:270
EmitorParam
EmitorParam
Definition
EnVisual.c:114
scripts
3_Game
Effects
EffectParticle
VehicleSmoke
EngineSmoke.c
Generated by
1.10.0