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_BaseTriggerComponent.c
Go to the documentation of this file.
1
[
EntityEditorProps
(
category
:
"GameScripted/ScriptWizard"
, description:
""
)]
2
class
SCR_BaseTriggerComponentClass
:
BaseTriggerComponentClass
3
{
4
}
5
6
class
SCR_BaseTriggerComponent
:
BaseTriggerComponent
7
{
8
[
Attribute
(
"0"
,
desc
:
"Is this mine live by default?"
)]
9
protected
bool
m_bLive;
10
11
[
RplProp
(onRplName:
"OnActivatedChanged"
)]
12
protected
bool
m_bActivated =
false
;
13
14
[
Attribute
(
""
,
desc
:
"Name of the fuze mesh that should unhide when mine is activated"
)]
15
protected
string
m_sFuzeMeshName;
16
17
//protected Instigator m_User;
18
19
//------------------------------------------------------------------------------------------------
22
bool
IsActivated()
23
{
24
return
m_bActivated;
25
}
26
//------------------------------------------------------------------------------------------------
29
bool
IsActivatedByDefault
()
30
{
31
return
m_bLive;
32
}
33
34
//------------------------------------------------------------------------------------------------
36
void
SetUser
(notnull
IEntity
user)
37
{
38
GetInstigator
().SetInstigator(user);
39
//m_User = user;
40
}
41
42
//------------------------------------------------------------------------------------------------
44
// Only call this on the server
45
void
ActivateTrigger
()
46
{
47
GenericEntity
owner =
GenericEntity
.Cast(
GetOwner
());
48
RplComponent rplComponent = RplComponent.Cast(owner.
FindComponent
(RplComponent));
49
if
(!rplComponent || rplComponent.IsProxy())
50
return
;
51
52
auto
garbageSystem =
SCR_GarbageSystem
.
GetByEntityWorld
(owner);
53
if
(garbageSystem)
54
garbageSystem.Withdraw(owner);
55
56
SetLive();
57
m_bActivated =
true
;
58
ShowFuse
();
59
Replication
.BumpMe();
60
}
61
62
void
DisarmTrigger
()
63
{
64
m_bActivated =
false
;
65
Replication
.BumpMe();
66
}
67
68
//------------------------------------------------------------------------------------------------
70
void
ShowFuse
()
71
{
72
IEntity
owner =
GetOwner
();
73
int
meshIndex =
GameAnimationUtils
.FindMeshIndex(owner, m_sFuzeMeshName);
74
if
(meshIndex == -1)
75
return
;
76
77
GameAnimationUtils
.ShowMesh(owner, meshIndex,
true
);
78
}
79
80
//------------------------------------------------------------------------------------------------
82
void
OnActivatedChanged
()
83
{
84
if
(m_bActivated)
85
ShowFuse
();
86
}
87
88
//------------------------------------------------------------------------------------------------
90
[
RplRpc
(
RplChannel
.Reliable,
RplRcver
.Broadcast)]
91
void
RPC_DoTrigger
()
92
{
93
// Can be called from CallLater. Therefore, we need to check if the entity still exists.
94
IEntity
owner =
GetOwner
();
95
if
(!owner)
96
return
;
97
98
BaseTriggerComponent
baseTriggerComponent =
BaseTriggerComponent
.Cast(owner.
FindComponent
(
BaseTriggerComponent
));
99
if
(!baseTriggerComponent)
100
return
;
101
102
baseTriggerComponent.OnUserTriggerOverrideInstigator(owner,
GetInstigator
());
103
}
104
105
//------------------------------------------------------------------------------------------------
106
override
event
protected
void
EOnInit
(
IEntity
owner)
107
{
108
if
(m_bLive)
109
ActivateTrigger
();
// Using call later to avoid accessing uninitialized components
110
}
111
112
//------------------------------------------------------------------------------------------------
113
// constructor
117
void
SCR_BaseTriggerComponent
(
IEntityComponentSource
src,
IEntity
ent,
IEntity
parent)
118
{
119
SetEventMask(ent,
EntityEvent
.INIT);
120
}
121
}
ActivateTrigger
void ActivateTrigger()
Definition
SCR_BaseTriggerComponent.c:45
RPC_DoTrigger
void RPC_DoTrigger()
Definition
SCR_BaseTriggerComponent.c:91
DisarmTrigger
void DisarmTrigger()
Definition
SCR_BaseTriggerComponent.c:62
OnActivatedChanged
void OnActivatedChanged()
Method called on the clients, the item should be outside inventory already.
Definition
SCR_BaseTriggerComponent.c:82
SetUser
void SetUser(notnull IEntity user)
Definition
SCR_BaseTriggerComponent.c:36
ShowFuse
void ShowFuse()
Definition
SCR_BaseTriggerComponent.c:70
SCR_BaseTriggerComponent
void SCR_BaseTriggerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_BaseTriggerComponent.c:117
IsActivatedByDefault
bool IsActivatedByDefault()
Definition
SCR_BaseTriggerComponent.c:29
RplProp
SCR_CacheNoteComponentClass ScriptComponentClass RplProp()] protected ref array< string > m_aLines
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
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
BaseTriggerComponentClass
Definition
BaseTriggerComponentClass.c:13
BaseTriggerComponent
Definition
BaseTriggerComponent.c:13
BaseTriggerComponent::EOnInit
void EOnInit(IEntity owner)
GameAnimationUtils
Definition
GameAnimationUtils.c:8
GenericEntity
Definition
GenericEntity.c:16
IEntityComponentSource
Definition
IEntityComponentSource.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
Replication
Main replication API.
Definition
Replication.c:14
SCR_BaseTriggerComponentClass
Definition
SCR_BaseTriggerComponent.c:3
SCR_GarbageSystem
Script entry for garbage system modding.
Definition
SCR_GarbageSystem.c:3
SCR_GarbageSystem::GetByEntityWorld
static SCR_GarbageSystem GetByEntityWorld(IEntity entity)
Definition
SCR_GarbageSystem.c:70
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition
SCR_FuelNode.c:128
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
EntityEvent
EntityEvent
Various entity events.
Definition
EntityEvent.c:14
GetInstigator
BaseProjectileComponentClass GameComponentClass GetInstigator()
RplRpc
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
Definition
EnNetwork.c:95
RplRcver
RplRcver
Definition
RplRcver.c:59
RplChannel
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.
Definition
RplChannel.c:14
scripts
Game
Weapon
Explosives
SCR_BaseTriggerComponent.c
Generated by
1.17.0