5 static const string PORT_RECEIVER =
"Receiver";
6 static const string PORT_STRING =
"StringIn";
9 protected AICommunicationComponent m_Mailbox;
12 [
Attribute(
"", UIWidgets.EditBox,
"String value",
"")]
16 protected static ref TStringArray s_aVarsInBase = {
20 override TStringArray GetVariablesIn()
25 override void OnInit(AIAgent owner)
27 m_Mailbox = owner.GetCommunicationComponent();
31 protected bool InitSendMessageInputs(AIAgent owner)
35 Print(
"No owner of the task send message! Something wrong!", LogLevel.ERROR);
41 Print(
"Owner of the task has no AICommunicationComponent!", LogLevel.ERROR);
45 GetVariableIn(PORT_RECEIVER,m_Receiver);
54 protected ENodeResult SendMessage(AIAgent owner, AIMessage msg)
57 SCR_MailboxComponent mailboxComp = SCR_MailboxComponent.Cast(m_Mailbox);
59 mailboxComp.DebugLogBroadcastMessage(msg);
62 if (
m_Mailbox.RequestBroadcast(msg, m_Receiver))
63 return ENodeResult.SUCCESS;
66 PrintFormat(
"Unable to send message from %1 to %2", owner, m_Receiver);
67 return ENodeResult.FAIL;
75 static const string PORT_ENTITY =
"EntityIn";
76 static const string PORT_INTEGER =
"IntegerIn";
77 static const string PORT_VECTOR =
"VectorIn";
78 static const string PORT_BOOL =
"BoolIn";
79 static const string PORT_FLOAT =
"FloatIn";
80 static const string PORT_TYPENAME =
"TypenameIn";
81 static const string PORT_SMARTACTION =
"SmartActionComponent";
82 static const string PORT_PRIORITY_LEVEL =
"PriorityLevel";
85 [
Attribute(
"0", UIWidgets.EditBox,
"Integer value",
"")]
88 [
Attribute(
"0", UIWidgets.EditBox,
"Vector value",
"")]
91 [
Attribute(
"0", UIWidgets.CheckBox,
"Bool value",
"")]
97 protected static ref TStringArray s_aVarsIn = {
108 override TStringArray GetVariablesIn()
113 override ENodeResult EOnTaskSimulate(AIAgent owner,
float dt)
115 if (InitSendMessageInputs(owner))
116 return ENodeResult.SUCCESS;
118 return ENodeResult.FAIL;
122 override protected bool InitSendMessageInputs(AIAgent owner)
124 if (!super.InitSendMessageInputs(owner))
132 Print(
"Cannot find AIWorld to read config of messages!", LogLevel.ERROR);
140 override bool VisibleInPalette()