6class SCR_SupportStationGadgetComponent : SCR_GadgetComponent
9 protected ref array<ESupportStationType> m_aSupportStationTypes;
11 [
Attribute(
"1",
desc:
"If true then the animation target will be the gadget Offset in world position",
category:
"Support Gadget")]
21 types.Copy(m_aSupportStationTypes);
31 return m_aSupportStationTypes.Contains(
type);
40 if (!chimeraCharacter)
43 CharacterControllerComponent charController = chimeraCharacter.GetCharacterController();
48 if (!animationComponent)
52 return commandHandlerComponent && commandHandlerComponent.IsItemActionLoopTag();
62 if (animationCommand < 0)
77 if (animationCommand < 0)
81 if (!chimeraCharacter)
84 CharacterControllerComponent charController = chimeraCharacter.GetCharacterController();
89 if (!animationComponent)
93 if (commandHandlerComponent)
94 commandHandlerComponent.FinishItemUse(
true);
101 if (!chimeraCharacter)
104 CharacterControllerComponent charController = chimeraCharacter.GetCharacterController();
109 if (!animationComponent)
115 if (animationTarget !=
vector.Zero)
118 character.GetWorldTransform(charWorldMat);
119 charWorldMat[3] = animationTarget;
121 ptWS.Set(null,
"", charWorldMat);
124 int itemActionId = animationComponent.BindCommand(
"CMD_Item_Action");
128 params.SetAllowMovementDuringAction(
false);
129 params.SetKeepInHandAfterSuccess(
true);
130 params.SetCommandID(itemActionId);
131 params.SetCommandIntArg(animationCMD);
132 params.SetCommandFloatArg(2.0);
133 params.SetAlignmentPoint(ptWS);
135 charController.TryUseItemOverrideParams(
params);
144 SCR_BaseSupportStationComponent supportStation;
147 return supportStation;
155 static SCR_BaseSupportStationComponent GetHeldSupportStation(
ESupportStationType supportStationType, notnull
IEntity character)
157 SCR_SupportStationGadgetComponent gadgetComponent = GetHeldSupportStationGadget(supportStationType, character);
158 if (!gadgetComponent)
161 return gadgetComponent.GetSupportStation(supportStationType);
169 static SCR_SupportStationGadgetComponent GetHeldSupportStationGadget(
ESupportStationType supportStationType, notnull
IEntity character)
171 SCR_GadgetManagerComponent gadgetManager = SCR_GadgetManagerComponent.GetGadgetManager(character);
175 SCR_SupportStationGadgetComponent gadgetComponent = SCR_SupportStationGadgetComponent.Cast(gadgetManager.
GetHeldGadgetComponent());
176 if (!gadgetComponent)
179 if (!gadgetComponent.IsGadgetOfSupportStationType(supportStationType))
182 return gadgetComponent;
192 static bool GetHeldSupportStationAndGadget(
ESupportStationType supportStationType, notnull
IEntity character, out SCR_BaseSupportStationComponent supportStation, out SCR_SupportStationGadgetComponent supportStationGadget)
194 SCR_GadgetManagerComponent gadgetManager = SCR_GadgetManagerComponent.
GetGadgetManager(character);
199 if (!supportStationGadget)
202 if (!supportStationGadget.IsGadgetOfSupportStationType(supportStationType))
205 supportStation = supportStationGadget.GetSupportStation(supportStationType);
206 return supportStation;
214 array<Managed> supportStations = {};
218 SCR_BaseSupportStationComponent supportStation;
219 foreach (Managed supportStationManaged : supportStations)
221 supportStation = SCR_BaseSupportStationComponent.Cast(supportStationManaged);
227 Print(
"Support Station Gadget has two or more support stations of type: '" +
typename.EnumToString(
ESupportStationType, supportStation.GetSupportStationType()) +
"' it can only have one of the same type!",
LogLevel.WARNING);
238 return EGadgetType.SPECIALIST_ITEM;
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
SCR_BaseSupportStationComponent GetSupportStation(IEntity owner)
ref map< ESupportStationType, SCR_BaseSupportStationComponent > m_mSupportStations
bool InUseAnimationLoop(IEntity character)
bool IsGadgetOfSupportStationType(ESupportStationType type)
void StopGadgetAnimation(notnull IEntity character, int animationCommand)
int GetSupportStationTypes(out notnull array< ESupportStationType > types)
void StartGadgetAnimation(notnull IEntity character, int animationCommand, notnull SCR_ScriptedUserAction action)
void AnimateCharacterWithGadget(notnull IEntity character, int animationCMD, vector animationTarget=vector.Zero)
bool m_bUseActionAsAnimationTarget
enum EVehicleType IEntity
proto external GenericComponent FindComponent(typename typeName)
proto external int FindComponents(typename typeName, notnull array< Managed > outComponents)
PointInfo - allows to define position.
static SCR_GadgetManagerComponent GetGadgetManager(IEntity entity)
override void EOnInit(IEntity owner)
SCR_GadgetComponent GetHeldGadgetComponent()
A scripted action class having optional logic to check if vehicle is valid.
IEntity GetOwner()
Owner entity of the fuel tank.
override void EOnInit(IEntity owner)
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