scripting:components:charactercontrollercomponent
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
scripting:components:charactercontrollercomponent [2022/08/10 20:41] – jerryhopper | scripting:components:charactercontrollercomponent [2022/08/10 22:40] (current) – [SetStickyADS()] jerryhopper | ||
---|---|---|---|
Line 21: | Line 21: | ||
===== Functions ===== | ===== Functions ===== | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== GetAnimationComponent() ==== | ||
+ | |||
+ | GetAnimationComponent(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | |||
+ | ==== GetWeaponManagerComponent() ==== | ||
+ | |||
+ | GetWeaponManagerComponent(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | |||
+ | ==== GetCameraHandlerComponent() ==== | ||
+ | |||
+ | GetCameraHandlerComponent(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | |||
+ | ==== GetInventoryStorageManager() ==== | ||
+ | |||
+ | GetInventoryStorageManager(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | |||
+ | ==== GetVONComponent() ==== | ||
+ | |||
+ | GetVONComponent(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | |||
+ | ==== GetInputContext() ==== | ||
+ | |||
+ | GetInputContext(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | |||
+ | ==== GetMovementType() ==== | ||
+ | |||
+ | GetMovementType(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetMovement() ==== | ||
+ | |||
+ | SetMovement(float type, vector movementDirLocal); | ||
+ | |||
+ | Update animation about state of movement, define speed and direction in local space of character | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetHeadingAngle() ==== | ||
+ | |||
+ | SetHeadingAngle(float newHeadingAngle, | ||
+ | |||
+ | set heading angle in radians | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetHeadingAngle() ==== | ||
+ | |||
+ | GetHeadingAngle(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetAimingAngles() ==== | ||
+ | |||
+ | SetAimingAngles(float yaw, float pitch); | ||
+ | |||
+ | set aiming angles in radians | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetStance() ==== | ||
+ | |||
+ | GetStance(); | ||
+ | |||
+ | Returns the current stance of the character. | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetCharacter() ==== | ||
+ | |||
+ | GetCharacter(); | ||
+ | |||
+ | Returns the current controlled character. | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetFireWeaponWanted() ==== | ||
+ | |||
+ | SetFireWeaponWanted(bool val); | ||
+ | |||
+ | Set wanted input action values | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetThrow() ==== | ||
+ | |||
+ | Set wanted input action values | ||
+ | |||
+ | SetThrow(bool val, bool cancelThrow); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetMovementDirWorld() ==== | ||
+ | |||
+ | Update simulation state with difference of world position | ||
+ | |||
+ | SetMovementDirWorld(vector movementDirWorld); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetMovementDirWorld() ==== | ||
+ | |||
+ | GetMovementDirWorld(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetWeaponRaised() ==== | ||
+ | |||
+ | Set the current weapon-raised state. | ||
+ | |||
+ | SetWeaponRaised(bool val); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetWeaponADS() ==== | ||
+ | |||
+ | Set the current weapon ADS state. | ||
+ | |||
+ | SetWeaponADS(bool val); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetPlayGesture() ==== | ||
+ | |||
+ | Set the current play gesture state. | ||
+ | SetPlayGesture(bool val); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetFreeLook() ==== | ||
+ | |||
+ | SetFreeLook(bool val); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== ResetPersistentStates() ==== | ||
+ | |||
+ | ResetPersistentStates(bool resetADSState = true, bool resetGadgetState = true); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetDynamicSpeed() ==== | ||
+ | |||
+ | Sets dynamic speed of this character. | ||
+ | param value Desired speed as percentage < | ||
+ | SetDynamicSpeed(float value); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetDynamicSpeed() ==== | ||
+ | |||
+ | Returns dynamic speed value. | ||
+ | | ||
+ | GetDynamicSpeed(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetDynamicStance() ==== | ||
+ | |||
+ | Sets dynamic stance of this character. | ||
+ | param value Desired stance height as percentage of full erect < | ||
+ | SetDynamicStance(float value); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== CanSetDynamicStance() ==== | ||
+ | |||
+ | Returns whether provided dynamic stance can be set for this character. | ||
+ | see CharacterControllerComponent:: | ||
+ | param value Desired stance height as percentage of full erect < | ||
+ | |||
+ | CanSetDynamicStance(float value); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetDynamicStance() ==== | ||
+ | |||
+ | Returns current dynamic stance value. | ||
+ | | ||
+ | |||
+ | GetDynamicStance(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetInspectionMode() ==== | ||
+ | |||
+ | Enables or disables inspection mode. | ||
+ | param state Desired state true=enabled, | ||
+ | |||
+ | SetInspectionMode(bool state); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== CanSetInspectionMode() ==== | ||
+ | |||
+ | Returns whether inspection mode can be set. | ||
+ | | ||
+ | |||
+ | CanSetInspectionMode(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetIsInspectionMode() ==== | ||
+ | |||
+ | Returns whether character is in inspection mode. | ||
+ | | ||
+ | |||
+ | GetIsInspectionMode(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetInspectionState() ==== | ||
+ | |||
+ | Sets inspection state if inspection state is enabled. | ||
+ | param state Desired state. | ||
+ | |||
+ | SetInspectionState(float state); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetInspectionState() ==== | ||
+ | |||
+ | Returns inspection state if inspection state is enabled. | ||
+ | | ||
+ | |||
+ | GetInspectionState(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetStanceChange() ==== | ||
+ | |||
+ | CharacterStanceChange STANCECHANGE_NONE = 0, STANCECHANGE_TOERECTED = 1, STANCECHANGE_TOCROUCH = 2, STANCECHANGE_TOPRONE = 3 | ||
+ | |||
+ | SetStanceChange(int stance); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== CanChangeStance() ==== | ||
+ | |||
+ | CharacterStanceChange STANCECHANGE_NONE = 0, STANCECHANGE_TOERECTED = 1, STANCECHANGE_TOCROUCH = 2, STANCECHANGE_TOPRONE = 3 | ||
+ | |||
+ | CanChangeStance(int stance); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== ForceStance() ==== | ||
+ | |||
+ | ForceStance(int stance); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== ForceStanceUp() ==== | ||
+ | |||
+ | ForceStanceUp(int stance); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetRoll() ==== | ||
+ | |||
+ | 2 - right, 1 - left | ||
+ | |||
+ | SetRoll(int val); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetJump() ==== | ||
+ | |||
+ | SetJump(float val); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetWantedLeaning() ==== | ||
+ | |||
+ | SetWantedLeaning(float val); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetBanking() ==== | ||
+ | |||
+ | SetBanking(float val); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetMeleeAttack() ==== | ||
+ | |||
+ | SetMeleeAttack(bool val); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetLeaning() ==== | ||
+ | |||
+ | Either character wants to lean | ||
+ | GetLeaning(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetWantedLeaning ==== | ||
+ | |||
+ | GetWantedLeaning(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsAdjustingLeaning() ==== | ||
+ | |||
+ | IsAdjustingLeaning(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetCurrentLeanAmount() ==== | ||
+ | |||
+ | Returns current amount of leaning applied | ||
+ | GetCurrentLeanAmount(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsLeaning() ==== | ||
+ | |||
+ | IsLeaning(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetADSTime() ==== | ||
+ | |||
+ | GetADSTime(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsWeaponRaised() ==== | ||
+ | |||
+ | IsWeaponRaised(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsWeaponObstructed() ==== | ||
+ | |||
+ | IsWeaponObstructed(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetObstructionAlpha() ==== | ||
+ | |||
+ | GetObstructionAlpha(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsClimbing() ==== | ||
+ | |||
+ | IsClimbing(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsSwimming() ==== | ||
+ | |||
+ | IsSwimming(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsSprinting() ==== | ||
+ | IsSprinting(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsChangingStance() ==== | ||
+ | |||
+ | IsChangingStance(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsWeaponADS() ==== | ||
+ | |||
+ | IsWeaponADS(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsChangingFireMode() ==== | ||
+ | IsChangingFireMode(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsPlayingGesture() ==== | ||
+ | |||
+ | IsPlayingGesture(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsFreeLookEnabled() ==== | ||
+ | |||
+ | IsFreeLookEnabled(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsTrackIREnabled() ==== | ||
+ | |||
+ | IsTrackIREnabled(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsFocusMode() ==== | ||
+ | |||
+ | IsFocusMode(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetWeaponADSInput() ==== | ||
+ | |||
+ | GetWeaponADSInput(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsChangingItem() ==== | ||
+ | |||
+ | IsChangingItem(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsFalling() ==== | ||
+ | |||
+ | IsFalling(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsReloading() ==== | ||
+ | |||
+ | IsReloading(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== CanFire() ==== | ||
+ | |||
+ | CanFire(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsDead() ==== | ||
+ | |||
+ | IsDead(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsUsingItem() ==== | ||
+ | |||
+ | IsUsingItem(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsMeleeAttack() ==== | ||
+ | |||
+ | IsMeleeAttack(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== CanEngageChangeItem() ==== | ||
+ | |||
+ | CanEngageChangeItem(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SelectWeapon() ==== | ||
+ | |||
+ | Set weapon on character with switching animations. If true, the request was successful | ||
+ | |||
+ | SelectWeapon(BaseWeaponComponent newWeapon); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetMuzzle() ==== | ||
+ | |||
+ | SetMuzzle(int index); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetFireMode() ==== | ||
+ | |||
+ | SetFireMode(int index); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetSightsRange() ==== | ||
+ | |||
+ | SetSightsRange(int index); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetWeaponADSInput() ==== | ||
+ | |||
+ | SetWeaponADSInput(bool val); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetSafety() ==== | ||
+ | |||
+ | Set the safety of the current weapon. | ||
+ | param safety True to set the weapon safety. | ||
+ | param automatic True to set the automatic safety otherwise false to set manual safety. | ||
+ | | ||
+ | |||
+ | SetSafety(bool safety, bool automatic); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetStamina() ==== | ||
+ | |||
+ | Returns the current stamina value in <0, 1>. -1 if there is no stamina component attached to the current owner. | ||
+ | |||
+ | GetStamina(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== ReloadWeapon() ==== | ||
+ | |||
+ | Request weapon reload. If true, request was sucessful | ||
+ | |||
+ | ReloadWeapon(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== ReloadWeaponWith() ==== | ||
+ | |||
+ | mag or projectile | ||
+ | |||
+ | ReloadWeaponWith(IEntity ammunitionEntity); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== Ragdoll() ==== | ||
+ | |||
+ | Dying | ||
+ | |||
+ | Ragdoll(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== ForceDeath() ==== | ||
+ | |||
+ | Kills the character. Skips invincibility checks. | ||
+ | |||
+ | ForceDeath(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== TakeGadgetInLeftHand() ==== | ||
+ | | ||
+ | /* @NOTE(Leo): Temp solution, eventually will be solved by setting respective gadget graph attachments, | ||
+ | unfortunately current state of Enf animation system is not allowing it and will be solved not earlier then 10.07 by @Michal Žák | ||
+ | from conversation with @Théo Escamez: | ||
+ | so heres how it works : | ||
+ | for now we have 4 items> compass adrianov, compass SY183, Radio ANPRC68 and Radio R148 | ||
+ | ...where they are triggered respectively by integers 1 2 3 and 4... | ||
+ | |||
+ | TakeGadgetInLeftHand(IEntity gadget, int gadgetType, bool autoFocus = false, bool skipAnimations = false); | ||
+ | |||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== CanEquipGadget() ==== | ||
+ | |||
+ | Performs gadget equip validation | ||
+ | |||
+ | CanEquipGadget(IEntity gadget); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetAttachedGadgetAtLeftHandSlot() ==== | ||
+ | |||
+ | GetAttachedGadgetAtLeftHandSlot(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | |||
+ | ==== TryUseBandage() ==== | ||
+ | |||
+ | Try to use bandage on specified body part for a specific duration. | ||
+ | param bandage Bandage entity used for bandage action. | ||
+ | param bodyPart Body part where the bandage will be applied. | ||
+ | param duration Duration of the bandage in seconds. | ||
+ | param bandageSelf True if the player is bandaging himself. | ||
+ | |||
+ | TryUseBandage(IEntity bandage, int bodyPart, float duration = 4.0, bool bandageSelf = true); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== RemoveGadgetFromHand() ==== | ||
+ | |||
+ | Remove held gadget | ||
+ | |||
+ | RemoveGadgetFromHand(bool skipAnimations = false); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== RecoverHiddenGadget() ==== | ||
+ | |||
+ | Put held gadget on hold | ||
+ | |||
+ | RecoverHiddenGadget(bool respectSettings, | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsGadgetInHands() ==== | ||
+ | |||
+ | Returns true if there is a gadget in hands. | ||
+ | |||
+ | IsGadgetInHands(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetGadgetRaisedModeWanted() ==== | ||
+ | |||
+ | Returns true if focus will be changed to requested | ||
+ | |||
+ | SetGadgetRaisedModeWanted(bool newRaised); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsGadgetRaisedModeWanted ==== | ||
+ | |||
+ | Returns true if character will be (or is) using gadget in raised mode | ||
+ | |||
+ | IsGadgetRaisedModeWanted(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | |||
+ | ==== TryEquipRightHandItem() ==== | ||
+ | |||
+ | Generic item | ||
+ | Equippes an item in right hand, if swap is true then action performed without animations, accepts optional callback that will be triggered when action is completed | ||
+ | |||
+ | TryEquipRightHandItem(IEntity item, EEquipItemType type, bool swap = false, BaseUserAction callbackAction = null); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetRightHandItem() ==== | ||
+ | |||
+ | Returns generic item attached to right hand. Returns null if there' | ||
+ | |||
+ | GetRightHandItem(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | |||
+ | ==== TryUseEquippedItem() ==== | ||
+ | |||
+ | Try to use equipped item. | ||
+ | | ||
+ | |||
+ | TryUseEquippedItem(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== TryUseItem() ==== | ||
+ | |||
+ | Try to use the specified item. | ||
+ | param item The item which should be used. | ||
+ | | ||
+ | |||
+ | TryUseItem(IEntity item); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== CanUseItem() ==== | ||
+ | |||
+ | Returns true if the character can use an item. | ||
+ | |||
+ | CanUseItem(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== TryStartCharacterGesture() ==== | ||
+ | Starts character gesture with specified duration in milliseconds (if duration <= 0, it will be played until StopCharacterGesture is called) | ||
+ | |||
+ | TryStartCharacterGesture(int gesture, int durationMS = 0); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== StopCharacterGesture() ==== | ||
+ | |||
+ | StopCharacterGesture(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== TryPlayItemGesture() ==== | ||
+ | |||
+ | Try to play the specified gesture. | ||
+ | param gesture The gesture which should be played. | ||
+ | param callbackAction Optional UserAction as callback that will be called when target animation event is hit or gesture is complete | ||
+ | param confirmEvent | ||
+ | | ||
+ | |||
+ | TryPlayItemGesture(EItemGesture gesture, BaseUserAction callbackAction = null, string confirmEvent = "" | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsPlayingItemGesture() ==== | ||
+ | |||
+ | Returns true if the character is playing a gesture. | ||
+ | |||
+ | IsPlayingItemGesture(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== CanPlayItemGesture() ==== | ||
+ | |||
+ | Returns true if the character can play a gesture. | ||
+ | |||
+ | CanPlayItemGesture(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== CanUseLadder() ==== | ||
+ | |||
+ | Returns true if the character can use provided ladder. | ||
+ | if optional maxTestDistance or maxEntryAngle is below 0, distance for test will be taken from character' | ||
+ | |||
+ | CanUseLadder(LadderComponent pLadder, float maxTestDistance = -1.0, float maxEntryAngle = -1.0, bool performTraceCheck = false); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== TryUseLadder() ==== | ||
+ | |||
+ | Start climbing provided ladder. | ||
+ | Returns true if request was successful. | ||
+ | |||
+ | TryUseLadder(LadderComponent pLadder, float maxTestDistance = -1.0, float maxEntryAngle = -1.0); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== RequestActionByID() ==== | ||
+ | |||
+ | Script | ||
+ | |||
+ | RequestActionByID(int actionID, float value); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsPartiallyLowered() ==== | ||
+ | |||
+ | Returns true if the character is partially lowered. | ||
+ | |||
+ | IsPartiallyLowered(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetAimingAngles() ==== | ||
+ | |||
+ | Returns the aiming angles in radians | ||
+ | |||
+ | GetAimingAngles(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetWeaponAngles() ==== | ||
+ | |||
+ | Returns the weapon angles in degrees | ||
+ | |||
+ | GetWeaponAngles(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetCameraWeaponAngles() ==== | ||
+ | |||
+ | Returns the camera weapon angles in degrees | ||
+ | |||
+ | GetCameraWeaponAngles(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetCameraWeaponOffset() ==== | ||
+ | |||
+ | GetCameraWeaponOffset(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetLookAtAngularVelocity() ==== | ||
+ | |||
+ | Returns the angular velocity in degrees/s | ||
+ | |||
+ | GetLookAtAngularVelocity(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetDisableMovementControls() ==== | ||
+ | |||
+ | GetDisableMovementControls(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetDisableMovementControls() ==== | ||
+ | |||
+ | SetDisableMovementControls(bool other); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetDisableViewControls() ==== | ||
+ | |||
+ | GetDisableViewControls(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetDisableViewControls() ==== | ||
+ | |||
+ | SetDisableViewControls(bool other); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetAimingSensitivity() ==== | ||
+ | SetAimingSensitivity(float mouse, float gamepad, float ads); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetAimingSensivity() ==== | ||
+ | GetAimingSensivity(out float mouse, out float gamepad, out float ads); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetStickyGadget() ==== | ||
+ | |||
+ | Sets gadget handling into persistent mode | ||
+ | |||
+ | SetStickyGadget(bool enable); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetStickyADS() ==== | ||
+ | |||
+ | Sets ads and gadget focus into persistent mode | ||
+ | |||
+ | SetStickyADS(bool enable); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetMaxZoomInADS() ==== | ||
+ | |||
+ | SetMaxZoomInADS(bool enable); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetMaxZoomInADS() ==== | ||
+ | |||
+ | GetMaxZoomInADS(); | ||
+ | |||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetDisableWeaponControls() ==== | ||
+ | |||
+ | GetDisableWeaponControls(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetDisableWeaponControls() ==== | ||
+ | |||
+ | SetDisableWeaponControls(bool other); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetMovementVelocity() ==== | ||
+ | |||
+ | GetMovementVelocity(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetMovementInput() ==== | ||
+ | |||
+ | GetMovementInput(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetVelocity() ==== | ||
+ | |||
+ | GetVelocity(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetIsSprintingToggle() ==== | ||
+ | |||
+ | GetIsSprintingToggle(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetLastStanceChangeDelay() ==== | ||
+ | |||
+ | GetLastStanceChangeDelay(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetCurrentMovementPhase() ==== | ||
+ | |||
+ | GetCurrentMovementPhase(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetCanFireWeapon() ==== | ||
+ | |||
+ | GetCanFireWeapon(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetCanThrow() ==== | ||
+ | |||
+ | GetCanThrow(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetWeaponNoFireTime() ==== | ||
+ | |||
+ | SetWeaponNoFireTime(float t); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== IsInThirdPersonView() ==== | ||
+ | |||
+ | IsInThirdPersonView(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== SetInThirdPersonView() ==== | ||
+ | |||
+ | SetInThirdPersonView(bool state); | ||
+ | |||
+ | Caching third person view since profiling showed minor impact on cpu time when calling in to scripted method | ||
+ | |||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetStanceChangeDelayTime() ==== | ||
+ | |||
+ | GetStanceChangeDelayTime(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetJumpSpeed() ==== | ||
+ | |||
+ | GetJumpSpeed(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetMeleeAttackInput() ==== | ||
+ | |||
+ | GetMeleeAttackInput(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetPositionInView() ==== | ||
+ | |||
+ | GetPositionInView(vector pos, float angMax); | ||
+ | |||
+ | Returns whether a position is in the character' | ||
+ | param pos World Position to check is within view | ||
+ | param angMax Maximum(exclusive) angular offset in Degrees to consider the position within view | ||
+ | |||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== GetWeaponModifiers() ==== | ||
+ | |||
+ | GetWeaponModifiers(float baseScale, float moveScale, out vector scaleA, out vector scaleB); | ||
+ | |||
+ | Returns modifiers for weapon sway/recoil based on movement, stance, etc | ||
+ | Fills scaleA and scaleB with following modifier values: | ||
+ | scaleA.x - modifier scaleX | ||
+ | scaleA.y - modifier scaleY | ||
+ | scaleB.x - speed scale | ||
+ | scaleB.y - translation scale | ||
+ | |||
+ | [Obsolete(" | ||
+ | |||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== CharacterStaminaComponent() ==== | ||
+ | |||
+ | Returns locally cached stamina component or null if none. | ||
+ | |||
+ | | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | |||
+ | ==== IsCharacterStationary() ==== | ||
+ | |||
+ | Check if character is not moving and not any other locomotion related action is being performed | ||
+ | IsCharacterStationary(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | |||
+ | |||
Line 26: | Line 1036: | ||
+ | |||
+ | ==== OnInit() ==== | ||
+ | |||
+ | OnInit(IEntity owner); | ||
+ | |||
+ | Called during EOnInit. | ||
+ | param owner Entity this component is attached to. | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== OnDiag() ==== | ||
+ | |||
+ | OnDiag(IEntity owner, float timeslice); | ||
+ | |||
+ | Called during EOnDiag. | ||
+ | Param owner Entity this component is attached to. | ||
+ | param timeSlice Delta time since last update. | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== OnReloaded() ==== | ||
+ | |||
+ | OnReloaded(IEntity owner, BaseWeaponComponent weapon); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== OnPrepareControls() ==== | ||
+ | |||
+ | OnPrepareControls(IEntity owner, ActionManager am, float dt, bool player); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== OnApplyControls() ==== | ||
+ | |||
+ | OnApplyControls(IEntity owner, float timeSlice); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== OnMeleeDamage() ==== | ||
+ | |||
+ | OnMeleeDamage(bool started); | ||
+ | |||
+ | Handling of melee events. Sends true if melee started, false, when melee ends | ||
+ | |||
+ | ==== GetCanMeleeAttack() ==== | ||
+ | |||
+ | GetCanMeleeAttack(); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== OnPerformAction() ==== | ||
+ | OnPerformAction(); | ||
+ | |||
+ | Override to handle what happens after pressing F button, return false to use default cpp behavior | ||
+ | |||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== CanGetOutVehicleScript() ==== | ||
+ | |||
+ | CanGetOutVehicleScript(); | ||
+ | |||
+ | Override to handle whether character can get out of vehicle via GetOut input action | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== OnDeath() ==== | ||
+ | |||
+ | Handling of death | ||
+ | |||
+ | OnDeath(IEntity instigator); | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== OnGadgetStateChanged() ==== | ||
+ | OnGadgetStateChanged(IEntity gadget, bool isInHand, bool isOnGround); | ||
+ | |||
+ | Will be called when gadget taken/ | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== OnGadgetFocusStateChanged() ==== | ||
+ | OnGadgetFocusStateChanged(IEntity gadget, bool isFocused); | ||
+ | |||
+ | Will be called when gadget fully transitioned to or canceled focus mode | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== OnItemUseBegan() ==== | ||
+ | OnItemUseBegan(IEntity item); | ||
+ | |||
+ | Will be called when item use action is started | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== OnItemUseComplete() ==== | ||
+ | |||
+ | OnItemUseComplete(IEntity item); | ||
+ | |||
+ | Will be called when item use action is complete | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== OnAnimationEvent() ==== | ||
+ | |||
+ | OnAnimationEvent(AnimationEventID animEventType, | ||
+ | |||
+ | Return type: [[scripting: | ||
+ | |||
+ | ==== OnControlledByPlayer() ==== | ||
+ | |||
+ | OnControlledByPlayer(IEntity owner, bool controlled); | ||
+ | |||
+ | Called when a player has been assigned to this controller | ||
+ | |||
+ | Return type: [[scripting: | ||
scripting/components/charactercontrollercomponent.1660160467.txt.gz · Last modified: 2022/08/10 20:41 by jerryhopper