Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AISendGoalMessageGenerated.c
Go to the documentation of this file.
1 class SCR_AISendGoalMessageGenerated : AITaskScripted
2 {
3  static const string PORT_RECEIVER = "Receiver";
4 
5  //-----------------------------------------------------------------------------------------------------------------------------------------------
6  protected SCR_AIActionBase GetRelatedActivity(AIAgent owner)
7  {
8  SCR_AIBaseUtilityComponent utilityComp = SCR_AIBaseUtilityComponent.Cast(owner.FindComponent(SCR_AIBaseUtilityComponent));
9  if (!utilityComp)
10  return null;
11 
12  if (SCR_AIGroup.Cast(owner))
13  return SCR_AIActivityBase.Cast(utilityComp.GetCurrentAction());
14  else
15  return SCR_AIBehaviorBase.Cast(utilityComp.GetCurrentAction().GetRelatedGroupActivity());
16  return null;
17  }
18 
19  //-----------------------------------------------------------------------------------------------------------------------------------------------
20  protected bool SendMessage(AIAgent owner, AIAgent receiver, AIMessage msg)
21  {
22  AICommunicationComponent comms = owner.GetCommunicationComponent();
23  if (!comms || !receiver)
24  return false;
25 
26  return comms.RequestBroadcast(msg, receiver);
27  }
28 
29  //-----------------------------------------------------------------------------------------------------------------------------------------------
30  protected AIAgent GetReceiverAgent(AIAgent owner)
31  {
32  AIAgent receiver;
33  if (!GetVariableIn(PORT_RECEIVER, receiver))
34  receiver = owner;
35 
36  return receiver;
37  }
38 
39  //-----------------------------------------------------------------------------------------------------------------------------------------------
40  override bool VisibleInPalette() { return false; }
41 }
SCR_AIActionBase
Definition: SCR_AIAction.c:1
SCR_AIActivityBase
Definition: SCR_AIActivity.c:1
SCR_AISendGoalMessageGenerated
Definition: SCR_AISendGoalMessageGenerated.c:1
SCR_AIGroup
Definition: SCR_AIGroup.c:68
SCR_AIBehaviorBase
Definition: SCR_AIBehavior.c:1