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_ArmoryComponent.c
Go to the documentation of this file.
1
[
EntityEditorProps
(
category
:
"GameScripted/ScriptWizard"
, description:
"Component handling Armory and ammo storage compositions."
, color:
"0 0 255 255"
)]
2
class
SCR_ArmoryComponentClass
:
ScriptComponentClass
3
{
4
}
5
6
class
SCR_ArmoryComponent :
ScriptComponent
7
{
8
protected
ref array <SCR_FactionAffiliationComponent>
m_aFactionAffiliationComponents
= {};
9
protected
RplComponent
m_RplComponent
;
10
11
//------------------------------------------------------------------------------------------------
13
bool
IsProxy
()
14
{
15
return
(
m_RplComponent
&&
m_RplComponent
.IsProxy());
16
}
17
18
//------------------------------------------------------------------------------------------------
21
void
ChangeOwningFaction
(notnull
Faction
faction)
22
{
23
if
(
IsProxy
())
24
return
;
25
26
FactionKey
key = faction.GetFactionKey();
27
28
foreach
(
SCR_FactionAffiliationComponent
factionComp :
m_aFactionAffiliationComponents
)
29
{
30
factionComp.SetAffiliatedFactionByKey(key);
31
}
32
}
33
34
//------------------------------------------------------------------------------------------------
35
protected
void
OnLinkedEntitiesSpawned
(SCR_EditorLinkComponent link)
36
{
37
FindFactionComponentsInHiearchy
(
GetOwner
());
38
link.GetOnLinkedEntitiesSpawned().Remove(
OnLinkedEntitiesSpawned
);
39
}
40
41
//------------------------------------------------------------------------------------------------
44
protected
void
FindFactionComponentsInHiearchy
(
IEntity
entity)
45
{
46
IEntity
child = entity.
GetChildren
();
47
SCR_FactionAffiliationComponent
factionComp;
48
49
while
(child)
50
{
51
if
(child.
GetChildren
())
52
FindFactionComponentsInHiearchy
(child);
53
54
factionComp =
SCR_FactionAffiliationComponent
.Cast(child.
FindComponent
(
SCR_FactionAffiliationComponent
));
55
if
(factionComp)
56
m_aFactionAffiliationComponents
.Insert(factionComp);
57
58
child = child.
GetSibling
();
59
}
60
}
61
62
//------------------------------------------------------------------------------------------------
63
override
void
EOnInit
(
IEntity
owner)
64
{
65
if
(!
GetGame
().InPlayMode())
66
return
;
67
68
m_RplComponent
= RplComponent.Cast(
GetOwner
().
FindComponent
(RplComponent));
69
if
(!
m_RplComponent
)
70
return
;
71
72
if
(
IsProxy
())
73
return
;
74
75
SCR_EditorLinkComponent link = SCR_EditorLinkComponent.Cast(owner.
FindComponent
(SCR_EditorLinkComponent));
76
if
(link)
77
link.GetOnLinkedEntitiesSpawned().Insert(
OnLinkedEntitiesSpawned
);
78
else
79
FindFactionComponentsInHiearchy
(owner);
80
}
81
82
//------------------------------------------------------------------------------------------------
83
// PostInit
84
override
void
OnPostInit
(
IEntity
owner)
85
{
86
super.OnPostInit(owner);
87
SetEventMask
(owner,
EntityEvent
.INIT);
88
}
89
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
ChangeOwningFaction
void ChangeOwningFaction(notnull Faction faction)
Definition
SCR_ArmoryComponent.c:21
OnLinkedEntitiesSpawned
void OnLinkedEntitiesSpawned(SCR_EditorLinkComponent link)
Definition
SCR_ArmoryComponent.c:35
FindFactionComponentsInHiearchy
void FindFactionComponentsInHiearchy(IEntity entity)
Definition
SCR_ArmoryComponent.c:44
m_aFactionAffiliationComponents
SCR_ArmoryComponentClass m_aFactionAffiliationComponents
m_RplComponent
RplComponent m_RplComponent
Definition
SCR_CampaignBuildingManagerComponent.c:64
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
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
Faction
Definition
Faction.c:13
FactionKey
Definition
FactionKey.c:3
GenericComponent::SetEventMask
proto external int SetEventMask(notnull IEntity owner, int mask)
GenericComponent::FindComponent
proto external GenericComponent FindComponent(typename typeName)
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
IEntity::GetChildren
proto external IEntity GetChildren()
IEntity::GetSibling
proto external IEntity GetSibling()
SCR_ArmoryComponentClass
Definition
SCR_ArmoryComponent.c:3
SCR_FactionAffiliationComponent
Definition
SCR_FactionAffiliationComponent.c:11
ScriptComponentClass
Definition
ScriptComponentClass.c:8
ScriptComponent
Definition
ScriptComponent.c:24
ScriptComponent::GetOwner
proto external GenericEntity GetOwner()
Get owner entity.
ScriptComponent::EOnInit
void EOnInit(IEntity owner)
IsProxy
bool IsProxy()
Definition
SCR_CampaignBuildingCompositionComponent.c:509
EntityEvent
EntityEvent
Various entity events.
Definition
EntityEvent.c:14
OnPostInit
@ OnPostInit
Definition
SndComponentCallbacks.c:15
scripts
Game
Components
SCR_ArmoryComponent.c
Generated by
1.17.0