Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_LampComponent.c
Go to the documentation of this file.
1
[
EntityEditorProps
(
category
:
"GameScripted"
, color:
"0 0 255 255"
)]
2
class
SCR_LampComponentClass
:
SCR_BaseInteractiveLightComponentClass
3
{
4
[
Attribute
(
"{40318DDE45FF4CC3}Particles/Enviroment/Lamp_fire_normal.ptc"
,
UIWidgets
.ResourceNamePicker,
"Prefab of fire particle used for a fire action."
,
"ptc"
)]
5
protected
ResourceName
m_sParticle
;
6
7
[
Attribute
(
"0 0.1 0"
,
UIWidgets
.EditBox,
"Particle offset in local space from the origin of the entity"
)]
8
protected
vector
m_vParticleOffset
;
9
10
//------------------------------------------------------------------------------------------------
12
ResourceName
GetParticle
()
13
{
14
return
m_sParticle
;
15
}
16
17
//------------------------------------------------------------------------------------------------
19
vector
GetParticleOffset
()
20
{
21
return
m_vParticleOffset
;
22
}
23
}
24
25
class
SCR_LampComponent : SCR_BaseInteractiveLightComponent
26
{
27
private
ParticleEffectEntity
m_pFireParticle
;
28
protected
SCR_BaseInteractiveLightComponentClass
m_ComponentData
;
29
30
//------------------------------------------------------------------------------------------------
31
override
void
ToggleLight
(
bool
turnOn,
bool
skipTransition =
false
,
bool
playSound =
true
)
32
{
33
if
(
m_bIsOn
== turnOn)
34
return
;
35
36
super.ToggleLight(turnOn, skipTransition, playSound);
37
38
// don't continue if DS server is running in console (particles, decals)
39
if
(
System
.IsConsoleApp())
40
return
;
41
42
if
(turnOn)
43
{
44
TurnOn
();
45
}
46
else
47
{
48
TurnOff
();
49
}
50
}
51
52
//------------------------------------------------------------------------------------------------
54
void
TurnOn
()
55
{
56
SCR_LampComponentClass
componentData =
SCR_LampComponentClass
.Cast(
GetComponentData
(
GetOwner
()));
57
if
(!
m_pFireParticle
&& componentData)
58
{
59
ParticleEffectEntitySpawnParams
spawnParams =
new
ParticleEffectEntitySpawnParams
();
60
spawnParams.TargetWorld =
GetOwner
().
GetWorld
();
61
spawnParams.Parent =
GetOwner
();
62
Math3D
.MatrixIdentity4(spawnParams.Transform);
63
spawnParams.Transform[3] = componentData.
GetParticleOffset
();
64
65
m_pFireParticle
=
ParticleEffectEntity
.SpawnParticleEffect(componentData.
GetParticle
(), spawnParams);
66
}
67
else
if
(
m_pFireParticle
)
68
{
69
m_pFireParticle
.Play();
70
}
71
}
72
73
//------------------------------------------------------------------------------------------------
75
void
TurnOff
()
76
{
77
//Reset fire particles
78
if
(
m_pFireParticle
)
79
{
80
m_pFireParticle
.Stop();
81
}
82
}
83
84
//------------------------------------------------------------------------------------------------
85
override
bool
RplLoad
(
ScriptBitReader
reader)
86
{
87
// Can't relay on RplLoad method of base class as with the lamp we have to execute ToggleLight method in both on / off state.
88
bool
isOn =
false
;
89
reader.ReadBool(isOn);
90
ToggleLight
(isOn,
true
);
91
92
return
true
;
93
}
94
95
//------------------------------------------------------------------------------------------------
96
override
void
OnDelete
(
IEntity
owner)
97
{
98
super.OnDelete(owner);
99
100
RemoveLights();
101
}
102
}
RplLoad
override bool RplLoad(ScriptBitReader reader)
Definition
SCR_AIGroupInfoComponent.c:149
m_bIsOn
bool m_bIsOn
Definition
SCR_BaseInteractiveLightComponent.c:60
GetComponentData
SCR_CharacterSoundComponentClass GetComponentData()
Definition
SCR_CharacterSoundComponent.c:132
EntityEditorProps
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
Definition
SCR_CompassComponent.c:10
TurnOn
void TurnOn()
Definition
SCR_FireplaceComponent.c:61
ToggleLight
override void ToggleLight(bool turnOn, bool skipTransition=false, bool playSound=true)
Definition
SCR_FireplaceComponent.c:38
m_pFireParticle
SCR_FireplaceComponentClass m_pFireParticle
m_ComponentData
SCR_FuelConsumptionComponentClass m_ComponentData
Definition
SCR_FuelConsumptionComponent.c:28
ParticleEffectEntity
void ParticleEffectEntity(IEntitySource src, IEntity parent)
Definition
SCR_RepeatingParticleEffectEntity.c:65
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
IEntity
Definition
IEntity.c:13
IEntity::GetWorld
proto external BaseWorld GetWorld()
Math3D
Definition
Math3D.c:13
ParticleEffectEntitySpawnParams
Definition
ParticleEffectEntitySpawnParams.c:13
ResourceName
Definition
ResourceName.c:13
SCR_BaseInteractiveLightComponentClass
Definition
SCR_BaseInteractiveLightComponent.c:3
SCR_LampComponentClass
Definition
SCR_LampComponent.c:3
SCR_LampComponentClass::GetParticleOffset
vector GetParticleOffset()
Definition
SCR_LampComponent.c:19
SCR_LampComponentClass::m_sParticle
ResourceName m_sParticle
Definition
SCR_LampComponent.c:5
SCR_LampComponentClass::GetParticle
ResourceName GetParticle()
Definition
SCR_LampComponent.c:12
SCR_LampComponentClass::m_vParticleOffset
vector m_vParticleOffset
Definition
SCR_LampComponent.c:8
ScriptBitReader
Definition
EnNetwork.c:199
System
Definition
System.c:13
UIWidgets
Definition
attributes.c:40
vector
Definition
vector.c:13
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition
SCR_FuelNode.c:128
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
OnDelete
@ OnDelete
Definition
SndComponentCallbacks.c:16
TurnOff
void TurnOff()
Remove every particle associed with this effect.
Definition
SCR_FireplaceComponent.c:91
scripts
Game
Components
SCR_LampComponent.c
Generated by
1.17.0