Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_WeaponRackEntity.c
Go to the documentation of this file.
1[EntityEditorProps(category: "GameScripted/Campaign", description: "A rack filled with weapons.", color: "0 0 255 255")]
2class SCR_WeaponRackEntityClass: GenericEntityClass
3{
4};
5
6//------------------------------------------------------------------------------------------------
8{
9 // Simple timer setup
10 [Attribute("10")]
11 float m_fPeriodTime;
12
13 protected SCR_ArsenalDisplayComponent m_ArsenalDisplayComponent;
15
16 //------------------------------------------------------------------------------------------------
18 {
19 return m_fPeriodTime;
20 }
21
22 //------------------------------------------------------------------------------------------------
24 {
25 m_ArsenalDisplayComponent.ClearArsenal();
26 }
27
28 //------------------------------------------------------------------------------------------------
30 void PeriodicalSpawn(notnull SCR_Faction faction)
31 {
32 Faction assignedFaction;
34 {
35 assignedFaction = m_FactionAffiliationComponent.GetAffiliatedFaction();
36 if (!assignedFaction || (assignedFaction && assignedFaction.GetFactionKey() != faction.GetFactionKey()))
37 {
38 m_FactionAffiliationComponent.SetAffiliatedFaction(faction);
39 // Set new faction on component,FactionChanged callback refreshes items in ArsenalDisplayComponent
40 return;
41 }
42 }
43
44 m_ArsenalDisplayComponent.RefreshArsenal(false, faction);
45 }
46
47 //------------------------------------------------------------------------------------------------
48 override void EOnInit(IEntity owner)
49 {
51 return;
52
53 m_ArsenalDisplayComponent = SCR_ArsenalDisplayComponent.Cast(owner.FindComponent(SCR_ArsenalDisplayComponent));
54
56 {
57 Print("Arsenal display component not found on WeaponRackEntity", LogLevel.ERROR);
58 return;
59 }
60 }
61
62 //------------------------------------------------------------------------------------------------
64 {
66 }
67
68 //------------------------------------------------------------------------------------------------
70 {
71 }
72
73}
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
void IEntity(IEntitySource src, IEntity parent)
protected script Constructor
proto external EntityEvent SetEventMask(EntityEvent e)
proto external Managed FindComponent(typename typeName)
static bool IsEditMode()
Definition Functions.c:1566
SCR_ArsenalDisplayComponent m_ArsenalDisplayComponent
void SCR_WeaponRackEntity(IEntitySource src, IEntity parent)
void PeriodicalSpawn(notnull SCR_Faction faction)
Called periodically to spawn weapons in the queue.
SCR_FactionAffiliationComponent m_FactionAffiliationComponent
override void EOnInit(IEntity owner)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.
Definition EntityEvent.c:14