12 [
Attribute(
desc:
"Name of the source base entity used to set source base. If empty, the base is not set.")]
15 [
Attribute(
"100",
desc:
"Radius in meters within which the unit is searching for the vehicle.",
params:
"0 inf")]
18 [
Attribute(
"0",
desc:
"Should the transport group be teleported into the vehicle just before the task solving?")]
21 [
Attribute(
"#AR-SuppliesTransportSystem_TransportGroup_NoDestination",
desc:
"Localization key for cases where the transport group has no destination.")]
24 [
Attribute(
"{349C8E58C5ACAF4D}Prefabs/Tasks/TransportUnitHelpTaskEntity.et",
desc:
"Task to be created if the transport unit fails to deliver supplies.",
params:
"et")]
30 [
RplProp(onRplName:
"OnSourceBaseCallsignSet")]
33 [
RplProp(onRplName:
"OnDestinationCallsignSet")]
39 [
RplProp(onRplName:
"OnPreferableResupplyTaskSet")]
42 [
RplProp(onRplName:
"OnVehicleAggregatedResourceValueSet")]
45 [
RplProp(onRplName:
"OnIsVehicleUsableSet")]
146 return m_AIGroup.GetCustomNameWithOriginal();
317 bool isCloseToSourceBase =
vector.DistanceSq(
m_SourceBase.GetOwner().GetOrigin(),
m_Vehicle.GetOrigin()) <= (sourceBaseRadius * sourceBaseRadius);
318 if (isCloseToSourceBase)
378 array<AIAgent> agents = {};
381 foreach (AIAgent agent : agents)
384 if (!compartmentAccess)
448 SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.FindResourceComponent(vehicle);
449 if (!resourceComponent)
510 if (gameMode && gameMode.IsProxy())
520 garbageSystem.UpdateBlacklist(vehicle, blacklisted);
654 groupTaskManager.SetGroupTask(
task, 0);
656 SCR_TransportUnitHelpTaskEntity transportUnitHelpTask = SCR_TransportUnitHelpTaskEntity.Cast(
task);
657 if (!transportUnitHelpTask)
660 transportUnitHelpTask.SetTransportUnit(
this);
662 return transportUnitHelpTask;
668 array<SCR_Task> tasks = {};
672 faction.GetFactionKey(),
674 SCR_TransportUnitHelpTaskEntity
679 SCR_TransportUnitHelpTaskEntity transportUnitHelpTask = SCR_TransportUnitHelpTaskEntity.Cast(theTask);
680 if (!transportUnitHelpTask)
683 if (transportUnitHelpTask.GetTransportUnit() ==
this)
702 float minSqDistanceAny =
float.MAX;
703 float minSqDistanceOperable =
float.MAX;
705 Vehicle closestAny, closestOperable;
708 float sqDistance =
vector.DistanceSq(vehicle.GetOrigin(),
m_AIGroup.GetOrigin());
711 if (sqDistance < minSqDistanceAny)
713 minSqDistanceAny = sqDistance;
714 closestAny = vehicle;
720 minSqDistanceOperable = sqDistance;
721 closestOperable = vehicle;
726 return closestOperable;
734 return entity.IsInherited(
Vehicle);
744 if (vehicle.m_eVehicleType !=
EVehicleType.SUPPLY_TRUCK)
758 array<SCR_Task> resupplyTasks = {};
761 float maxScarcityLevel = -
float.MAX;
762 int maxPriorityLevel =
int.MAX;
763 SCR_ResupplyCampaignMilitaryBaseTaskEntity resupplyTask;
764 SCR_ResupplyCampaignMilitaryBaseTaskEntity preferableResupplyTask;
774 resupplyTask = SCR_ResupplyCampaignMilitaryBaseTaskEntity.Cast(
task);
783 militaryBase = resupplyTask.GetMilitaryBase();
788 if (baseResupplyPriority < maxPriorityLevel)
790 maxPriorityLevel = baseResupplyPriority;
791 preferableResupplyTask = resupplyTask;
792 maxScarcityLevel = resupplyTask.GetMilitaryBase().GetScarcityLevel();
794 else if (baseResupplyPriority == maxPriorityLevel)
796 float baseScarcityLevel = resupplyTask.GetMilitaryBase().GetScarcityLevel();
797 if (baseScarcityLevel > maxScarcityLevel)
799 maxScarcityLevel = baseScarcityLevel;
800 preferableResupplyTask = resupplyTask;
805 return preferableResupplyTask;
815 if (!sourceBaseEntity)
902 super.OnPostInit(owner);
937 if (gameMode && !gameMode.IsProxy())
948 super.OnDelete(owner);
ArmaReforgerScripted GetGame()
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_BaseGameMode GetGameMode()
SCR_CacheNoteComponentClass ScriptComponentClass RplProp()] protected ref array< string > m_aLines
SCR_EResupplyTaskSolverState
void SCR_FuelManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
void SCR_GroupTaskManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
FactionKey GetFactionKey()
ScriptInvokerBase< ScriptInvokerFloatMethod > ScriptInvokerFloat
ScriptInvokerBase< ScriptInvokerIntMethod > ScriptInvokerInt
void SCR_Task(IEntitySource src, IEntity parent)
ScriptInvokerBase< OnTransportUnitVehicleChangedDelegate > OnTransportUnitVehicleChangedInvoker
func OnTransportUnitVehicleChangedDelegate
SCR_EVehicleConditionCheckType
proto external int SetEventMask(notnull IEntity owner, int mask)
proto external GenericComponent FindComponent(typename typeName)
proto external Managed FindComponent(typename typeName)
proto external BaseWorld GetWorld()
Replication item identifier.
SCR_ESupplyRequestExecutionPriority GetSupplyRequestExecutionPriority()
Created in SCR_GameModeCampaign.
SCR_CampaignMilitaryBaseComponent FindBaseByCallsign(int callsign)
bool MoveInVehicleAny(IEntity vehicle)
Script entry for garbage system modding.
static SCR_GarbageSystem GetByEntityWorld(IEntity entity)
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
static SCR_SuppliesTransportSystem GetInstance()
void SelectForTaskSolving(SCR_ResupplyCampaignMilitaryBaseTaskEntity task)
SCR_ResupplyCampaignMilitaryBaseTaskEntity m_PreferableResupplyTask
void CreateMoveWaypointToSourceBase()
SCR_EResupplyTaskSolverState GetResupplyTaskSolverState()
SCR_CampaignMilitaryBaseComponent m_SourceBase
SCR_ResupplyTaskSolver m_TaskSolver
static int GenerateTaskID()
RplId m_PreferableResupplyTaskRplId
int m_iSuppliedBaseCallsign
SCR_TaskSystem m_TaskSystem
override void EOnInit(IEntity owner)
void UpdateGarbageBlacklist(notnull Vehicle vehicle, bool blacklisted)
ref ScriptInvokerInt m_OnStateChanged
SCR_TaskSolverManagerComponent m_TaskSolverManager
float m_fVehicleAggregatedResourceValue
SCR_TransportUnitHelpTaskEntity CreateTransportUnitHelpTask()
void SetState(SCR_ETransportUnitState state)
void SetSourceBaseFromEntityName()
static int s_iLastGeneratedTaskId
SCR_ResupplyTaskSolver GetSolver()
void OnTaskSolverStateChanged(SCR_TaskSolverBase taskSolver, SCR_ETaskSolverState taskSolverState)
SCR_ResupplyCampaignMilitaryBaseTaskEntity GetPreferableResupplyTask()
void OnBoardingCompleted(AIWaypoint waypoint)
string GetDestinationName()
bool m_bTeleportGroupToVehicle
SCR_AIVehicleUsageComponent m_AiVehicleUsage
void OnVehicleAggregatedResourceValueSet()
void TeleportGroupToVehicle()
int m_iSourceBaseCallsign
SCR_ResourceConsumer GetVehicleSuppliesConsumer(Vehicle vehicle)
ref ScriptInvokerInt m_OnResupplyTaskSolverStateChanged
void SetSuppliedBase(SCR_CampaignMilitaryBaseComponent suppliedBase)
ScriptInvokerFloat GetOnVehicleResourcesValueChanged()
ScriptInvokerInt GetOnResupplyTaskSolverStateChanged()
override void OnDelete(IEntity owner)
float GetVehicleAggregatedResourceValue()
void SetTruckFuel(float percentage)
SCR_ETransportUnitState m_eState
string m_sSourceBaseEntityName
SCR_CampaignMilitaryBaseComponent m_SuppliedBase
void OnSourceBaseCallsignSet()
Called upon the m_iSourceBaseCallsign replication and set the correct base from the server.
SCR_TransportUnitHelpTaskEntity m_TransportUnitHelpTaskEntity
SCR_ETransportUnitState GetState()
SCR_ResupplyCampaignMilitaryBaseTaskEntity SelectPreferableResupplyTask()
bool QuerySupplyTrucks(IEntity entity)
void SetVehicle(Vehicle vehicle)
void OnIsVehicleUsableSet()
ref OnTransportUnitVehicleChangedInvoker m_OnVehicleChanged
bool FilterVehicles(IEntity entity)
bool IsReadyForTaskSolving()
void OnPreferableResupplyTaskSet()
Called upon the m_PreferableResupplyTaskRplId replication.
SCR_AIGroupConditionManager m_AiGroupConditionManager
SCR_EVehicleConditionCheckType GetVehicleFailedConditionType()
void OnResupplyTaskSolverStateChanged(int solverId, SCR_EResupplyTaskSolverState resupplyTaskSolverState)
void OnDestinationCallsignSet()
LocalizedString m_sNoDestinationLocalizationKey
void OnVehicleUsabilityChanged(bool isUsable)
float m_fSearchTruckRadius
void Update(float timeSlice)
void SetSourceBase(SCR_CampaignMilitaryBaseComponent sourceBase)
ResourceName m_sTransportUnitHelpTask
void OnMoveToSourceBaseWaypointCompleted(AIWaypoint waypoint)
SCR_SuppliesTransportSystem m_SuppliesTransportSystem
ScriptInvokerInt GetOnStateChanged()
SCR_AIWaypoint m_MoveToSourceBaseWaypoint
static const string TRANSPORT_UNIT_HELP_TASK_ID
void OnVehicleDeleted(SCR_AIVehicleUsageComponent vehicleUsageComponent)
void OnVehicleResourceValueChanged(SCR_ResourceInteractor interactor, float previousValue)
SCR_BoardingEntityWaypoint CreateBoardingVehicleWaypoint()
void ReturnToSourceBaseIfNeeded()
void SendTransportGroupLostNotificationToCommander()
SCR_EVehicleConditionCheckType m_eVehicleFailedConditionType
bool HasTransportUnitHelpTask(notnull SCR_Faction faction)
Vehicle GetClosestVehicle()
ref set< Vehicle > m_NearbySupplyTrucks
void SetPreferableResupplyTask(SCR_ResupplyCampaignMilitaryBaseTaskEntity preferableTask)
override void OnPostInit(IEntity owner)
SCR_BoardingEntityWaypoint m_BoardingWaypoint
ref ScriptInvokerFloat m_OnVehicleResourcesValueChanged
SCR_VehicleConditionManager m_VehicleConditionManager
OnTransportUnitVehicleChangedInvoker GetOnVehicleChanged()
SCR_CampaignMilitaryBaseComponent GetSourceBase()
SCR_FuelManagerComponent m_FuelManager
proto external GenericEntity GetOwner()
Get owner entity.
enum EPhysicsLayerPresets Vehicle
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
SCR_FieldOfViewSettings Attribute
EntityEvent
Various entity events.