Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIEndProcessCombatMoveRequest.c
Go to the documentation of this file.
1/*
2Logic which runs after all combat move requests
3*/
4
6{
7 // Inputs
8 protected static const string PORT_REQUEST = "Request";
9
10 protected SCR_AIUtilityComponent m_Utility;
11 protected SCR_AICombatMoveState m_State;
12
13 //--------------------------------------------------------------------------------------------
14 override void OnInit(AIAgent owner)
15 {
16 m_Utility = SCR_AIUtilityComponent.Cast(owner.FindComponent(SCR_AIUtilityComponent));
17 if (m_Utility)
18 m_State = m_Utility.m_CombatMoveState;
19 }
20
21 //---------------------------------------------------------------------------
22 override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
23 {
24 if (!m_State)
25 return ENodeResult.FAIL;
26
29 return ENodeResult.FAIL;
30
31 // Common logic for all request
32 m_State.EnableAiming(rq.m_bAimAtTargetEnd);
33
34 // Invoke script invokers
35 if (rq.m_eState == SCR_EAICombatMoveRequestState.SUCCESS)
36 {
37 auto invoker = rq.GetOnCompleted(false);
38 if (invoker)
39 invoker.Invoke(m_Utility, rq);
40 }
41 else if (rq.m_eState == SCR_EAICombatMoveRequestState.FAIL)
42 {
43 auto invoker = rq.GetOnFailed(false);
44 if (invoker)
45 invoker.Invoke(m_Utility, rq, rq.m_eFailReason);
46 }
47
48 return ENodeResult.SUCCESS;
49 }
50
51
52 //---------------------------------------------------------------------------
53 protected static ref TStringArray s_aVarsIn = {
55 };
57 {
58 return s_aVarsIn;
59 }
60
61 static override bool VisibleInPalette() { return true; }
62}
SCR_EAICombatMoveRequestState
proto bool GetVariableIn(string name, out void val)
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.
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
ENodeResult
Definition ENodeResult.c:13
array< string > TStringArray
Definition Types.c:385