4 [
Attribute(
"0",
desc:
"If false then the object has no physics to move itself. If true it means the entity is a vehicle (or part of a vehicle) and it can be moved via physics which means it checks the rigid body if it has a velocity and does not allow to be used if it has",
category:
"General Settings")]
7 [
Attribute(
"1",
desc:
"If true it will send out a notification if the user uses it. The Inherented class does need to support notifications for it to be send",
category:
"Specific Settings")]
10 [
Attribute(
"0",
desc:
"If true it allows the support station to get the 'FactionAffiliationComponent' from parent. This is only done when no 'FactionAffiliationComponent' is found on self and main use case is for vehicle compartments. Only used if 'FactionUsageCheck' is set",
category:
"Faction Settings")]
13 [
Attribute(
"{9DD9C6279F4489B4}Sounds/Editor/SupportStations/SupportStations_Vehicles.acp",
desc:
"File that contains the sound effect",
params:
"acp",
category:
"On use Audio")]
16 [
Attribute(
desc:
"Sound effect played when executing is done. Broadcast to players. Leave empty if no sfx",
category:
"On use Audio")]
19 [
Attribute(
desc:
"Sound played from from user on successfully action. (Some support station might play action on action owner instead of user). Leave empty to not play any voice effects",
category:
"On use Audio")]
74 SCR_AudioSourceConfiguration soundConfig =
new SCR_AudioSourceConfiguration();
75 soundConfig.m_sSoundProject = soundFile;
76 soundConfig.m_sSoundEventName = soundEvent;
99 [
Attribute(
"0",
desc:
"Priority dictates the array order when trying to get the first availible support station. Higher priority means it is closer to the start of the array. Think of grabbing a composition refuel station before a vehicle refuel station.", uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(
ESupportStationPriority),
category:
"General Settings")]
102 [
Attribute(
"7",
desc:
"In meters, Range in which the entity which the player interacts is needs to be. If -1 it will not add itself to the Support Station Manager and can only be used by the action manager that is also a component of the entity this component is part of, note that the action manager will also never check if any are around it only the component on the entity.",
category:
"General Settings")]
105 [
Attribute(
"0",
desc:
"If using range and this is set to true it will use the bounding box of the entity on which the support station action is to check if in range. Otherwise will use the Action position.",
category:
"General Settings")]
111 [
Attribute(
"0",
desc:
"When executing the action and isUsingSupplies this is the base supply cost of the action regardless of any additional supply costs. 0 to have no upfront cost (note inherented classes might still have their own supply cost calculation)",
params:
"0 inf 1",
category:
"Supplies")]
114 [
Attribute(
"0",
desc:
"If Supply station has range it can ignore itself. If you set this false it will also grab itself when looking for stations in range. Think of a fuel tank able to refuel itself. If this is true it cannot if this is false it can. Not that compartments on vehicles are seen as seperate. So a fuel provider cannot refuel itself but it can still refuel the truck for driving",
category:
"Specific Settings")]
117 [
Attribute(
desc:
"Offset of the center of the support station. Note the Area Mesh zone will only visualise this correctly on runtime not in workbench", uiwidget:
UIWidgets.Coords,
params:
"inf inf 0 purpose=coords space=entity",
category:
"Specific Settings")]
120 [
Attribute(
desc:
"Set faction of user that can use Support Station, will be ignored if non are selected. Requires a 'FactionAffiliationComponent' on the Support Station or (or 'AllowGetFactionFromParent' is true on vehicle compartments). It will always allow interaction if user does not have 'FactionAffiliationComponent'. Default faction is the faction associated with the Initial Support Station faction. Flags are checked in order. DISALLOW ON null is only checked when Default faction check is not set.", uiwidget:
UIWidgets.Flags, enums: ParamEnumArray.FromEnum(
ESupportStationFactionUsage),
category:
"Faction Settings")]
123 [
Attribute(
desc:
"Action name when executing the action. Note that if this is left empty then the default ActionManager action name is used",
category:
"General Settings")]
153 FindEntityIds(actionOwner, actionUser, ownerId, userId, playerId);
155 OnExecute(actionOwner, actionUser, playerId, action);
180 playerId = playerManager.GetPlayerIdFromControlledEntity(user);
186 RplComponent rpl = RplComponent.Cast(
Replication.FindItem(ownerId));
188 owner = rpl.GetEntity();
190 rpl = RplComponent.Cast(
Replication.FindItem(userId));
192 user = rpl.GetEntity();
200 IEntity actionOwner, actionUser;
213 OnExecute(actionOwner, actionUser, userPlayerId, action);
238 if (!audioConfig || !soundOwner)
248 if (soundComponent.
GetEventIndex(audioConfig.m_sSoundEventName) > 0)
254 soundComponent.SoundEventOffset(audioConfig.m_sSoundEventName, action.GetLocalPositionAction());
258 soundComponent.SoundEventOffset(audioConfig.m_sSoundEventName, audioConfig.m_vOffset);
266 Print(
string.Format(
"'SCR_BaseSupportStationComponent': Trying to play sound for '%1' but sound either sound event '%2' or more likely sound file '%3' is not included on the SoundComponent! SCR_SoundManagerModule is used instead but that means position of sound is not updated if entity moves while sound is playing.", soundOwner, audioConfig.m_sSoundEventName, audioConfig.m_sSoundProject),
LogLevel.WARNING);
279 audioSource = soundManager.CreateAudioSource(soundOwner, audioConfig, action.GetWorldPositionAction());
283 audioSource = soundManager.CreateAudioSource(soundOwner, audioConfig);
290 soundManager.PlayAudioSource(audioSource);
302 if (!communicationSoundComponent)
310 string characterVoiceEventOnUse;
311 int characterVoicePriority;
318 communicationSoundComponent.SoundEventPriority(characterVoiceEventOnUse, characterVoicePriority,
true);
442 return m_eSupportStationPriority;
522 return physics.GetVelocity() !=
vector.Zero || physics.GetAngularVelocity() !=
vector.Zero;
538 FactionAffiliationComponent userFactionAffiliation = FactionAffiliationComponent.Cast(user.
FindComponent(FactionAffiliationComponent));
539 if (!userFactionAffiliation)
543 Faction userFaction = userFactionAffiliation.GetAffiliatedFaction();
554 if (supportStationFaction)
574 if (!supportStationFaction)
740 return resourceComponent && resourceComponent.IsResourceTypeEnabled();
764 return SCR_ResourceComponent.FindResourceComponent(owner);
783 actionOwner.GetBounds(mins, maxs);
844 SCR_BaseSupportStationComponentClass classData = SCR_BaseSupportStationComponentClass.Cast(
GetComponentData(
GetOwner()));
853 SCR_BaseSupportStationComponentClass classData = SCR_BaseSupportStationComponentClass.Cast(
GetComponentData(
GetOwner()));
863 SCR_BaseSupportStationComponentClass classData = SCR_BaseSupportStationComponentClass.Cast(
GetComponentData(
GetOwner()));
881 SCR_BaseCompartmentManagerComponent compartmentManager = SCR_BaseCompartmentManagerComponent.Cast(vehicle.
FindComponent(SCR_BaseCompartmentManagerComponent));
882 if (!compartmentManager)
886 compartmentManager = SCR_BaseCompartmentManagerComponent.Cast(parent.
FindComponent(SCR_BaseCompartmentManagerComponent));
888 if (!compartmentManager)
896 array<IEntity> occupants = {};
897 compartmentManager.GetOccupants(occupants);
898 CompartmentAccessComponent compartmentAccess;
902 foreach (
IEntity occupant : occupants)
904 playerID = playerManager.GetPlayerIdFromControlledEntity(occupant);
907 playerIds.Insert(playerID);
926 if (checkIfHasDamageSystem)
929 SCR_DamageManagerComponent damageManager = SCR_DamageManagerComponent.Cast(
GetOwner().
FindComponent(SCR_DamageManagerComponent));
934 if (hitZoneContainer)
970 if (!supportStationManager)
979 if (!supportStationManager)
995 SCR_DamageManagerComponent damageManager = SCR_DamageManagerComponent.Cast(owner.
FindComponent(SCR_DamageManagerComponent));
1014 if (hitZoneContainer)
1051 reader.ReadBool(enabled);
1065 Print(
"'" +
GetOwner().
GetName() +
"' No Support Station type assigned in the inherented class. Overwrite the 'GetSupportStationType()' function and do not use the base class!",
LogLevel.ERROR);
1076 SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.FindResourceComponent(
GetOwner());
1077 if (resourceComponent)
1099 if (resourceComponent)
1105 Print(
"'SCR_BaseSupportStationComponent' 'EOnInit': '" +
GetOwner() +
"' Support Station is set to use supplies as it has a Resource Component but it has no consumer nor generator set up",
LogLevel.ERROR);
1154 if (!supportStationManager)
1158 Print(
"'SCR_BaseSupportStationComponent' Support station on entity that exists in world when loaded has range but no 'SCR_SupportStationManagerComponent' availible on GameMode. So it won't work!",
LogLevel.WARNING);
1161 Debug.Error2(
"SCR_BaseSupportStationComponent",
"Support station exists with range but no 'SCR_SupportStationManagerComponent' availible on GameMode!");
1202 if (!supportStationManager)
1209 SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.FindResourceComponent(owner);
1210 if (!resourceComponent && owner.
GetParent())
1211 resourceComponent = SCR_ResourceComponent.FindResourceComponent(owner.
GetParent());
1213 if (resourceComponent)
1225 SCR_BaseSupportStationComponent foundSupportStation;
1226 array<Managed> supportStations = {};
1230 entity.FindComponents(SCR_BaseSupportStationComponent, supportStations);
1233 foreach (Managed supportStation : supportStations)
1235 foundSupportStation = SCR_BaseSupportStationComponent.Cast(supportStation);
1236 if (!foundSupportStation)
1239 if (
type == SCR_ESupportStationResupplyType.NONE || foundSupportStation.GetSupportStationType() ==
type)
1240 return foundSupportStation;
1247 SlotManagerComponent slotManager = SlotManagerComponent.Cast(entity.FindComponent(SlotManagerComponent));
1250 array<EntitySlotInfo> slotInfos = {};
1251 slotManager.GetSlotInfos(slotInfos);
1254 foreach (EntitySlotInfo slotInfo : slotInfos)
1256 slotEntity = slotInfo.GetAttachedEntity();
1260 slotEntity.
FindComponents(SCR_BaseSupportStationComponent, supportStations);
1262 foreach (Managed supportStation : supportStations)
1264 foundSupportStation = SCR_BaseSupportStationComponent.Cast(supportStation);
1265 if (!foundSupportStation)
1268 if (
type == SCR_ESupportStationResupplyType.NONE || foundSupportStation.GetSupportStationType() ==
type)
1269 return foundSupportStation;
1278 IEntity child = entity.GetChildren();
1282 child.
FindComponents(SCR_BaseSupportStationComponent, supportStations);
1285 foreach (Managed supportStation : supportStations)
1287 foundSupportStation = SCR_BaseSupportStationComponent.Cast(supportStation);
1288 if (!foundSupportStation)
1291 if (
type == SCR_ESupportStationResupplyType.NONE || foundSupportStation.GetSupportStationType() ==
type)
1292 return foundSupportStation;
1308 parent.
FindComponents(SCR_BaseSupportStationComponent, supportStations);
1311 foreach (Managed supportStation : supportStations)
1313 foundSupportStation = SCR_BaseSupportStationComponent.Cast(supportStation);
1314 if (!foundSupportStation)
1317 if (
type == SCR_ESupportStationResupplyType.NONE || foundSupportStation.GetSupportStationType() ==
type)
1318 return foundSupportStation;
1332 if (foundSupportStation)
1333 return foundSupportStation;
1345 rootParent.
FindComponents(SCR_BaseSupportStationComponent, supportStations);
1348 foreach (Managed supportStation : supportStations)
1350 foundSupportStation = SCR_BaseSupportStationComponent.Cast(supportStation);
1351 if (!foundSupportStation)
1354 if (
type == SCR_ESupportStationResupplyType.NONE || foundSupportStation.GetSupportStationType() ==
type)
1355 return foundSupportStation;
1369 if (foundSupportStation)
1370 return foundSupportStation;
1387 if (child == entity)
1393 child.
FindComponents(SCR_BaseSupportStationComponent, supportStations);
1396 foreach (Managed supportStation : supportStations)
1398 foundSupportStation = SCR_BaseSupportStationComponent.Cast(supportStation);
1399 if (!foundSupportStation)
1402 if (
type == SCR_ESupportStationResupplyType.NONE || foundSupportStation.GetSupportStationType() ==
type)
1403 return foundSupportStation;
ESupportStationReasonInvalid
ArmaReforgerScripted GetGame()
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
void SCR_AudioSource(SCR_AudioSourceConfiguration audioSourceConfiguration, vector mat[4])
EAudioSourceConfigurationFlag
override int GetSupplyAmountAction(IEntity actionOwner, IEntity actionUser, SCR_BaseUseSupportStationAction action)
override void OnExecute(IEntity actionOwner, IEntity actionUser, int playerId, SCR_BaseUseSupportStationAction action)
override void OnExecutedServer(notnull IEntity actionOwner, notnull IEntity actionUser, notnull SCR_BaseUseSupportStationAction action)
override void DelayedInit(IEntity owner)
override bool InitValidSetup()
void TEMP_OnInteractorReplicated()
bool AreSuppliesEnabled()
LocalizedString GetOverrideUserActionName()
bool HasSupplyGainInsteadOfCost(SCR_BaseUseSupportStationAction action)
void GetPlayerIdsInVehicle(IEntity vehicle, out notnull array< int > playerIds)
void PlayCharacterVoiceEvent(IEntity character)
void OnHitZoneDamageStateChanged(SCR_HitZone defaultHitZone)
Called when default hitZone damage state changed. Not called if entity has a damage manager.
FactionAffiliationComponent m_FactionAffiliationComponent
ESupportStationPriority GetSupportStationPriority()
bool HasEnoughSupplies(IEntity actionOwner, IEntity actionUser, int supplyAmountToCheck)
ref ScriptInvoker Event_OnEnabledChanged
SCR_ResourceGenerator GetResourceGenerator()
ESupportStationFactionUsage
@ SAME_CURRENT_FACTION
The user with the same faction as the current faction can interact with the support station.
@ FRIENDLY_DEFAULT_FACTION
he user with a faction that is a friendly faction to the default faction of the support station can i...
@ DISALLOW_USE_ON_CURRENT_FACTION_NULL
If set it disallows the support station to be used if the faction of the Support station is not set....
@ FRIENDLY_CURRENT_FACTION
The user with a faction that is a friendly faction as the current faction can interact with the suppo...
@ SAME_DEFAULT_FACTION
The user with the same faction as the default faction of the support station can interact with the su...
LocalizedString m_sOverrideUserActionName
ESupportStationFactionUsage m_eFactionUsageCheck
ESupportStationType GetSupportStationType()
int m_iBaseSupplyCostOnUse
bool HasSpaceForSuppliesGeneration(IEntity actionOwner, IEntity actionUser, int supplyAmountToCheck)
bool OnConsumeSuppliesServer(int amount)
bool OnGenerateSuppliesServer(int amount)
SCR_ResourceSystemSubscriptionHandleBase m_ResourceSubscriptionHandler
SCR_AudioSourceConfiguration CreateOnUseAudioConfig(ResourceName soundFile, string soundEvent)
void OnExecuteBroadcast(RplId ownerId, RplId userId, int userPlayerId, int actionId)
void AddRemoveOnDamageStateChanged(IEntity owner, bool subscribe)
Grabs either damage manager or HitZoneContainer to subscribe to OnDamageStateChanged.
bool OverrideDamageState(EDamageState damageState, bool checkIfHasDamageSystem)
bool IsUserValidFaction(IEntity user)
void FindEntityIds(IEntity owner, IEntity user, out RplId ownerId, out RplId userId, out int playerId)
void GetEntitiesFromID(RplId ownerId, RplId userId, out IEntity owner, out IEntity user)
int GetMaxAvailableSupplies()
bool m_bUseRangeBoundingBox
ScriptInvoker GetOnEnabledChanged()
SCR_ServicePointComponent m_ServicePointComponent
void OnSuccessfullyExecuted(IEntity actionOwner, IEntity actionUser, SCR_BaseUseSupportStationAction action)
void PlaySoundEffect(SCR_AudioSourceConfiguration audioConfig, notnull IEntity soundOwner, SCR_BaseUseSupportStationAction action)
bool IsInRange(notnull IEntity actionOwner, vector actionPosition)
SCR_AudioSourceConfiguration GetOnUseAudioConfig()
EDamageState m_eCurrentDamageState
void SetEnabledBroadcast(bool enable)
SCR_ResourceComponent GetResourceComponent()
Caches and returns the resource component.
SCR_ResourceConsumer GetResourceConsumer()
SCR_CampaignFaction GetFaction()
override void DelayedInit()
SCR_CharacterSoundComponentClass GetComponentData()
SCR_EComponentFinderQueryFlags
Used for component finding to know where it can search to get the given component.
override void OnDamageStateChanged(EDamageState newState, EDamageState previousDamageState, bool isJIP)
void SCR_ResourceConsumtionResponse(float availableResource=0, float resourceMultiplier=0, float range=0, EResourceReason reasonCode=EResourceReason.UNAVAILABLE)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_ResourceConsumer m_ResourceConsumer
SCR_ResourceGenerator m_ResourceGenerator
enum EVehicleType IEntity
proto external int SetEventMask(notnull IEntity owner, int mask)
proto external GenericComponent FindComponent(typename typeName)
void Rpc(func method, void p0=NULL, void p1=NULL, void p2=NULL, void p3=NULL, void p4=NULL, void p5=NULL, void p6=NULL, void p7=NULL)
proto external Managed FindComponent(typename typeName)
proto external IEntity GetChildren()
proto external int FindComponents(typename typeName, notnull array< Managed > outComponents)
proto external bool IsLoaded()
proto external IEntity GetParent()
proto external vector CoordToParent(vector coord)
proto external IEntity GetSibling()
proto external IEntity GetRootParent()
Replication item identifier.
int m_iCharacterVoicePriority
ref SCR_AudioSourceConfiguration m_OnUseAudioSourceConfiguration
ResourceName m_sOnUseSoundEffectFile
string m_sCharacterVoiceEventOnUse
SCR_AudioSourceConfiguration CreateOnUseAudioConfig(ResourceName soundFile, string soundEvent)
void GetCharacterVoiceSoundEventVariables(out string characterVoiceEventOnUse, out int characterVoicePriority)
SCR_AudioSourceConfiguration GetOnUseAudioConfig()
string m_sOnUseSoundEffectEventName
bool AllowGetFactionFromParent()
bool m_bAllowGetFactionFromParent
bool m_bSendNotificationOnUse
bool GetSendNotificationOnUse()
bool CanMoveWithPhysics()
ScriptInvoker GetOnDamageStateChanged(bool createNew=true)
EResourceReason GetReason()
static bool IsEmptyOrWhiteSpace(string input)
void RemoveSupportStation(SCR_BaseSupportStationComponent supportStation)
void AddSupportStation(SCR_BaseSupportStationComponent supportStation)
static void OnSupportStationExecutedSuccessfully(notnull SCR_BaseSupportStationComponent supportStation, ESupportStationType supportStationType, IEntity actionUser, IEntity actionOwner, SCR_BaseUseSupportStationAction action)
static SCR_SupportStationManagerComponent GetInstance()
proto external GenericEntity GetOwner()
Get owner entity.
void EOnInit(IEntity owner)
bool RplLoad(ScriptBitReader reader)
bool RplSave(ScriptBitWriter writer)
proto external void SetTransformation(vector transf[])
proto external int GetEventIndex(string name)
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
void SetEnabled(bool enabled)
EntityEvent
Various entity events.
int IsEnabled()
Returns true if the light is enabled.
proto external PlayerController GetPlayerController()
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.