3 [
Attribute(
"#AR-SupportStation_ActionInvalid_NotInRange",
desc:
"No support stations of type in range", uiwidget:
UIWidgets.LocaleEditBox)]
6 [
Attribute(
"#AR-SupportStation_ActionInvalid_Destroyed",
desc:
"Support station in range but the only one is destroyed", uiwidget:
UIWidgets.LocaleEditBox)]
9 [
Attribute(
"#AR-SupportStation_ActionInvalid_HostileFaction",
desc:
"There are support stations in range but user is an invalid faction (Generally means faction is hostile)", uiwidget:
UIWidgets.LocaleEditBox)]
12 [
Attribute(
"#AR-SupportStation_ActionInvalid_Supplies",
desc:
"There are support stations in range but non of them have enough supplies", uiwidget:
UIWidgets.LocaleEditBox)]
15 [
Attribute(
"#AR-SupportStation_ActionInvalid_NoSupplyStorage",
desc:
"There are support stations in range but it cannot execute the action as the supply storages are all full", uiwidget:
UIWidgets.LocaleEditBox)]
18 [
Attribute(
"#AR-SupportStation_ActionInvalid_IsMoving",
desc:
"There are support stations in range but all of them are moving", uiwidget:
UIWidgets.LocaleEditBox)]
21 [
Attribute(
"#AR-SupportStation_ActionInvalid_Disabled",
desc:
"There are support stations use range and are in range but all of them are disabled (by the game master)", uiwidget:
UIWidgets.LocaleEditBox)]
24 [
Attribute(
"1",
desc:
"Show supplies in action if there is a supply cost")]
27 [
Attribute(
"0",
desc:
"If true will check if support station component can be found on children. Only enable if support station is on Vehicle part and support station does not have range")]
30 [
Attribute(
"-1",
desc:
"What animation the player should play if using the support station with a gadget. Leave -1 to not play any animation")]
33 [
Attribute(
"1",
desc:
"If an animation is assigned, does the animation loop?")]
36 [
Attribute(
"0",
desc:
"If an animation is assigned, does the animation play while the character is in a vehicle?")]
71 Print(
"Do not use 'SCR_BaseUseSupportStationAction' as action, inherit from it and override ' SupportStationActionType' function to the correct type!",
LogLevel.ERROR);
79 SCR_BaseSupportStationComponent supportStationComponent;
86 if (supportStationComponent)
89 if (supportStationComponent.IsValid(actionOwner, actionUser,
this, actionWorldPosition, reasonInvalid,
m_iSuppliesOnUse))
90 return supportStationComponent;
113 if (supportStationManager)
117 if (supportStationComponent)
118 return supportStationComponent;
128 if (supportStationComponent)
131 if (supportStationComponent.IsValid(actionOwner, actionUser,
this, actionWorldPosition, reasonInvalid,
m_iSuppliesOnUse))
132 return supportStationComponent;
142 if (supportStationComponent)
153 if (!
GetOwner() || !super.CanBeShownScript(user))
161 SCR_BaseSupportStationComponent supportStationComponent = SCR_BaseSupportStationComponent.Cast(
GetOwner().FindComponent(SCR_BaseSupportStationComponent));
162 if (supportStationComponent && !supportStationComponent.UsesRange() && !supportStationComponent.IsEnabled())
177 SCR_DamageManagerComponent damageComponent = SCR_DamageManagerComponent.Cast(
GetOwner().FindComponent(SCR_DamageManagerComponent));
179 return damageComponent.GetState() !=
EDamageState.DESTROYED;
183 if (hitZoneContainer)
185 HitZone defaultHitZone = hitZoneContainer.GetDefaultHitZone();
186 return defaultHitZone.GetDamageState() !=
EDamageState.DESTROYED;
251 if (reasonInvalid >= 0)
382 super.Init(pOwnerEntity, pManagerComponent);
394 Print(
"'SCR_BaseUseSupportStationAction' Support Station action type: '" +
typename.EnumToString(
ESupportStationType,
GetSupportStationType()) +
"' has PerformPerFrame true but the duraction is greater than 0. Set it to less that 0, eg: 1 sec == -1",
LogLevel.ERROR);
482 super.OnActionStart(pUserEntity);
514 return chimeraCharacter && chimeraCharacter.IsInVehicle();
520 super.OnActionCanceled(pUserEntity);
541 super.OnActionSelected();
550 super.OnActionSelected();
558 if (outName.IsEmpty())
563 if (outName.IsEmpty())
567 outName = uiInfo.GetName();
575 float actionPercentage =
int.MIN;
577 if (actionParam.IsEmpty())
581 if (actionPercentage !=
int.MIN)
585 if (!actionParam.IsEmpty())
587 if (actionPercentage !=
int.MIN)
615 return !outName.IsEmpty();
ESupportStationReasonInvalid
ArmaReforgerScripted GetGame()
SCR_BaseGameMode GetGameMode()
SCR_EComponentFinderQueryFlags
Used for component finding to know where it can search to get the given component.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external bool ShouldPerformPerFrame()
Should this action be performed every frame the input action is triggered?
proto external float GetActionDuration()
Returns the duration of this action in seconds.
proto external IEntity GetOwner()
Returns the parent entity of this action.
proto external UIInfo GetUIInfo()
Returns the UIInfo set for this user action or null if none.
string m_sCannotPerformReason
LocalizedString m_sInvalidFactionActionReason
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
override void PerformContinuousAction(IEntity pOwnerEntity, IEntity pUserEntity, float timeSlice)
LocalizedString GetInvalidPerformReasonString(ESupportStationReasonInvalid reasonInvalid)
const LocalizedString INVALID_TARGET_VEHICLE_SPEED
float m_fLastCheckedCanPerform
int m_iGadgetAnimationCommand
LocalizedString m_sInvalidMovingActionReason
const LocalizedString ACTION_PERCENTAGE_FORMATTING
const int DELAY_CAN_PERFORM
bool RequiresGadget()
If true will only show the action if the player is holding the correct support station gadget.
bool m_bAnimateGadgetInVehicle
LocalizedString m_sInvalidRangeActionReason
LocalizedString m_sInvalidDisabledActionReason
void ~SCR_BaseUseSupportStationAction()
SCR_BaseSupportStationComponent m_ActionOwnerSupportStationComponent
int GetSupportStationSuppliesOnUse()
string GetActionStringParam()
bool m_bOnActionAnimationInDone
void CanBePerformedUpdate(IEntity user)
bool m_bDoesGadgetAnimationLoop
override bool CanBeShownScript(IEntity user)
override void OnActionCanceled(IEntity pOwnerEntity, IEntity pUserEntity)
bool m_bAllowCheckChildrenSupportStation
override bool CanBroadcastScript()
const float MAXIMUM_VEHICLE_SPEED_FOR_INTERACTION_SQ
const LocalizedString ACTION_WITH_SUPPLYGAIN_FORMATTING
SCR_BaseSupportStationComponent GetClosestValidSupportStation(IEntity actionOwner, IEntity actionUser, out ESupportStationReasonInvalid reasonInvalid=0)
override void OnActionDeselected()
SCR_BaseSupportStationComponent m_SupportStationComponent
override bool CanBePerformedScript(IEntity user)
SCR_SupportStationGadgetComponent m_SupportStationGadget
override void OnActionSelected()
const LocalizedString ACTION_WITH_PARAM_FORMATTING
const LocalizedString ACTION_WITH_SUPPLYCOST_FORMATTING
override void OnActionStart(IEntity pUserEntity)
LocalizedString m_sInvalidDestroyedActionReason
override bool GetActionNameScript(out string outName)
float GetActionPercentage()
If not -1 it will show the percentage on the current action.
void SetCanPerform(bool canPerform, ESupportStationReasonInvalid reasonInvalid)
bool IsUserInVehicle(notnull IEntity user)
ESupportStationReasonInvalid m_eCannotPerformReason
bool CanHaveMultipleUsers()
int GetActionDecimalCount()
bool PrioritizeHeldGadget()
If true will always take support station from held gadget and skip any other checks if a held support...
bool AllowGetSupportStationFromGadget()
If true it allows getting the support station from gadgets.
void ResetReferencesOnServer()
bool m_bSupportStationWasNull
LocalizedString m_sInvalidSuppliesActionReason
IEntity GetCurrentActionUser()
Get which entity is currently activly using the action.
LocalizedString m_sInvalidNoSupplyStorageSpaceActionReason
void DelayedInit(IEntity owner)
bool m_bShowSupplyCostOnAction
override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
bool CanPerform(out ESupportStationReasonInvalid cannotPerformReason)
ESupportStationType GetSupportStationType()
static IEntity GetLocalControlledEntity()
A scripted action class having optional logic to check if vehicle is valid.
bool LoopActionUpdate(float timeSlice)
vector GetWorldPositionAction()
SCR_BaseSupportStationComponent GetClosestValidSupportStation(ESupportStationType type, notnull IEntity actionUser, notnull IEntity actionOwner, SCR_BaseUseSupportStationAction action, vector actionPosition, out ESupportStationReasonInvalid reasonInvalid, out int supplyCost)
static SCR_SupportStationManagerComponent GetInstance()
UIInfo - allows to define UI elements.
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