Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AICombatMoveRequest.c
Go to the documentation of this file.
8
9// Subtypes which can represent reason for this request
10enum SCR_EAICombatMoveReason
11{
12 STANDARD, // Moving somewhere during combat
13 FF_AVOIDANCE, // Friendly Fire avoidance
14 MOVE_FROM_TARGET, // Moving backwards from target
15 MOVE_FROM_DANGER, // Danger avoidance
17 CHARACTER_AVOIDANCE // Avoiding collision with a friendly character
18}
19
20// For which unit type this move request is meant
21enum SCR_EAICombatMoveUnitType
22{
23 CHARACTER, // Character on foot
24 GROUND_VEHICLE // Ground vehicle
25}
26
27enum SCR_EAICombatMoveDirection
28{
29 FORWARD, // Towards the target
30 BACKWARD, // Away from target
33 ANYWHERE, // Without specific direciton, find any position close to current one
34 CUSTOM_POS // Moving directly to the provided position
35}
36
37
38//------------------------------------------------------------------------------------------------
40void SCR_AICombatMoveRequest_OnCompleted(SCR_AIUtilityComponent utility, SCR_AICombatMoveRequestBase request);
41
43void SCR_AICombatMoveRequest_OnFailed(SCR_AIUtilityComponent utility, SCR_AICombatMoveRequestBase request, SCR_EAICombatMoveRequestFailReason failReason);
44
46{
47 SCR_EAICombatMoveRequestType m_eType; // Type int is needed for decoding in behavior tree
49 SCR_EAICombatMoveRequestFailReason m_eFailReason = SCR_EAICombatMoveRequestFailReason.NONE;
50 SCR_EAICombatMoveReason m_eReason; // "Reason" of request - abstract data to help identify our request in combat move logic
51 SCR_EAICombatMoveUnitType m_eUnitType;
52
53 // It can be used for various timings, up to sender of the request to decide what it means
54 float m_f_UserTimer_s;
55
56 // Allowing or restricting aiming is common for all request types
57 bool m_bAimAtTarget; // Aim at target while executing the request?
58 bool m_bAimAtTargetEnd; // Aim at target after request is executed?
59
60 // Events
61 protected ref ScriptInvokerBase<SCR_AICombatMoveRequest_OnCompleted> m_OnCompleted;
62 protected ref ScriptInvokerBase<SCR_AICombatMoveRequest_OnFailed> m_OnFailed;
63
65 ScriptInvokerBase<SCR_AICombatMoveRequest_OnCompleted> GetOnCompleted(bool createInvoker = true)
66 {
67 if (!m_OnCompleted && createInvoker)
68 m_OnCompleted = new ScriptInvokerBase<SCR_AICombatMoveRequest_OnCompleted>();
69 return m_OnCompleted;
70 }
71
73 ScriptInvokerBase<SCR_AICombatMoveRequest_OnFailed> GetOnFailed(bool createInvoker = true)
74 {
75 if (!m_OnFailed && createInvoker)
76 m_OnFailed = new ScriptInvokerBase<SCR_AICombatMoveRequest_OnFailed>();
77 return m_OnFailed;
78 }
79}
80
81
82//------------------------------------------------------------------------------------------------
83// Movement with potential cover search
85void SCR_AICombatMoveRequest_Move_MovementEvent(SCR_AIUtilityComponent utility, SCR_AICombatMoveRequest_Move request, vector movePos, bool destinationIsCover);
86
88{
89 vector m_vTargetPos; // Position of target (enemy) - must be useable for cover search, should be muzzle position or head position.
90 vector m_vMovePos; // Move position relative to which m_eDirection works
91 bool m_bTryFindCover; // Try to find cover or not?
92 bool m_bFailIfNoCover; // If m_bTryFindCover is true, but cover was not found, fail or move anyway?
93 bool m_bCheckCoverVisibility; // (only m_bTryFindCover) Do we need to check target pos. visibility from that cover or not?
94 ECharacterStance m_eStanceMoving; // Stance used for movement
95 ECharacterStance m_eStanceEnd; // Stance used at the end (might be overridden by found cover)
96 EMovementType m_eMovementType; //
97 float m_fCoverSearchDistMin; // (only m_bTryFindCover)
98 float m_fCoverSearchDistMax; // (only m_bTryFindCover)
99 float m_fCoverSearchSectorHalfAngleRad = Math.PI; // (only m_bTryFindCover) Half-angle (in radians) of cover query sector. Pi is full circle, Pi/2 is -90deg...+90deg sector.
100 float m_fMoveDuration_s; // Movement duration for movement to non-cover position
101 bool m_bUseCoverSearchDirectivity; // If trying to find cover, prefer covers in given direction or not. Affects cover scoring.
102 SCR_EAICombatMoveDirection m_eDirection;// Direction - Where we want to move !!! relative to m_vMovePos
103 vector m_vAvoidStraightPathDir; // When not 0,0,0, changes pathfinding to try to flank and avoid the path aligned same direction. Makes sense mostly for m_eDirection = CUSTOM_POS.
104
105 // Events
106 protected ref ScriptInvokerBase<SCR_AICombatMoveRequest_Move_MovementEvent> m_OnMovementStarted;
107
109 {
110 m_eType = SCR_EAICombatMoveRequestType.MOVE;
111 }
112
113 // Called right before move node starts
114 ScriptInvokerBase<SCR_AICombatMoveRequest_Move_MovementEvent> GetOnMovementStarted(bool createInvoker = true)
115 {
116 if (!m_OnMovementStarted && createInvoker)
117 m_OnMovementStarted = new ScriptInvokerBase<SCR_AICombatMoveRequest_Move_MovementEvent>();
118 return m_OnMovementStarted;
119 }
120}
121
122//------------------------------------------------------------------------------------------------
124{
131//------------------------------------------------------------------------------------------------
132// Changes stance when we are in cover
133class SCR_AICombatMoveRequest_ChangeStanceInCover : SCR_AICombatMoveRequestBase
139 m_eType = SCR_EAICombatMoveRequestType.CHANGE_STANCE_IN_COVER;
141}
142
143//------------------------------------------------------------------------------------------------
149 {
152}
enum SCR_EAICombatMoveRequestType SCR_AICombatMoveRequest_OnCompleted
func SCR_AICombatMoveRequest_OnFailed
enum SCR_EAICombatMoveRequestType FF_AVOIDANCE
enum SCR_EAICombatMoveRequestType MOVE_FROM_TARGET
enum SCR_EAICombatMoveRequestType MOVE_FROM_DANGER
enum SCR_EAICombatMoveRequestType CHARACTER
enum SCR_EAICombatMoveRequestType STANDARD
SCR_AICombatMoveRequest_ChangeStanceInCover m_eStance
void SCR_AICombatMoveRequest_ChangeStance()
enum SCR_EAICombatMoveRequestType SUPPRESSED_IN_COVER
enum SCR_EAICombatMoveRequestType BACKWARD
class SCR_AICombatMoveRequestBase SCR_AICombatMoveRequest_Move_MovementEvent
enum SCR_EAICombatMoveRequestType ANYWHERE
SCR_EAICombatMoveRequestType
@ CHANGE_STANCE_IN_COVER
enum SCR_EAICombatMoveRequestType FORWARD
SCR_AICombatMoveRequest_Move SCR_AICombatMoveRequestBase SCR_AICombatMoveRequest_Stop()
SCR_EAICombatMoveRequestState
bool m_bExposedInCover
SCR_ECampaignBaseType m_eType
Definition Math.c:13
ScriptInvokerBase< SCR_AICombatMoveRequest_Move_MovementEvent > GetOnMovementStarted(bool createInvoker=true)
ref ScriptInvokerBase< SCR_AICombatMoveRequest_Move_MovementEvent > m_OnMovementStarted
ScriptInvokerBase< SCR_AICombatMoveRequest_OnCompleted > GetOnCompleted(bool createInvoker=true)
Called on successful completion of request.
ScriptInvokerBase< SCR_AICombatMoveRequest_OnFailed > GetOnFailed(bool createInvoker=true)
Called on failure of request.
ref ScriptInvokerBase< SCR_AICombatMoveRequest_OnFailed > m_OnFailed
ref ScriptInvokerBase< SCR_AICombatMoveRequest_OnCompleted > m_OnCompleted
ECharacterStance
EMovementType
@ LEFT
navigation
@ RIGHT
@ STOP