Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_BaseSupportStationComponent.c File Reference

Go to the source code of this file.

Data Structures

class  SCR_BaseSupportStationComponentClass
 

Enumerations

enum  ESupportStationFactionUsage {
  SAME_CURRENT_FACTION = 1 << 0, FRIENDLY_CURRENT_FACTION = 1 << 1, SAME_DEFAULT_FACTION = 1 << 2, FRIENDLY_DEFAULT_FACTION = 1 << 3,
  DISALLOW_USE_ON_CURRENT_FACTION_NULL = 1 << 4
}
 

Functions

SCR_BaseSupportStationComponentClass ScriptComponentClass 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")] protected ESupportStationPriority m_eSupportStationPriority
 
bool GetSendNotificationOnUse ()
 
bool CanMoveWithPhysics ()
 
bool AllowGetFactionFromParent ()
 
SCR_AudioSourceConfiguration GetOnUseAudioConfig ()
 
void GetCharacterVoiceSoundEventVariables (out string characterVoiceEventOnUse, out int characterVoicePriority)
 
void OnExecutedServer (notnull IEntity actionOwner, notnull IEntity actionUser, notnull SCR_BaseUseSupportStationAction action)
 
protected void FindEntityIds (IEntity owner, IEntity user, out RplId ownerId, out RplId userId, out int playerId)
 
protected void GetEntitiesFromID (RplId ownerId, RplId userId, out IEntity owner, out IEntity user)
 
protected void OnExecuteBroadcast (RplId ownerId, RplId userId, int userPlayerId, int actionId)
 
protected void OnExecute (IEntity actionOwner, IEntity actionUser, int playerId, SCR_BaseUseSupportStationAction action)
 
protected void OnSuccessfullyExecuted (IEntity actionOwner, IEntity actionUser, SCR_BaseUseSupportStationAction action)
 
protected void PlaySoundEffect (SCR_AudioSourceConfiguration audioConfig, notnull IEntity soundOwner, SCR_BaseUseSupportStationAction action)
 
protected void PlayCharacterVoiceEvent (IEntity character)
 
bool IsValid (IEntity actionOwner, IEntity actionUser, SCR_BaseUseSupportStationAction action, vector actionPosition, out ESupportStationReasonInvalid reasonInvalid, out int supplyCost)
 
ESupportStationType GetSupportStationType ()
 
ESupportStationPriority GetSupportStationPriority ()
 
void SetEnabled (bool enable)
 
protected void SetEnabledBroadcast (bool enable)
 
bool IsEnabled ()
 
ScriptInvoker GetOnEnabledChanged ()
 
protected bool IsMoving ()
 
protected bool IsUserValidFaction (IEntity user)
 
SCR_Faction GetFaction ()
 
protected int GetSupplyCostAction (IEntity actionOwner, IEntity actionUser, SCR_BaseUseSupportStationAction action)
 
int GetMaxAvailableSupplies ()
 
protected bool HasEnoughSupplies (IEntity actionOwner, IEntity actionUser, int supplyAmountToCheck)
 
protected bool OnConsumeSuppliesServer (int amount)
 
bool AreSuppliesEnabled ()
 
SCR_ResourceConsumer GetResourceConsumer ()
 
protected SCR_ResourceComponent GetResourceComponent ()
 
float GetRange ()
 
bool UsesRange ()
 
vector GetPosition ()
 
vector GetOffset ()
 
bool IgnoreSelf ()
 
LocalizedString GetOverrideUserActionName ()
 
protected void GetPlayerIdsInVehicle (IEntity vehicle, out notnull array< int > playerIds)
 
bool OverrideDamageState (EDamageState damageState, bool checkIfHasDamageSystem)
 
protected void OnHitZoneDamageStateChanged (SCR_HitZone defaultHitZone)
 Called when default hitZone damage state changed. Not called if entity has a damage manager. More...
 
protected void OnDamageStateChanged (EDamageState damageState)
 Called when damage manager (or default hitZone) damage state changes. More...
 
protected void AddRemoveOnDamageStateChanged (IEntity owner, bool subscribe)
 Grabs either damage manager or HitZoneContainer to subscribe to OnDamageStateChanged. More...
 
override bool RplSave (ScriptBitWriter writer)
 
override bool RplLoad (ScriptBitReader reader)
 
protected bool InitValidSetup ()
 
protected void TEMP_OnInteractorReplicated ()
 
override void EOnInit (IEntity owner)
 
protected void DelayedInit (IEntity owner)
 
override void OnPostInit (IEntity owner)
 Called on PostInit when all components are added. More...
 
override void OnDelete (IEntity owner)
 

Variables

protected bool m_bIsVehicle
 
protected bool m_bSendNotificationOnUse
 
protected bool m_bAllowGetFactionFromParent
 
protected ResourceName m_sOnUseSoundEffectFile
 
protected string m_sOnUseSoundEffectEventName
 
protected string m_sCharacterVoiceEventOnUse
 
protected int m_iCharacterVoicePriority
 
protected ref SCR_AudioSourceConfiguration m_OnUseAudioSourceConfiguration
 
protected float m_fRange
 
protected bool m_bIsEnabled
 
protected int m_iBaseSupplyCostOnUse
 
protected bool m_bIgnoreSelf
 
protected vector m_vOffset
 
protected ESupportStationFactionUsage m_eFactionUsageCheck
 
protected LocalizedString m_sOverrideUserActionName
 
protected SCR_ResourceConsumer m_ResourceConsumer
 
protected ref ScriptInvoker Event_OnEnabledChanged
 
protected Physics m_Physics
 
protected EDamageState m_eCurrentDamageState = EDamageState.UNDAMAGED
 
protected FactionAffiliationComponent m_FactionAffiliationComponent
 
protected SCR_ServicePointComponent m_ServicePointComponent
 
protected SCR_ResourceSystemSubscriptionHandleBase m_ResourceSubscriptionHandleConsumer
 

Enumeration Type Documentation

◆ ESupportStationFactionUsage

Enumerator
SAME_CURRENT_FACTION 

The user with the same faction as the current faction can interact with the support station.

FRIENDLY_CURRENT_FACTION 

The user with a faction that is a friendly faction as the current faction can interact with the support GetSupportStationType.

SAME_DEFAULT_FACTION 

The user with the same faction as the default faction of the support station 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 interact with the support station

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. Only valid if Default faction is not checked.

Definition at line 1290 of file SCR_BaseSupportStationComponent.c.

Function Documentation

◆ AddRemoveOnDamageStateChanged()

protected void AddRemoveOnDamageStateChanged ( IEntity  owner,
bool  subscribe 
)

Grabs either damage manager or HitZoneContainer to subscribe to OnDamageStateChanged.

Definition at line 862 of file SCR_BaseSupportStationComponent.c.

◆ AllowGetFactionFromParent()

bool Attribute::AllowGetFactionFromParent ( )

Check if prefab allows the faction affiliation component to be obtained from parent Used in init

Returns
If allowed to get from parent

Definition at line 45 of file SCR_BaseSupportStationComponent.c.

◆ AreSuppliesEnabled()

bool AreSuppliesEnabled ( )

Get if support station should check for supplies

Returns
true if should check for supplies

Definition at line 644 of file SCR_BaseSupportStationComponent.c.

◆ Attribute()

SCR_BaseSupportStationComponentClass ScriptComponentClass 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.  FromEnumESupportStationPriority,
category:"General Settings"   
)

◆ CanMoveWithPhysics()

bool Attribute::CanMoveWithPhysics ( )

If false then the object has no physics to move it self. If true it means 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

Returns
false if no physics can move it

Definition at line 36 of file SCR_BaseSupportStationComponent.c.

◆ DelayedInit()

protected void DelayedInit ( IEntity  owner)

Definition at line 958 of file SCR_BaseSupportStationComponent.c.

◆ FindEntityIds()

protected void FindEntityIds ( IEntity  owner,
IEntity  user,
out RplId  ownerId,
out RplId  userId,
out int  playerId 
)

Definition at line 148 of file SCR_BaseSupportStationComponent.c.

◆ GetCharacterVoiceSoundEventVariables()

void Attribute::GetCharacterVoiceSoundEventVariables ( out string  characterVoiceEventOnUse,
out int  characterVoicePriority 
)

Get the character voice varriables on support station use

Parameters
[out]characterVoiceEventOnUseVoice event to use
[out]characterVoicePrioritypriority of voice event

Definition at line 79 of file SCR_BaseSupportStationComponent.c.

◆ GetEntitiesFromID()

protected void GetEntitiesFromID ( RplId  ownerId,
RplId  userId,
out IEntity  owner,
out IEntity  user 
)

Definition at line 171 of file SCR_BaseSupportStationComponent.c.

◆ GetFaction()

SCR_Faction GetFaction ( )

Get current faction of Support Station (Or if allowed get default faction)

Returns
Faction of Support Station. Returns null if no faction is assigned

Definition at line 549 of file SCR_BaseSupportStationComponent.c.

◆ GetMaxAvailableSupplies()

int GetMaxAvailableSupplies ( )

Scan for the max available supplies that can be used for the action

Returns

Definition at line 579 of file SCR_BaseSupportStationComponent.c.

◆ GetOffset()

vector GetOffset ( )
Returns
returns the offset of the position

Definition at line 698 of file SCR_BaseSupportStationComponent.c.

◆ GetOnEnabledChanged()

ScriptInvoker GetOnEnabledChanged ( )

Get scriptinvoker when support station is enabled changes. Sends over bool with enabled state

Returns
script invoker

Definition at line 458 of file SCR_BaseSupportStationComponent.c.

◆ GetOnUseAudioConfig()

protected SCR_AudioSourceConfiguration GetOnUseAudioConfig ( )

Get Audio config to play Will create it if it not yet exists. Returns null if no SoundFile or SoundEvent is set

Returns
Sound Config

Definition at line 54 of file SCR_BaseSupportStationComponent.c.

◆ GetOverrideUserActionName()

LocalizedString GetOverrideUserActionName ( )
Returns
Get Override UserAction string that is used when the action is displayed to the player

Definition at line 715 of file SCR_BaseSupportStationComponent.c.

◆ GetPlayerIdsInVehicle()

protected void GetPlayerIdsInVehicle ( IEntity  vehicle,
out notnull array< int playerIds 
)

Definition at line 743 of file SCR_BaseSupportStationComponent.c.

◆ GetPosition()

vector GetPosition ( )

Get the center of the Support station that is used with range + offset

Returns
Returns center + offset

Definition at line 690 of file SCR_BaseSupportStationComponent.c.

◆ GetRange()

float GetRange ( )

Returns range. If range is disabled it will be -1

Returns
Range power of 2 for cheap distance calc

Definition at line 672 of file SCR_BaseSupportStationComponent.c.

◆ GetResourceComponent()

protected SCR_ResourceComponent GetResourceComponent ( )

Definition at line 659 of file SCR_BaseSupportStationComponent.c.

◆ GetResourceConsumer()

SCR_ResourceConsumer GetResourceConsumer ( )
Returns
Resource Consumer if entity has any

Definition at line 653 of file SCR_BaseSupportStationComponent.c.

◆ GetSendNotificationOnUse()

return classData &&classData GetSendNotificationOnUse ( )
Initial value:

Get if notification should be shown on Action executed

Returns
True if should show notification

Definition at line 28 of file SCR_BaseSupportStationComponent.c.

◆ GetSupplyCostAction()

protected int GetSupplyCostAction ( IEntity  actionOwner,
IEntity  actionUser,
SCR_BaseUseSupportStationAction  action 
)

Get the minimum amount of supplies needed for the action. This is the amount of supplies needed to pass the IsValid check when using supplies and when executed The method is generally overwritten in inherited support stations

Definition at line 571 of file SCR_BaseSupportStationComponent.c.

◆ GetSupportStationPriority()

ESupportStationPriority GetSupportStationPriority ( )

Get Support station priority.

Returns
priority of support station

Definition at line 405 of file SCR_BaseSupportStationComponent.c.

◆ GetSupportStationType()

ESupportStationType GetSupportStationType ( )

Get Support station type.

Returns
type of support station

Definition at line 395 of file SCR_BaseSupportStationComponent.c.

◆ HasEnoughSupplies()

protected bool HasEnoughSupplies ( IEntity  actionOwner,
IEntity  actionUser,
int  supplyAmountToCheck 
)

Definition at line 603 of file SCR_BaseSupportStationComponent.c.

◆ IgnoreSelf()

bool IgnoreSelf ( )

If true and the action uses range it will never check itself. If false it will check itself though use the standard priority for it

Returns
True if it ignores self if it uses range

Definition at line 708 of file SCR_BaseSupportStationComponent.c.

◆ InitValidSetup()

protected bool InitValidSetup ( )

Definition at line 930 of file SCR_BaseSupportStationComponent.c.

◆ IsMoving()

protected bool IsMoving ( )

Definition at line 468 of file SCR_BaseSupportStationComponent.c.

◆ IsUserValidFaction()

protected bool IsUserValidFaction ( IEntity  user)

Definition at line 479 of file SCR_BaseSupportStationComponent.c.

◆ IsValid()

bool IsValid ( IEntity  actionOwner,
IEntity  actionUser,
SCR_BaseUseSupportStationAction  action,
vector  actionPosition,
out ESupportStationReasonInvalid  reasonInvalid,
out int  supplyCost 
)

Executed when action has been executed. Here you can execute things such as removing supplies/fuel from the entity

Parameters
[in]actionOwnerentity on which the ActionManager is
[in]actionUserEntity that started the interaction
[in]action
[in]actionPosition
[out]reasonInvalidReason why action is invalid
[out]supplyCostcost when using the support station
Returns

Definition at line 306 of file SCR_BaseSupportStationComponent.c.

◆ OnConsumeSuppliesServer()

protected bool OnConsumeSuppliesServer ( int  amount)

Action is executed and supplies are used (Server Only)

Parameters
[in]amount
Returns
true if there were enough supplies and they are removed

Definition at line 630 of file SCR_BaseSupportStationComponent.c.

◆ OnDamageStateChanged()

protected void OnDamageStateChanged ( EDamageState  damageState)

Called when damage manager (or default hitZone) damage state changes.

Definition at line 826 of file SCR_BaseSupportStationComponent.c.

◆ OnExecute()

protected void OnExecute ( IEntity  actionOwner,
IEntity  actionUser,
int  playerId,
SCR_BaseUseSupportStationAction  action 
)

Called by OnExecuteBroadcast and is executed both on server and on client playerId can be -1 if the user was not a player

Definition at line 206 of file SCR_BaseSupportStationComponent.c.

◆ OnExecuteBroadcast()

protected void OnExecuteBroadcast ( RplId  ownerId,
RplId  userId,
int  userPlayerId,
int  actionId 
)

Definition at line 185 of file SCR_BaseSupportStationComponent.c.

◆ OnExecutedServer()

void OnExecutedServer ( notnull IEntity  actionOwner,
notnull IEntity  actionUser,
notnull SCR_BaseUseSupportStationAction  action 
)

Executed the support Station effect (Server only). Here you can execute things such as removing supplies/fuel from the entity

Parameters
[in]actionOwnerentity that is the owner of the ActionManager which initiated the action
[in]actionUserEntity that started the interaction to use the support station
[in]action

Definition at line 134 of file SCR_BaseSupportStationComponent.c.

◆ OnHitZoneDamageStateChanged()

protected void OnHitZoneDamageStateChanged ( SCR_HitZone  defaultHitZone)

Called when default hitZone damage state changed. Not called if entity has a damage manager.

Definition at line 818 of file SCR_BaseSupportStationComponent.c.

◆ OnSuccessfullyExecuted()

protected void OnSuccessfullyExecuted ( IEntity  actionOwner,
IEntity  actionUser,
SCR_BaseUseSupportStationAction  action 
)

Definition at line 214 of file SCR_BaseSupportStationComponent.c.

◆ OverrideDamageState()

bool OverrideDamageState ( EDamageState  damageState,
bool  checkIfHasDamageSystem 
)

Allows devs to functionally destroy the Support station (or other state) without the need of a DamageManager. If a damage system exists on the entity then it is adviced to let it handle the logic.

Parameters
[in]damageStateState to set
[in]checkIfHasDamageSystemIf true it will check if any damage system is present and if so will not over the state. If false it will simply override it
Returns
True if damage state was succesfully overridden

Definition at line 788 of file SCR_BaseSupportStationComponent.c.

◆ PlayCharacterVoiceEvent()

protected void PlayCharacterVoiceEvent ( IEntity  character)

Definition at line 269 of file SCR_BaseSupportStationComponent.c.

◆ PlaySoundEffect()

protected void PlaySoundEffect ( SCR_AudioSourceConfiguration  audioConfig,
notnull IEntity  soundOwner,
SCR_BaseUseSupportStationAction  action 
)

Definition at line 222 of file SCR_BaseSupportStationComponent.c.

◆ RplLoad()

override bool RplLoad ( ScriptBitReader  reader)

Definition at line 916 of file SCR_BaseSupportStationComponent.c.

◆ RplSave()

override bool RplSave ( ScriptBitWriter  writer)

Definition at line 908 of file SCR_BaseSupportStationComponent.c.

◆ SetEnabled()

void SetEnabled ( bool  enable)

Set support station enabled. If disabled it will not allow players to use it (Server only)

Parameters
[in]enabletrue is enabled

Definition at line 415 of file SCR_BaseSupportStationComponent.c.

◆ SetEnabledBroadcast()

protected void SetEnabledBroadcast ( bool  enable)

Definition at line 426 of file SCR_BaseSupportStationComponent.c.

◆ TEMP_OnInteractorReplicated()

protected void TEMP_OnInteractorReplicated ( )

Definition at line 943 of file SCR_BaseSupportStationComponent.c.

◆ UsesRange()

bool UsesRange ( )

If true then the action will use range, if false it will not use range and only execute if the action and the action manager is on the entity itself

Returns
True if using range

Definition at line 681 of file SCR_BaseSupportStationComponent.c.

Variable Documentation

◆ Event_OnEnabledChanged

protected ref ScriptInvoker Event_OnEnabledChanged

Definition at line 117 of file SCR_BaseSupportStationComponent.c.

◆ m_bAllowGetFactionFromParent

protected bool m_bAllowGetFactionFromParent

Definition at line 9 of file SCR_BaseSupportStationComponent.c.

◆ m_bIgnoreSelf

protected bool m_bIgnoreSelf

Definition at line 103 of file SCR_BaseSupportStationComponent.c.

◆ m_bIsEnabled

protected bool m_bIsEnabled

Definition at line 97 of file SCR_BaseSupportStationComponent.c.

◆ m_bIsVehicle

protected bool m_bIsVehicle

Definition at line 3 of file SCR_BaseSupportStationComponent.c.

◆ m_bSendNotificationOnUse

protected bool m_bSendNotificationOnUse

Definition at line 6 of file SCR_BaseSupportStationComponent.c.

◆ m_eCurrentDamageState

protected EDamageState m_eCurrentDamageState = EDamageState.UNDAMAGED

Definition at line 121 of file SCR_BaseSupportStationComponent.c.

◆ m_eFactionUsageCheck

protected ESupportStationFactionUsage m_eFactionUsageCheck

Definition at line 109 of file SCR_BaseSupportStationComponent.c.

◆ m_FactionAffiliationComponent

protected FactionAffiliationComponent m_FactionAffiliationComponent

Definition at line 122 of file SCR_BaseSupportStationComponent.c.

◆ m_fRange

protected float m_fRange

Definition at line 94 of file SCR_BaseSupportStationComponent.c.

◆ m_iBaseSupplyCostOnUse

protected int m_iBaseSupplyCostOnUse

Definition at line 100 of file SCR_BaseSupportStationComponent.c.

◆ m_iCharacterVoicePriority

protected int m_iCharacterVoicePriority

Definition at line 21 of file SCR_BaseSupportStationComponent.c.

◆ m_OnUseAudioSourceConfiguration

protected ref SCR_AudioSourceConfiguration m_OnUseAudioSourceConfiguration

Definition at line 23 of file SCR_BaseSupportStationComponent.c.

◆ m_Physics

protected Physics m_Physics

Definition at line 120 of file SCR_BaseSupportStationComponent.c.

◆ m_ResourceConsumer

protected SCR_ResourceConsumer m_ResourceConsumer

Definition at line 114 of file SCR_BaseSupportStationComponent.c.

◆ m_ResourceSubscriptionHandleConsumer

protected SCR_ResourceSystemSubscriptionHandleBase m_ResourceSubscriptionHandleConsumer

Definition at line 125 of file SCR_BaseSupportStationComponent.c.

◆ m_sCharacterVoiceEventOnUse

protected string m_sCharacterVoiceEventOnUse

Definition at line 18 of file SCR_BaseSupportStationComponent.c.

◆ m_ServicePointComponent

protected SCR_ServicePointComponent m_ServicePointComponent

Definition at line 123 of file SCR_BaseSupportStationComponent.c.

◆ m_sOnUseSoundEffectEventName

protected string m_sOnUseSoundEffectEventName

Definition at line 15 of file SCR_BaseSupportStationComponent.c.

◆ m_sOnUseSoundEffectFile

protected ResourceName m_sOnUseSoundEffectFile

Definition at line 12 of file SCR_BaseSupportStationComponent.c.

◆ m_sOverrideUserActionName

protected LocalizedString m_sOverrideUserActionName

Definition at line 112 of file SCR_BaseSupportStationComponent.c.

◆ m_vOffset

protected vector m_vOffset

Definition at line 106 of file SCR_BaseSupportStationComponent.c.

SCR_BaseSupportStationComponentClass
Definition: SCR_BaseSupportStationComponent.c:2
GetOwner
IEntity GetOwner()
Owner entity of the fuel tank.
Definition: SCR_FuelNode.c:128