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_ScenarioFrameworkActionCompareCounterAndExecute.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_ContainerActionTitle
()]
2
class
SCR_ScenarioFrameworkActionCompareCounterAndExecute
:
SCR_ScenarioFrameworkActionBase
3
{
4
5
[
Attribute
(
"0"
,
UIWidgets
.ComboBox,
"Operator"
,
""
, ParamEnumArray.FromEnum(
SCR_EScenarioFrameworkComparisonOperator
))]
6
SCR_EScenarioFrameworkComparisonOperator
m_eComparisonOperator;
7
8
[
Attribute
(
desc
:
"Value"
)]
9
int
m_iValue;
10
11
[
Attribute
(
desc
:
"Counter to compare (Optional if this action is attached on Counter)"
)]
12
string
m_sCounterName;
13
14
[
Attribute
(
desc
:
"What to do once counter is reached"
,
category
:
"OnActivate"
)]
15
ref array<ref SCR_ScenarioFrameworkActionBase> m_aActions;
16
17
//------------------------------------------------------------------------------------------------
18
override
void
OnActivate
(
IEntity
object
)
19
{
20
if
(!CanActivate())
21
return
;
22
23
SCR_ScenarioFrameworkLogicCounter logicCounter;
24
if
(
SCR_StringHelper
.
IsEmptyOrWhiteSpace
(m_sCounterName))
25
{
26
if
(!
object
)
27
{
28
PrintFormat
(
"ScenarioFramework Action: Logic Counter not found for Action %1"
,
this
,
LogLevel
.ERROR);
29
return
;
30
}
31
32
logicCounter = SCR_ScenarioFrameworkLogicCounter.Cast(
object
);
33
if
(!logicCounter)
34
{
35
PrintFormat
(
"ScenarioFramework Action: Logic Counter %1 not found for Action %2"
,
object
.
GetName
(),
this
,
LogLevel
.ERROR);
36
return
;
37
}
38
}
39
else
40
{
41
IEntity
entity =
GetGame
().
GetWorld
().FindEntityByName(m_sCounterName);
42
if
(!entity)
43
{
44
PrintFormat
(
"ScenarioFramework Action: Could not find %1 for Action %2"
, m_sCounterName,
this
,
LogLevel
.ERROR);
45
return
;
46
}
47
48
logicCounter = SCR_ScenarioFrameworkLogicCounter.Cast(entity);
49
if
(!logicCounter)
50
{
51
PrintFormat
(
"ScenarioFramework Action: Logic Counter %1 not found for Action %2"
, m_sCounterName,
this
,
LogLevel
.ERROR);
52
return
;
53
}
54
}
55
56
int
counterValue = logicCounter.m_iCnt;
57
58
if
(
59
((m_eComparisonOperator ==
SCR_EScenarioFrameworkComparisonOperator
.LESS_THAN) && (counterValue < m_iValue)) ||
60
((m_eComparisonOperator ==
SCR_EScenarioFrameworkComparisonOperator
.LESS_OR_EQUAL) && (counterValue <= m_iValue)) ||
61
((m_eComparisonOperator ==
SCR_EScenarioFrameworkComparisonOperator
.EQUAL) && (counterValue == m_iValue)) ||
62
((m_eComparisonOperator ==
SCR_EScenarioFrameworkComparisonOperator
.GREATER_OR_EQUAL) && (counterValue >= m_iValue)) ||
63
((m_eComparisonOperator ==
SCR_EScenarioFrameworkComparisonOperator
.GREATER_THEN) && (counterValue > m_iValue))
64
)
65
{
66
foreach
(
SCR_ScenarioFrameworkActionBase
actions : m_aActions)
67
{
68
actions.OnActivate(
object
);
69
}
70
}
71
}
72
73
//------------------------------------------------------------------------------------------------
74
override
array<ref SCR_ScenarioFrameworkActionBase> GetSubActions()
75
{
76
return
m_aActions;
77
}
78
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
OnActivate
override void OnActivate()
Definition
SCR_CharacterCommandLoiter.c:31
SCR_EScenarioFrameworkComparisonOperator
SCR_EScenarioFrameworkComparisonOperator
Definition
SCR_EScenarioFrameworkComparisonOperator.c:2
GetName
string GetName()
Definition
SCR_NotificationSenderComponent.c:15
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
IEntity
Definition
IEntity.c:13
IEntity::GetWorld
proto external BaseWorld GetWorld()
SCR_ContainerActionTitle
Definition
SCR_ContainerActionTitle.c:2
SCR_ScenarioFrameworkActionBase
Definition
SCR_ScenarioFrameworkActionBase.c:3
SCR_ScenarioFrameworkActionCompareCounterAndExecute
Definition
SCR_ScenarioFrameworkActionCompareCounterAndExecute.c:3
SCR_StringHelper
Definition
SCR_StringHelper.c:2
SCR_StringHelper::IsEmptyOrWhiteSpace
static bool IsEmptyOrWhiteSpace(string input)
Definition
SCR_StringHelper.c:594
UIWidgets
Definition
attributes.c:40
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
PrintFormat
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
ScenarioFramework
Actions
SCR_ScenarioFrameworkActionCompareCounterAndExecute.c
Generated by
1.17.0