Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AISendGoalMessageGenerated.c
Go to the documentation of this file.
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 static override bool VisibleInPalette() { return false; }
41}
void SCR_AIActivityBase(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint)
void SCR_AIBehaviorBase(SCR_AIUtilityComponent utility, SCR_AIActivityBase groupActivity)
Base class for all messages related to AI.
Definition AIMessage.c:14
proto bool GetVariableIn(string name, out void val)
SCR_AIActionBase GetRelatedActivity(AIAgent owner)
bool SendMessage(AIAgent owner, AIAgent receiver, AIMessage msg)