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_ScenarioFrameworkAIActionShootFlare.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_ContainerAIActionTitle
()]
2
class
SCR_ScenarioFrameworkAIActionShootFlare
:
SCR_ScenarioFrameworkAIAction
3
{
4
[
Attribute
(
desc
:
"Target entity should shoot at."
)]
5
ref
SCR_ScenarioFrameworkGet
m_Getter;
6
7
[
Attribute
(
""
,
UIWidgets
.Object,
"Offset from target entity. If target entity doesn't exist, origin is shooter position and target vector is offset from his position. - use PointInfo"
)]
8
ref
PointInfo
m_TargeOffset;
9
10
//------------------------------------------------------------------------------------------------
11
override
void
OnActivate
()
12
{
13
IEntity
entity;
14
if
(m_Getter)
15
{
16
SCR_ScenarioFrameworkParam<IEntity> entityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_Getter.Get());
17
if
(!entityWrapper)
18
{
19
Print
(
string
.Format(
"ScenarioFramework Action: Issue with Getter detected for Action %1."
,
this
),
LogLevel
.ERROR);
20
return
;
21
}
22
23
entity = entityWrapper.GetValue();
24
if
(!entity)
25
{
26
Print
(
string
.Format(
"ScenarioFramework Action: Entity not found for Action %1."
,
this
),
LogLevel
.ERROR);
27
return
;
28
}
29
}
30
31
SCR_AIGroupUtilityComponent
groupUtility =
SCR_AIGroupUtilityComponent
.Cast(m_AIGroup.FindComponent(
SCR_AIGroupUtilityComponent
));
32
if
(!groupUtility)
33
return
;
34
35
BaseWeaponComponent
weaponComponent;
36
BaseMagazineComponent
magazineComponent;
37
int
muzzleId;
38
bool
agentFound;
39
SCR_ChimeraAIAgent
agent;
40
41
foreach
(
SCR_AIInfoComponent
infoComp : groupUtility.m_aInfoComponents)
42
{
43
agent =
SCR_ChimeraAIAgent
.Cast(infoComp.GetOwner());
44
if
(!agent)
45
continue
;
46
47
// Ignore agents that are not "available", considered combat ready
48
if
(!
IsAgentAvailable
(agent))
49
continue
;
50
51
agentFound =
SCR_AIActivityIllumFlareFeature
.GetAgentIllumWeaponAndMuzzle(infoComp, weaponComponent, magazineComponent, muzzleId);
52
if
(agentFound)
53
break
;
54
}
55
56
if
(!agentFound)
57
return
;
58
59
AICommunicationComponent comms = groupUtility.m_Owner.GetCommunicationComponent();
60
if
(!comms)
61
return
;
62
63
IEntity
character = agent.GetControlledEntity();
64
if
(!character)
65
return
;
66
67
vector
targetPosition
68
if
(entity)
69
targetPosition = entity.
GetOrigin
();
70
else
71
targetPosition = character.
GetOrigin
();
72
73
vector
targetLocalOffset[4];
74
if
(m_TargeOffset)
75
m_TargeOffset.GetLocalTransform(targetLocalOffset);
76
77
targetPosition = targetPosition + targetLocalOffset[3];
78
79
SCR_AIMessage_FireIllumFlareAt
msg =
SCR_AIMessage_FireIllumFlareAt
.Create(targetPosition);
80
msg.m_RelatedGroupActivity = null;
81
msg.m_fPriorityLevel = SCR_AIActionBase.PRIORITY_BEHAVIOR_RETREAT_MELEE;
82
msg.SetReceiver(agent);
83
comms.RequestBroadcast(msg, agent);
84
}
85
86
//------------------------------------------------------------------------------------------------
87
protected
bool
IsAgentAvailable
(notnull
SCR_ChimeraAIAgent
agent)
88
{
89
SCR_AIInfoComponent
infoComp = agent.m_InfoComponent;
90
91
return
agent && infoComp.
GetAIState
() == EUnitAIState.AVAILABLE &&
92
!infoComp.
HasUnitState
(EUnitState.IN_TURRET) && !infoComp.
HasUnitState
(EUnitState.IN_VEHICLE) &&
93
!infoComp.
HasUnitState
(EUnitState.UNCONSCIOUS);
94
}
95
}
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
OnActivate
override void OnActivate()
Definition
SCR_CharacterCommandLoiter.c:31
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
BaseMagazineComponent
Definition
BaseMagazineComponent.c:13
BaseWeaponComponent
Definition
BaseWeaponComponent.c:13
IEntity
Definition
IEntity.c:13
IEntity::GetOrigin
proto external vector GetOrigin()
PointInfo
PointInfo - allows to define position.
Definition
PointInfo.c:9
SCR_AIActivityIllumFlareFeature
Definition
SCR_AIActivityIllumFlareFeature.c:2
SCR_AIGroupUtilityComponent
Definition
SCR_AIGroupUtilityComponent.c:18
SCR_AIInfoComponent
Definition
SCR_AIInfoComponent.c:46
SCR_AIInfoComponent::HasUnitState
bool HasUnitState(EUnitState state)
Definition
SCR_AIInfoComponent.c:261
SCR_AIInfoComponent::GetAIState
EUnitAIState GetAIState()
Definition
SCR_AIInfoComponent.c:285
SCR_AIMessage_FireIllumFlareAt
Definition
SCR_AIMessage.c:689
SCR_ChimeraAIAgent
Definition
SCR_ChimeraAIAgent.c:6
SCR_ContainerAIActionTitle
Definition
SCR_ContainerAIActionTitle.c:2
SCR_ScenarioFrameworkAIAction
Definition
SCR_ScenarioFrameworkAIAction.c:3
SCR_ScenarioFrameworkAIActionShootFlare
Definition
SCR_ScenarioFrameworkAIActionShootFlare.c:3
SCR_ScenarioFrameworkAIActionShootFlare::IsAgentAvailable
bool IsAgentAvailable(notnull SCR_ChimeraAIAgent agent)
Definition
SCR_ScenarioFrameworkAIActionShootFlare.c:87
SCR_ScenarioFrameworkGet
Definition
SCR_ScenarioFrameworkGet.c:3
UIWidgets
Definition
attributes.c:40
vector
Definition
vector.c:13
Print
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
LogLevel
Enum with severity of the logging message.
Definition
LogLevel.c:14
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
ScenarioFramework
Actions
AIActions
SCR_ScenarioFrameworkAIActionShootFlare.c
Generated by
1.17.0