6 class SCR_AIUtilityComponent : SCR_AIBaseUtilityComponent
27 protected static const float DISTANCE_HYSTERESIS_FACTOR = 0.45;
28 protected static const float NEARBY_DISTANCE_SQ = 2500;
29 protected static const float REACTION_TO_SAME_UNKNOWN_TARGET_INTERVAL_MS = 2500;
41 AddDebugMessage(
"EvaluateBehavior START");
42 if (m_bEvaluationBreakpoint)
44 Print(
"EvaluateBehavior breakpoint triggered", LogLevel.NORMAL);
46 m_bEvaluationBreakpoint =
false;
60 AIMessage msgBase =
m_Mailbox.ReadMessage(
true);
68 AddDebugMessage(
string.Format(
"PerformGoalReaction: %1, from BT: %2", msgGoal, msgGoal.m_sSentFromBt));
85 AddDebugMessage(
string.Format(
"InfoMessage consumed by action: %1, from BT: %2", msgInfo, msgInfo.m_sSentFromBt));
90 if (!overrideReaction)
93 AddDebugMessage(
string.Format(
"PerformInfoReaction: %1, from BT: %2", msgInfo, msgInfo.m_sSentFromBt));
101 bool reactToUnknownTarget =
false;
107 reactToUnknownTarget =
true;
111 reactToUnknownTarget =
true;
117 AddDebugMessage(
string.Format(
"PerformReaction: Unknown Target: %1", unknownTarget));
129 bool selectedTargetChanged;
130 bool retreatTargetChanged;
131 bool compartmentChanged;
135 prevTarget, selectedTarget, retreatTargetChanged, compartmentChanged);
140 AddDebugMessage(
string.Format(
"PerformReaction: Selected Target Changed: %1", selectedTarget));
143 m_ConfigComponent.m_Reaction_SelectedTargetChanged.PerformReaction(
this, prevTarget, selectedTarget);
148 ((selectedTargetChanged && !selectedTarget && retreatTarget) ||
149 (!selectedTarget && retreatTargetChanged)))
154 AddDebugMessage(
string.Format(
"PerformReaction: Retreat From Target: %1", retreatTarget));
170 DebugLogActionsPriority();
193 AddDebugMessage(
"EvaluateBehavior END\n");
224 CompartmentAccessComponent compartmentAccess = CompartmentAccessComponent.Cast(
m_OwnerEntity.FindComponent(CompartmentAccessComponent));
225 if (!compartmentAccess)
228 if (!compartmentAccess.IsInCompartment())
236 float score = action.Evaluate();
237 float priorityLevel = action.EvaluatePriorityLevel();
238 IEntity vehicle = compartmentAccess.GetCompartment().GetOwner();
247 super.EOnInit(owner);
248 AIAgent agent = AIAgent.Cast(
GetOwner());
252 m_ConfigComponent = SCR_AIConfigComponent.Cast(agent.FindComponent(SCR_AIConfigComponent));
258 m_AIInfo = SCR_AIInfoComponent.Cast(agent.FindComponent(SCR_AIInfoComponent));
266 m_Mailbox = SCR_MailboxComponent.Cast(owner.FindComponent(SCR_MailboxComponent));
272 override void EOnDiag(IEntity owner,
float timeSlice)