24 super.SetAiGroup(aiGroup);
27 if (pilotVacancyCheck)
99 super.Init(
task, context);
117 super.StartTaskSolving();
151 if (!boardingWaypoint)
163 return boardingWaypoint;
217 m_AiGroup.GetOnWaypointCompleted().Clear();
234 super.FailTaskSolving();
244 m_AiGroup.GetOnWaypointCompleted().Clear();
250 super.CompleteTaskSolving();
260 string company, platoon, squad, character, format;
261 m_AiGroup.GetCallsigns(company, platoon, squad, character, format);
262 return string.Format(format, company, platoon, squad, character);
271 array<AIAgent> aiAgents = {};
272 aiGroup.GetAgents(aiAgents);
274 int nextToLastLOD = AIAgent.GetMaxLOD() - 1;
276 foreach (AIAgent aiAgent : aiAgents)
278 if (aiAgent.GetLOD() == AIAgent.GetMaxLOD())
279 aiAgent.SetLOD(nextToLastLOD);
281 aiAgent.PreventMaxLOD();
291 array<AIAgent> aiAgents = {};
292 aiGroup.GetAgents(aiAgents);
294 foreach (AIAgent aiAgent : aiAgents)
296 aiAgent.AllowMaxLOD();
371 SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.FindResourceComponent(
m_Vehicle);
372 if (!resourceComponent)
375 return resourceComponent.GetContainer(
EResourceType.SUPPLIES);
384 AIWaypoint currentWaypoint =
m_AiGroup.GetCurrentWaypoint();
387 m_AiGroup.CompleteWaypoint(currentWaypoint);
419 if (!roadNetworkManager)
425 vector reachableWaypointPosition;
427 if (!roadNetworkManager.GetReachableWaypointInRoad(
m_AiGroup.GetOrigin(), waypointPosition, waypointCompletionRadius, reachableWaypointPosition))
428 reachableWaypointPosition = waypointPosition;
437 waypoint.SetCompletionRadius(waypointCompletionRadius -
vector.Distance(reachableWaypointPosition, waypointPosition));
474 bool isCloseToSourceBase =
vector.DistanceSq(
m_SourceBase.GetOwner().GetOrigin(),
m_AiGroup.GetOrigin()) < (sourceBaseRadius * sourceBaseRadius);
475 if (isCloseToSourceBase)
584 if (!waypointPrefab.IsValid())
588 spawnParams.TransformMode = ETransformMode.WORLD;
590 float surfaceY =
GetGame().GetWorld().GetSurfaceY(origin[0], origin[2]);
591 origin[1] = surfaceY;
592 spawnParams.Transform[3] = origin;
ArmaReforgerScripted GetGame()
SCR_EResupplyTaskSolverErrorState
SCR_EResupplyTaskSolverState
ScriptInvokerBase< ScriptInvokerInt2Method > ScriptInvokerInt2
void SCR_Task(IEntitySource src, IEntity parent)
Object holding reference to resource. In destructor release the resource.
float GetMaxResourceValue()
SCR_CampaignMilitaryBaseComponent GetSourceBase()
void FailResupplyTaskSolving(SCR_EResupplyTaskSolverErrorState errorState=SCR_EResupplyTaskSolverErrorState.DEFAULT)
Mark solver as failed, clean up, and provide error reporting.
SCR_CampaignMilitaryBaseComponent m_SourceBase
void CompleteTransportGroupCurrentWaypoint()
void AddOnMoveToSuppliedBaseCompletedHandler()
SCR_AIWaypoint SpawnLoadSupplyWaypoint()
SCR_LoadSuppliesWaypoint m_LoadSuppliesWaypoint
SCR_ResourceContainer GetVehicleSuppliesContainer()
SCR_AIWaypoint SpawnWaypoint(Resource waypointPrefab, vector origin)
SCR_BoardingEntityWaypoint CreateBoardingVehicleWaypoint()
void RemoveOnMoveToSourceBaseCompletedHandler()
void AllowMaxLOD(SCR_AIGroup aiGroup)
SCR_AIWaypoint SpawnMoveWaypoint(vector position)
void RemoveOnBoardingCompletedHandler()
SCR_UnloadSuppliesWaypoint SpawnUnloadSupplyWaypoint()
string GetTransportGroupName()
void OnMoveToSuppliedBaseCompleted(SCR_AIWaypoint waypoint)
SCR_BoardingEntityWaypoint SpawnBoardingWaypoint()
SCR_UnloadSuppliesWaypoint m_UnloadSuppliesWaypoint
void SCR_ResupplyTaskSolver()
void RemoveOnUnloadSuppliesCompletedHandler()
SCR_AIGroupConditionManager GetAiGroupConditionManager()
EAIGroupCombatMode m_ePreviousGroupCombatMode
override void StartTaskSolving()
Start the task-solving process, branching to appropriate initial action.
void OnUnloadSuppliesCompleted(SCR_AIWaypoint waypoint)
SCR_BoardingEntityWaypoint m_BoardingWaypoint
ScriptInvokerInt2 GetOnResupplyTaskSolverStateChanged()
void AddOnLoadSuppliesCompletedHandler()
void OnMoveToSourceBaseCompleted(SCR_AIWaypoint waypoint)
ref SCR_VehicleConditionManager m_VehicleConditionManager
SCR_ResupplyCampaignMilitaryBaseTaskEntity m_ResupplyTask
void ResetToInitialState()
Reset solver state to initial (inactive).
SCR_AIVehicleUsageComponent m_AiVehicleUsage
SCR_AIWaypoint m_MoveToSourceBaseWaypoint
void RemoveOnMoveToSuppliedBaseCompletedHandler()
ref SCR_AIGroupConditionManager m_AiGroupConditionManager
SCR_LoadSuppliesWaypoint CreateLoadSuppliesWaypoint()
void SetResupplyTaskSolverState(SCR_EResupplyTaskSolverState state)
void AddOnBoardingCompletedHandler()
void CompleteAllWaypoints()
void CreateMoveWaypointToSourceOrSuppliedBase()
void SetSourceBase(SCR_CampaignMilitaryBaseComponent sourceBase)
void OnBoardingCompleted(AIWaypoint waypoint)
void AddOnMoveToSourceBaseCompletedHandler()
SCR_EResupplyTaskSolverState GetResupplyTaskSolverState()
ref ScriptInvokerInt2 m_OnResupplyTaskSolverStateChanged
SCR_AIWaypoint CreateMoveWaypointToSourceBase()
void SetVehicle(Vehicle vehicle)
void RemoveOnLoadSuppliesCompletedHandler()
ref SCR_ResupplyTaskSolverEntry m_ResupplyTaskSolverEntry
override void Update(float timeSlice)
Periodic update for resource/availability checks.
SCR_EResupplyTaskSolverState m_eResupplySolverState
SCR_BoardingWaypoint SpawnGetOutWaypoint()
void SetResupplyTaskSolverEntry(SCR_ResupplyTaskSolverEntry entry)
Configures this solver with a resupply solver entry.
void PreventMaxLOD(SCR_AIGroup aiGroup)
SCR_VehicleConditionManager GetVehicleConditionManager()
override void SetAiGroup(SCR_AIGroup aiGroup)
void CompleteTaskSolving()
Mark solver as completed with cleanup.
SCR_AIWaypoint CreateMoveWaypoint(SCR_EResupplyTaskSolverState resupplySolverState, vector waypointPosition, float waypointCompletionRadius)
void OnLoadSuppliesCompleted(SCR_AIWaypoint waypoint)
SCR_AIWaypoint m_MoveToSuppliedBaseWaypoint
SCR_AIGroupUtilityComponent m_TransportGroupUtility
void OnWaypointFailed(int moveResult, IEntity vehicleUsed, bool isWaypointRelated, vector moveLocation)
override void Init(SCR_Task task, SCR_TaskSolverContext context)
Initialize solver with task and context. Registers events.
void AddOnUnloadSuppliesCompletedHandler()
void SetIgnoredAiGroup(SCR_AIGroup aiGroup)
enum EPhysicsLayerPresets Vehicle
proto external void AllowMaxLOD()
LogLevel
Enum with severity of the logging message.
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)