37 [
Attribute(defvalue:
"10", uiwidget:
UIWidgets.EditBox,
params:
"1 inf 0.1",
desc:
"Maximum duration it takes for character to drown\n[s]")]
40 [
Attribute(defvalue:
"4", uiwidget:
UIWidgets.EditBox,
params:
"0 inf 0.1",
desc:
"Amount of raw damage needed for character to play an animated hitreaction")]
91 private static bool s_bDiagRegistered;
92 private static bool m_bEnableDebugUI;
93 private Widget m_wDebugRootWidget;
113 if (!character || character.IsInVehicleADS())
132 AIControlComponent aiControl = AIControlComponent.Cast(
GetOwner().FindComponent(AIControlComponent));
133 if (!aiControl || !aiControl.IsAIActivated())
138 if (wpnMan && wpnMan.GetCurrentWeapon())
139 currentWeapon = wpnMan.GetCurrentWeapon().GetOwner();
143 bool dropGrenade =
false;
145 SCR_CharacterCommandHandlerComponent handler = SCR_CharacterCommandHandlerComponent.Cast(
GetAnimationComponent().GetCommandHandler());
147 EWeaponType wt = wpnMan.GetCurrentWeapon().GetWeaponType();
152 if ((triggerComp && triggerComp.WasTriggered()) || (handler && handler.IsThrowingAction()))
159 handler.DropLiveGrenadeFromHand(
false);
275 if (!characterInventory)
278 characterInventory.
UseItem(gadget);
285 m_OnAnimationEvent.Invoke(animEventType, animUserString, intParam, timeFromStart, timeToEnd,
this);
335 garbageSystem.Insert(character);
348 if (!vehicleFactionAff)
363 SCR_InventoryStorageManagerComponent inventoryManager = SCR_InventoryStorageManagerComponent.Cast(
GetOwner().FindComponent(SCR_InventoryStorageManagerComponent));
364 if (!inventoryManager)
367 BaseInventoryStorageComponent storage = inventoryManager.FindStorageForItem(gadget,
EStoragePurpose.PURPOSE_DEPOSIT);
368 if (storage && inventoryManager.TryMoveItemToStorage(gadget, storage))
371 SCR_NotificationsComponent.SendLocal(
ENotification.PLAYER_HAND_ITEM_PUT_IN_INVENTORY);
377 SCR_NotificationsComponent.SendLocal(
ENotification.PLAYER_HAND_ITEM_DROPPED);
386 SCR_HandSlotStorageComponent handSlot = SCR_HandSlotStorageComponent.Cast(
GetOwner().FindComponent(SCR_HandSlotStorageComponent));
394 return slot.GetAttachedEntity();
428 if (shellPrefab != savedConfig.GetPrefabData())
454 if (!replicationId.IsValid())
465 RplComponent rplComp = RplComponent.Cast(
Replication.FindItem(replicationId));
469 SCR_MortarShellGadgetComponent shellComp = SCR_MortarShellGadgetComponent.Cast(rplComp.GetEntity().FindComponent(SCR_MortarShellGadgetComponent));
473 shellComp.SetChargeRingConfig(configId,
true,
false);
482 if (!sightId.IsValid())
492 RplComponent rplComp = RplComponent.Cast(
Replication.FindItem(sightId));
496 IEntity owner = rplComp.GetEntity();
500 SCR_HelicopterCollimatorSightComponent collimator = SCR_HelicopterCollimatorSightComponent.Cast(owner.
FindComponent(SCR_HelicopterCollimatorSightComponent));
504 collimator.OwnerSyncSightState(newState);
533 SCR_CharacterCommandHandlerComponent handler = SCR_CharacterCommandHandlerComponent.Cast(
GetAnimationComponent().GetCommandHandler());
556 m_CameraHandler = SCR_CharacterCameraHandlerComponent.Cast(character.FindComponent(SCR_CharacterCameraHandlerComponent));
568 SCR_CharacterCommandHandlerComponent handler = SCR_CharacterCommandHandlerComponent.Cast(
GetAnimationComponent().GetCommandHandler());
569 if (!handler.IsLoitering())
591 CompartmentAccessComponent accesComp =
char.GetCompartmentAccessComponent();
592 bool isInWatertightCompartment = accesComp && accesComp.GetCompartment() && accesComp.GetCompartment().GetIsWaterTight();
594 const float drowningTimeStartFX = 4;
595 if (waterLevel[2] > 0 && !isInWatertightCompartment)
635 damageMan.HandleDamage(context);
670 SCR_CharacterCommandHandlerComponent handler = SCR_CharacterCommandHandlerComponent.Cast(
GetAnimationComponent().GetCommandHandler());
679 if (isAligningBeforeLoiter || isHolsteringBeforeLoiter)
683 return handler.IsLoitering();
689 SCR_CharacterCommandHandlerComponent handler = SCR_CharacterCommandHandlerComponent.Cast(
GetAnimationComponent().GetCommandHandler());
693 if (handler.IsLoitering())
704 if (headingComponent)
706 headingComponent.ResetAligning();
730 if (bIsLocalCharacter && diagTransform)
732 DbgUI.Begin(
"Character Transformation");
733 const string CHAR_POS =
"X:\t%1\nY:\t%2\nZ:\t%3";
734 const string CHAR_ROT =
"PITCH:\t%1\nYAW:\t%2\nROLL:\t%3";
735 const string CHAR_SCALE =
"%1";
736 const string CHAR_AIM =
"X:\t%1\nY:\t%2\nZ:\t%3";
737 vector pos = character.GetOrigin();
738 vector rot = character.GetYawPitchRoll();
739 float scale = character.GetScale();
743 string strScale =
string.Format(CHAR_SCALE,
scale.ToString());
745 DbgUI.Text(
"POSITION:\n" + strPosition);
746 DbgUI.Text(
"ROTATION:\n" + strRotation);
747 DbgUI.Text(
"SCALE:" + strScale);
748 DbgUI.Text(
"AIMING ANGLES:\n" + strAiming);
750 if (
DbgUI.Button(
"Print plaintext to console"))
751 Print(
"TransformInfo:\nPOSITION:\n" + strPosition +
"\nROTATION:\n" + strRotation +
"\nSCALE:" + strScale +
"\nAIMING ANGLES:\n" + strAiming,
LogLevel.NORMAL);
757 m_bEnableDebugUI = bIsLocalCharacter && DiagMenu.GetBool(
SCR_DebugMenuID.DEBUGUI_CHARACTER_MENU);
758 if (m_bEnableDebugUI && !m_wDebugRootWidget)
760 else if (!m_bEnableDebugUI && m_wDebugRootWidget)
763 if (m_bEnableDebugUI)
768 private void ReloadDebugUI()
770 if (m_wDebugRootWidget)
777 private void DeleteDebugUI()
779 m_wDebugRootWidget.RemoveFromHierarchy();
780 m_wDebugRootWidget = null;
784 private void UpdateInputCircles()
786 if (!m_wDebugRootWidget)
793 Widget wInput = m_wDebugRootWidget.FindAnyWidget(
"Input");
797 WorkspaceWidget workspaceWidget =
GetGame().GetWorkspace();
799 float topSpeed = animComponent.GetTopSpeed(-1,
false);
801 TextWidget wMaxSpeed = TextWidget.Cast(wInput.FindAnyWidget(
"MaxSpeed"));
804 float speed = Math.Ceil(topSpeed * 10) * 0.1;
805 wMaxSpeed.SetText(speed.ToString() +
"m/s");
808 float ringSize = FrameSlot.GetSizeX(wInput);
809 float degSizeDivider = topSpeed * ringSize;
810 if (degSizeDivider > 0)
811 for (
int spd = 0; spd < 3; spd++)
825 color =
ARGB(255, 150, 255, 150);
828 color =
ARGB(255, 200, 200, 150);
831 color =
ARGB(255, 255, 150, 150);
833 for (
int deg = 0; deg < 360; deg++)
836 float inputForward = velInput[2];
837 float inputRight = velInput[0];
839 float degSize = animComponent.GetMaxSpeed(inputForward, inputRight, spdType) / degSizeDivider;
843 float degOff = (ringSize - degSize) * 0.5;
845 string iRingname =
"iRing_" + spd.ToString() +
"_" + deg.ToString();
847 ImageWidget wImg = ImageWidget.Cast(wInput.FindAnyWidget(iRingname));
851 wImg.LoadImageTexture(0,
"{90DF4F065D08EF4E}UI/Textures/HUD_obsolete/character/input_360ringslice.edds");
852 wImg.SetRotation(deg);
853 wImg.SetName(iRingname);
856 FrameSlot.SetAnchorMax(wImg, 0, 0);
857 FrameSlot.SetAnchorMin(wImg, 0, 0);
858 FrameSlot.SetSize(wImg, degSize, degSize);
859 FrameSlot.SetPos(wImg, degOff, degOff);
865 private void CreateDebugUI()
867 m_wDebugRootWidget =
GetGame().GetWorkspace().CreateWidgets(
"{C70DA11469BBAF67}UI/layouts/Debug/HUD_Debug_Character.layout", null);
868 UpdateInputCircles();
872 private void UpdateDebugBoolWidget(
string textWidgetName,
bool isTrue,
float time = 0)
874 TextWidget wTxt = TextWidget.Cast(m_wDebugRootWidget.FindAnyWidget(textWidgetName));
878 time = Math.Ceil(time * 10) * 0.1;
881 wTxt.SetColorInt(
ARGB(255, 160, 210, 255));
883 wTxt.SetText(
"YES (" + time.ToString() +
")");
889 wTxt.SetColorInt(
ARGB(255, 255, 160, 160));
891 wTxt.SetText(
"NO (" + time.ToString() +
")");
898 private void UpdateDebugUI()
906 UpdateInputCircles();
911 topSpeed = animComponent.GetTopSpeed(-1,
false);
913 Widget wCenter = m_wDebugRootWidget.FindAnyWidget(
"Center");
914 Widget wCenter2 = m_wDebugRootWidget.FindAnyWidget(
"Center2");
915 Widget wCenter3 = m_wDebugRootWidget.FindAnyWidget(
"Center3");
918 if (movementInput != vector.Zero)
920 float inputLength = movementInput.Length();
922 movementInput *= 1 / inputLength;
925 if (wCenter && wCenter2 && wCenter3 && topSpeed > 0)
927 float inputForward = movementInput[0];
928 float inputRight = movementInput[2];
930 float moveScale = maxSpeed / topSpeed;
931 float x = movementInput[0] * moveScale * 0.5 + 0.5;
932 float y = -movementInput[2] * moveScale * 0.5 + 0.5;
933 FrameSlot.SetAnchorMin(wCenter, x, y);
934 FrameSlot.SetAnchorMax(wCenter, x, y);
936 vector moveLocal = animComponent.GetInertiaSpeed();
937 x = (moveLocal[0] / topSpeed) * 0.5 + 0.5;
938 y = (-moveLocal[2] / topSpeed) * 0.5 + 0.5;
939 FrameSlot.SetAnchorMin(wCenter2, x, y);
940 FrameSlot.SetAnchorMax(wCenter2, x, y);
942 moveLocal = character.VectorToLocal(
GetVelocity());
943 x = (moveLocal[0] / topSpeed) * 0.5 + 0.5;
944 y = (-moveLocal[2] / topSpeed) * 0.5 + 0.5;
945 FrameSlot.SetAnchorMin(wCenter3, x, y);
946 FrameSlot.SetAnchorMax(wCenter3, x, y);
949 TextWidget wSpeed = TextWidget.Cast(m_wDebugRootWidget.FindAnyWidget(
"Speed"));
950 TextWidget wSpeed2 = TextWidget.Cast(m_wDebugRootWidget.FindAnyWidget(
"Speed2"));
951 if (wSpeed && wSpeed2)
953 float speed = Math.Ceil(animComponent.GetInertiaSpeed().Length() * 10) * 0.1;
954 wSpeed.SetText(speed.ToString() +
"m/s");
956 speed = Math.Ceil(
GetVelocity().Length() * 10) * 0.1;
957 wSpeed2.SetText(speed.ToString() +
"m/s");
960 TextWidget wAdjustedSpeed = TextWidget.Cast(m_wDebugRootWidget.FindAnyWidget(
"AdjustedSpeed"));
964 TextWidget wAdjustedStance = TextWidget.Cast(m_wDebugRootWidget.FindAnyWidget(
"AdjustedStance"));
975 TextWidget wMovementAngle = TextWidget.Cast(m_wDebugRootWidget.FindAnyWidget(
"MovementAngle"));
976 CharacterCommandHandlerComponent handler = animComponent.GetCommandHandler();
977 if (!wMovementAngle || !handler)
980 CharacterCommandMove moveCmd = handler.GetCommandMove();
983 float currAngle = moveCmd.GetMovementSlopeAngle();
984 wMovementAngle.SetText(currAngle.ToString() +
"deg");
999 CompartmentAccessComponent compAccess = character.GetCompartmentAccessComponent();
1007 action.PerformAction(compartment.GetOwner(),
GetOwner());
1022 CompartmentAccessComponent compAccess = character.GetCompartmentAccessComponent();
1030 action.PerformAction(compartment.GetOwner(),
GetOwner());
1034 if (!action && compAccess.CanGetOutVehicle())
1043 float value = am.GetActionValue(
"CharacterRoll");
1047 else if (value > 0.5)
1053 else if (rollValue != 0)
1064 am.ActivateContext(
"CharacterWeaponMagnificationContext");
1077 if (
System.IsCLIParam(
"CharacterDebugUI"))
1078 m_bEnableDebugUI =
true;
1080 if (!s_bDiagRegistered)
1085 DiagMenu.RegisterBool(
SCR_DebugMenuID.DEBUGUI_CHARACTER_TRANSFORMATION,
"",
"Enable transform info",
"Character");
1086 DiagMenu.RegisterBool(
SCR_DebugMenuID.DEBUGUI_CHARACTER_RECOIL_CAMERASHAKE_DISABLE,
"",
"Disable recoil cam shake",
"Character");
1087 DiagMenu.RegisterBool(
SCR_DebugMenuID.DEBUGUI_CHARACTER_ADDITIONAL_CAMERASHAKE_DISABLE,
"",
"Disable additional cam shake",
"Character");
1088 DiagMenu.RegisterBool(
SCR_DebugMenuID.DEBUGUI_CHARACTER_CAMERASHAKE_TEST_WINDOW,
"",
"Show shake diag",
"Character");
1089 DiagMenu.RegisterBool(
SCR_DebugMenuID.DEBUGUI_WEAPONS_ALLOW_INSPECTION_LOOKAT,
"",
"Inspection LookAt",
"Character");
1090 s_bDiagRegistered =
true;
1100 if (m_wDebugRootWidget)
1119 if (!variableFovInfo)
1123 variableFovInfo.
SetNext(allowCycling);
1134 SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(
GetOwner());
1135 CompartmentAccessComponent compartmentAccess = character.GetCompartmentAccessComponent();
1136 if (compartmentAccess)
1142 if (!turretController)
1143 turretController = compartment.GetAttachedTurret();
1144 if (turretController)
1146 TurretComponent turretComponent = turretController.GetTurretComponent();
1147 if (turretComponent)
1150 turretComponent.SwitchNextSights();
1152 turretComponent.SwitchPrevSights();
1165 if (!weaponComponent)
1169 weaponComponent.SwitchNextSights();
1171 weaponComponent.SwitchPrevSights();
1186 if (!weaponComponent)
1190 if (!sightsComponent)
1193 return sightsComponent.GetFOVInfo();
1231 if (pCharInvComponent)
1242 if (inputContext && inputContext.IsThrowCanceled())
1244 inputContext.SetThrow(
false);
1248 SCR_InventoryStorageManagerComponent storageManager = SCR_InventoryStorageManagerComponent.Cast(
GetInventoryStorageManager());
1249 if (!storageManager)
1263 SCR_InventoryStorageManagerComponent storageManager = SCR_InventoryStorageManagerComponent.Cast(
GetInventoryStorageManager());
1264 if (!storageManager)
1278 SCR_InventoryStorageManagerComponent storageManager = SCR_InventoryStorageManagerComponent.Cast(
GetInventoryStorageManager());
1279 if (!storageManager)
1327 if (!weapon || !weapon.HasBipod())
1333 weapon.SetBipod(!weapon.GetBipod());
1373 const float threshold = 0.001;
1374 if (
Math.AbsFloat(aimChange[0]) > threshold ||
Math.AbsFloat(aimChange[1]) > threshold)
1384 SCR_InteractionHandlerComponent handler = SCR_InteractionHandlerComponent.Cast(
GetGame().
GetPlayerController().FindComponent(SCR_InteractionHandlerComponent));
1391 array<UserActionContext> contexts = {};
1393 array<IEntity> ents = handler.GetManualOverrideList(null, tmp);
1395 array<UserActionContext> buff;
1397 array<BaseUserAction> actions;
1405 int bc = ac.GetContextList(buff);
1406 for (
int i = 0; i < bc; ++i)
1409 if (ctx.GetActionsCount() == 0)
1413 int actionsCount = ctx.GetActionsList(actions);
1416 if (action.CanBeShown(character))
1418 contexts.Insert(ctx);
1425 int nonEmptyCount = contexts.Count();
1428 if (nonEmptyCount == 0)
1432 vector contextPos = ctx.GetOrigin();
1435 vector targetDirection = contextPos - character.EyePosition();
1436 vector localTargetDirection = character.VectorToLocal( targetDirection );
1437 localTargetDirection.Normalize();
1439 float lookYaw =
Math.Sin(localTargetDirection[0]) *
Math.RAD2DEG;
1440 float lookPitch =
Math.Sin(localTargetDirection[1]) *
Math.RAD2DEG;
1445 targetAngles =
Vector(lookYaw, lookPitch, 0) *
Math.DEG2RAD;
1447 return 4.30 *
Math.RAD2DEG ;
1472 void StartLoitering(
IEntity loiterEntity,
int loiteringType,
bool holsterWeapon,
bool allowRootMotion,
bool alignToPosition,
vector targetPosition[4] = {
"1 0 0",
"0 1 0",
"0 0 1",
"0 0 0" },
bool disableInput =
false,
1477 Print(
"SCR_CharacterControllerComponent::StartLoitering is called with loiteringType=0.",
LogLevel.WARNING);
1482 RplComponent rplComp = character.GetRplComponent();
1483 if (rplComp && !rplComp.IsOwner())
1486 SCR_CharacterCommandHandlerComponent scrCmdHandler = SCR_CharacterCommandHandlerComponent.Cast(character.GetAnimationComponent().GetCommandHandler());
1490 if (!scrCmdHandler.GetCommandMove())
1505 if (alignToPosition)
1515 RplComponent rplComponent = character.GetRplComponent();
1516 if (rplComponent && !rplComponent.IsOwner())
1519 vector currentTransform[4];
1520 character.GetWorldTransform(currentTransform);
1522 if (headingComponent)
1523 headingComponent.AlignPosDirWS(currentTransform[3], currentTransform[2], targetPosition[3], targetPosition[2]);
1525 return vector.DistanceSqXZ(currentTransform[3], targetPosition[3]) < (toleranceXZ * toleranceXZ)
1526 &&
Math.AbsFloat(currentTransform[3][2] - targetPosition[3][2]) < toleranceY;
1542 scrCmdHandler.StartCommandLoitering(customAnimData);
1567 scrCmdHandler.StartCommandLoitering(customAnimData);
1585 if (headingComponent && headingComponent.IsAligning())
1593 SCR_CharacterCommandHandlerComponent scrCmdHandler = SCR_CharacterCommandHandlerComponent.Cast(character.GetAnimationComponent().GetCommandHandler());
1596 RplComponent rplComponent = character.GetRplComponent();
1598 if (rplComponent && rplComponent.IsProxy())
1626 SCR_CharacterCommandHandlerComponent scrCmdHandler = SCR_CharacterCommandHandlerComponent.Cast(
GetAnimationComponent().GetCommandHandler());
1627 scrCmdHandler.StopLoitering(terminateFast);
1637 RplComponent rplComponent = character.GetRplComponent();
1638 if (rplComponent && !rplComponent.IsOwner())
1641 SCR_CharacterCommandHandlerComponent scrCmdHandler = SCR_CharacterCommandHandlerComponent.Cast(
GetAnimationComponent().GetCommandHandler());
1642 scrCmdHandler.StopLoitering(terminateFast);
1644 if (rplComponent && rplComponent.IsProxy())
1651 SCR_CharacterCommandHandlerComponent handler = SCR_CharacterCommandHandlerComponent.Cast(
GetAnimationComponent().GetCommandHandler());
1655 return handler.IsLoitering();
1665enum ECharacterGestures
ArmaReforgerScripted GetGame()
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
ScriptInvokerBase< OnItemUseBegan > OnItemUseBeganInvoker
SCR_CharacterControllerComponent COMMAND_FOLLOW
ScriptInvokerBase< OnControlledByPlayer > OnControlledByPlayerInvoker
ScriptInvokerBase< OnPlayerDeathWithParam > OnPlayerDeathWithParamInvoker
SCR_CharacterControllerComponent COMMAND_GET_IN_THAT_VEHICLE
func OnControlledByPlayer
SCR_CharacterControllerComponent COMMAND_STOP
SCR_CharacterControllerComponent COMMAND_GET_IN
SCR_CharacterControllerComponent POINT_WITH_FINGER
func OnPlayerDeathWithParam
ScriptInvokerBase< OnItemUseEnded > OnItemUseEndedInvoker
ScriptInvokerBase< OnLifeStateChanged > OnLifeStateChangedInvoker
ScriptInvokerBase< OnItemUseFinished > OnItemUseFinishedInvoker
SCR_CharacterControllerComponent COMMAND_MOVE
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
ScriptInvokerBase< ScriptInvokerVoidMethod > ScriptInvokerVoid
ScriptInvokerBase< ScriptInvokerFloat2Method > ScriptInvokerFloat2
SCR_VehicleDamageManagerComponent GetDamageManager()
ActionManager holds information about states of registered Contexts and Actions.
proto external bool CanBePerformed(IEntity user)
Can this action be performed by the user?
proto external Managed FindComponent(typename typeName)
Replication item identifier.
bool SetPrevious(bool allowUnderflow=true)
bool SetNext(bool allowOverflow=true)
void RPC_DoSetShellChargeRing(RplId replicationId, int configId)
static ref array< EDamageType > s_aHitReactionDamageTypes
ref ScriptInvokerFloat2< float > m_OnPlayerDrowning
CharacterSoundComponent m_CharacterSoundComponent
float m_fDrowningDuration
void RPC_AskSetShellChargeRing(RplId replicationId, int configId)
override void OnWeaponLoweringStarted()
SightsFOVInfo GetSightsFOVInfo()
SCR_ScriptedCharacterInputContext GetScrInputContext()
override bool ShouldAligningAdjustAimingAngles()
void SetNextSights(int direction=1)
IEntity GetItemInHandSlot()
Return item currently stored in the hand slot.
void ActionDropItem(float value=0.0, EActionTrigger trigger=0)
override void OnDeath(IEntity instigatorEntity, notnull Instigator instigator)
override void SCR_OnDisabledJumpAction()
void StartLoitering(IEntity loiterEntity, int loiteringType, bool holsterWeapon, bool allowRootMotion, bool alignToPosition, vector targetPosition[4]={ "1 0 0", "0 1 0", "0 0 1", "0 0 0" }, bool disableInput=false, SCR_LoiterCustomAnimData customAnimData=SCR_LoiterCustomAnimData.Default)
bool m_bCharacterIsDrowning
ref ScriptInvokerVoid m_OnWeaponRaisingStartedInvoker
void RPC_AskSyncSightState(bool newState, RplId sightId)
override void OnMeleeDamage(bool started)
override void OnItemUseBegan(ItemUseParameters itemUseParams)
bool AlignToPositionFromCurrentPosition(vector targetPosition[4], float toleranceXZ=0.01, float toleranceY=0.01)
override void OnControlledByPlayer(IEntity owner, bool controlled)
ScriptInvokerVoid GetOnWeaponRaisingFinished()
override void OnLifeStateChanged(ECharacterLifeState previousLifeState, ECharacterLifeState newLifeState, bool isJIP)
override void OnApplyControls(IEntity owner, float timeSlice)
override void OnInit(IEntity owner)
void RPC_StopLoitering_S(bool terminateFast)
override void OnGadgetFocusStateChanged(IEntity gadget, bool isFocused)
ref OnItemUseBeganInvoker m_OnItemUseBeganInvoker
void Rpc_StartLoitering_BCNO(RplId entityRplId, int loiteringType, bool holsterWeapon, bool allowRootMotion, bool alignToPosition, vector targetPosition[4], SCR_LoiterCustomAnimData customAnimData)
override void OnInspectionModeChanged(bool newState)
override void OnAnimationEvent(AnimationEventID animEventType, AnimationEventID animUserString, int intParam, float timeFromStart, float timeToEnd)
void ActionWeaponRaised(float value=0.0, EActionTrigger trigger=0)
void SetNextSightsFOVInfo(int direction=1, bool allowCycling=false)
void Rpc_StartLoitering_S(RplId entityRplId, int loiteringType, bool holsterWeapon, bool allowRootMotion, bool alignToPosition, vector targetPosition[4], SCR_LoiterCustomAnimData customAnimData)
ref ScriptInvoker< IEntity, bool, bool > m_OnGadgetStateChangedInvoker
ScriptInvokerVoid GetOnWeaponLoweringFinished()
float m_fAnimatedHitReactionThreshold
ref ScriptInvoker< IEntity, bool > m_OnGadgetFocusStateChangedInvoker
ref OnPlayerDeathWithParamInvoker m_OnPlayerDeathWithParam
SCR_ShellConfig GetSavedShellConfig(notnull EntityPrefabData shellPrefab)
void ReplicateHelicopterSightState(bool newState, RplId sightId)
override EHitReactionType ComputeHitReaction(float damageValue, EDamageType damageType)
ref ScriptInvoker< AnimationEventID, AnimationEventID, int, float, float, SCR_CharacterControllerComponent > m_OnAnimationEvent
override bool SCR_GetDisableMovementControls()
ref OnControlledByPlayerInvoker m_OnControlledByPlayer
void SyncShellChargeRingConfig(notnull SCR_MortarShellGadgetComponent shellComp, int configId)
void SetScrInputContext(SCR_ScriptedCharacterInputContext ctx)
bool IsAligningBeforeLoiter()
ref ScriptInvokerVoid m_OnWeaponLoweringStartedInvoker
override bool ShouldGadgetBeDropped(IEntity gadget)
void ActionWeaponLowReady(float value=0.0, EActionTrigger trigger=0)
override bool IsUsingBinoculars()
ScriptInvokerVoid GetOnPlayerDeath()
void SCR_CharacterControllerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
ScriptInvokerVoid GetOnWeaponLoweringStarted()
ref ScriptInvokerVoid m_OnWeaponRaisingFinishedInvoker
ref ScriptInvokerVoid m_OnPlayerDeath
void ActionUnequipItem(float value=0.0, EActionTrigger trigger=0)
override void OnConsciousnessChanged(bool conscious)
ScriptInvoker GetOnAnimationEvent()
override void OnWeaponLoweringFinished()
override void OnWeaponRaisingStarted()
override void OnPrepareControls(IEntity owner, ActionManager am, float dt, bool player)
ref array< ref SCR_ShellConfig > m_aSavedShellConfigs
Contains information about for which shell player saved some information for future use.
ref OnItemUseFinishedInvoker m_OnItemUseFinishedInvoker
override bool GetCanEquipGadget(IEntity gadget)
ref SCR_ScriptedCharacterInputContext m_pScrInputContext
void SetShellConfig(notnull SCR_ShellConfig config)
void ActionNextWeapon(float value=0.0, EActionTrigger trigger=0)
ref ScriptInvokerVoid m_OnWeaponLoweringFinishedInvoker
bool IsLoiteringOnEntity(IEntity entity)
override bool CanJumpClimb()
ScriptInvokerVoid GetOnWeaponRaisingStarted()
OnPlayerDeathWithParamInvoker GetOnPlayerDeathWithParam()
void ActionWeaponBipod(float value=0.0, EActionTrigger trigger=0)
override void OnWeaponRaisingFinished()
override void UpdateDrowning(float timeSlice, vector waterLevel)
SCR_CharacterCameraHandlerComponent m_CameraHandler
override bool GetCanMeleeAttack()
ref OnLifeStateChangedInvoker m_OnLifeStateChanged
bool TryStartLoiteringInternal()
ref ScriptInvokerVoid m_OnPlayerStopDrowning
bool IsCharacterDrowning()
override bool OnPerformAction()
override void OnItemUseEnded(ItemUseParameters itemUseParams, bool successful)
void StopLoitering(bool terminateFast)
override void OnGadgetStateChanged(IEntity gadget, bool isInHand, bool isOnGround)
SCR_MeleeComponent m_MeleeComponent
override float GetInspectTargetLookAt(out vector targetAngles)
void ~SCR_CharacterControllerComponent()
ref OnItemUseEndedInvoker m_OnItemUseEndedInvoker
SCR_CharacterHeadHitZone GetHeadHitZone()
SCR_CharacterResilienceHitZone GetResilienceHitZone()
bool UseItem(notnull IEntity item, ESlotFunction slotFunction=ESlotFunction.TYPE_GENERIC, SCR_EUseContext context=SCR_EUseContext.FROM_QUICKSLOT)
IEntity SelectNextWeapon(int maxSlot=-1)
Select next weapon.
void InitAsPlayer(IEntity pOwner, bool pControlled)
void UnequipCurrentItem()
Unequip currently held item. Not allowed while switching to another item.
void DropCurrentItem()
Drop currently held item. Not allowed while switching to another item.
static RplComponent GetEntityRplComponent(notnull IEntity entity)
Script entry for garbage system modding.
static SCR_GarbageSystem GetByEntityWorld(IEntity entity)
static IEntity GetLocalControlledEntity()
void SetChargeRingConfigId(int configId)
void SetManualTimeUsage(bool shouldUse)
void SetSavedTime(float newTime)
bool GetJumpingAndClimbingAllowed()
void UpdateOccupantsCount(IEntity ignoreOccupant=null)
proto external AIBaseAimingComponent GetAimingComponent()
IEntity GetOwner()
Owner entity of the fuel tank.
proto external bool IsDead()
HYBRID_COMPONENT_ICON
Default icon for all components written in script that don't inherit ScriptComponent.
proto external ECharacterLifeState GetLifeState()
proto external InventoryStorageManagerComponent GetInventoryStorageManager()
proto external void RemoveGadgetFromHand(bool skipAnimations=false)
Remove held gadget.
proto external bool IsChangingItem()
proto external bool IsUnconscious()
proto external bool ShouldHoldInputForRoll()
proto external int GetCurrentMovementPhase()
proto external void SetPartialLower(bool state)
Sets desired partial lower state, if allowed.
proto external bool IsFreeLookEnabled()
event bool CanJumpOutVehicleScript()
Override to handle whether character can eject from vehicle via JumpOut input action.
proto external ECharacterStance GetStance()
Returns the current stance of the character.
proto external bool GetIsWeaponDeployed()
proto external bool IsUsingItem()
proto external bool IsFalling()
proto external bool GetIsWeaponDeployedBipod()
proto external IEntity GetCurrentItemInHands()
proto external bool IsSprinting()
proto external bool IsClimbing()
proto external void SetBanking(float val)
proto external CharacterAnimationComponent GetAnimationComponent()
proto external IEntity GetInspectEntity()
proto external bool GetCanThrow()
proto external CharacterHeadAimingComponent GetHeadAimingComponent()
event bool CanGetOutVehicleScript()
Override to handle whether character can get out of vehicle via GetOut input action.
proto external void SetWeaponRaised(bool val)
Set the current weapon-raised state.
proto external bool GetIsSprintingToggle()
proto external vector GetMovementInput()
proto external CharacterInputContext GetInputContext()
void OnDiag(IEntity owner, float timeslice)
proto external bool IsGadgetInHands()
Returns true if there is a gadget in hands.
proto external bool GetCanFireWeapon()
proto external bool CanPartialLower()
Returns true if the character can partially lower (weapon).
proto external bool IsWeaponRaised()
proto external vector GetVelocity()
proto external float GetDynamicSpeed()
proto external bool IsPartiallyLowered()
Returns true if the character is partially lowered.
proto external bool TryEquipRightHandItem(IEntity item, EEquipItemType type, bool swap=false, BaseUserAction callbackAction=null)
proto external SCR_ChimeraCharacter GetCharacter()
Returns the current controlled character.
proto external vector GetMovementVelocity()
proto external BaseWeaponManagerComponent GetWeaponManagerComponent()
proto external bool IsInThirdPersonView()
proto external float GetDynamicStance()
proto external void SetRoll(int val)
2 - right, 1 - left
proto external bool IsWeaponADS()
proto external void StopDeployment()
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
@ NONE
When Shape is created and not initialized yet.
SCR_FieldOfViewSettings Attribute
proto external PlayerController GetPlayerController()
void RplRpc(RplChannel channel, RplRcver rcver, RplCondition condition=RplCondition.None, string customConditionName="")
RplCondition
Conditional replication rule. Fine grained selection of receivers.
RplChannel
Communication channel. Reliable is guaranteed to be delivered. Unreliable not.
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.
proto native vector Vector(float x, float y, float z)
WidgetFlags
Widget flags. See enf::Widget::SetFlags().
proto int ARGB(int a, int r, int g, int b)