diff --git a/ALSV4_CPP.uplugin b/ALSV4_CPP.uplugin index a5d21654..e8b0cada 100644 --- a/ALSV4_CPP.uplugin +++ b/ALSV4_CPP.uplugin @@ -1,7 +1,7 @@ { "FileVersion": 3, "Version": 1, - "VersionName": "4.21.2", + "VersionName": "4.22.0", "FriendlyName": "Advanced Locomotion System Community", "Description": "Performance optimized community version of LongmireLocomotion's Advanced Locomotion System V4", "Category": "Animation", diff --git a/Content/AdvancedLocomotionV4/Blueprints/CameraSystem/ALS_PlayerCameraManager.uasset b/Content/AdvancedLocomotionV4/Blueprints/CameraSystem/ALS_PlayerCameraManager.uasset index 78ea9540..4d97bc66 100644 Binary files a/Content/AdvancedLocomotionV4/Blueprints/CameraSystem/ALS_PlayerCameraManager.uasset and b/Content/AdvancedLocomotionV4/Blueprints/CameraSystem/ALS_PlayerCameraManager.uasset differ diff --git a/Content/AdvancedLocomotionV4/Blueprints/Components/DebugComponent.uasset b/Content/AdvancedLocomotionV4/Blueprints/Components/DebugComponent.uasset index b8e3606d..e7d23e51 100644 Binary files a/Content/AdvancedLocomotionV4/Blueprints/Components/DebugComponent.uasset and b/Content/AdvancedLocomotionV4/Blueprints/Components/DebugComponent.uasset differ diff --git a/Content/AdvancedLocomotionV4/Blueprints/UI/ALS_HUD.uasset b/Content/AdvancedLocomotionV4/Blueprints/UI/ALS_HUD.uasset index ff58341d..439b3d04 100644 Binary files a/Content/AdvancedLocomotionV4/Blueprints/UI/ALS_HUD.uasset and b/Content/AdvancedLocomotionV4/Blueprints/UI/ALS_HUD.uasset differ diff --git a/Source/ALSV4_CPP/Private/Character/ALSBaseCharacter.cpp b/Source/ALSV4_CPP/Private/Character/ALSBaseCharacter.cpp index 27e2a58b..fe3f9b27 100644 --- a/Source/ALSV4_CPP/Private/Character/ALSBaseCharacter.cpp +++ b/Source/ALSV4_CPP/Private/Character/ALSBaseCharacter.cpp @@ -101,7 +101,10 @@ void AALSBaseCharacter::OnBreakfall_Implementation() void AALSBaseCharacter::Replicated_PlayMontage_Implementation(UAnimMontage* Montage, float PlayRate) { // Roll: Simply play a Root Motion Montage. - MainAnimInstance->Montage_Play(Montage, PlayRate); + if (MainAnimInstance) + { + MainAnimInstance->Montage_Play(Montage, PlayRate); + } Server_PlayMontage(Montage, PlayRate); } @@ -118,22 +121,8 @@ void AALSBaseCharacter::BeginPlay() // Set the Movement Model SetMovementModel(); - // Once, force set variables in anim bp. This ensures anim instance & character starts synchronized - FALSAnimCharacterInformation& AnimData = MainAnimInstance->GetCharacterInformationMutable(); - MainAnimInstance->Gait = DesiredGait; - MainAnimInstance->Stance = DesiredStance; - MainAnimInstance->RotationMode = DesiredRotationMode; - AnimData.ViewMode = ViewMode; - MainAnimInstance->OverlayState = OverlayState; - AnimData.PrevMovementState = PrevMovementState; - MainAnimInstance->MovementState = MovementState; - - // Update states to use the initial desired values. - SetGait(DesiredGait); - SetStance(DesiredStance); - SetRotationMode(DesiredRotationMode); - SetViewMode(ViewMode); - SetOverlayState(OverlayState); + // Force update states to use the initial desired values. + ForceUpdateCharacterState(); if (Stance == EALSStance::Standing) { @@ -149,7 +138,7 @@ void AALSBaseCharacter::BeginPlay() LastVelocityRotation = TargetRotation; LastMovementInputRotation = TargetRotation; - if (GetLocalRole() == ROLE_SimulatedProxy) + if (MainAnimInstance && GetLocalRole() == ROLE_SimulatedProxy) { MainAnimInstance->SetRootMotionMode(ERootMotionMode::IgnoreRootMotion); } @@ -163,20 +152,19 @@ void AALSBaseCharacter::PreInitializeComponents() { Super::PreInitializeComponents(); - MainAnimInstance = Cast(GetMesh()->GetAnimInstance()); - if (!MainAnimInstance) + if (GetMesh()) { - // Animation instance should be assigned if we're not in editor preview - checkf(GetWorld()->WorldType == EWorldType::EditorPreview, - TEXT("%s doesn't have a valid animation instance assigned. That's not allowed"), - *GetName()); + MainAnimInstance = Cast(GetMesh()->GetAnimInstance()); } } void AALSBaseCharacter::SetAimYawRate(float NewAimYawRate) { AimYawRate = NewAimYawRate; - MainAnimInstance->GetCharacterInformationMutable().AimYawRate = AimYawRate; + if (MainAnimInstance) + { + MainAnimInstance->GetCharacterInformationMutable().AimYawRate = AimYawRate; + } } void AALSBaseCharacter::Tick(float DeltaTime) @@ -235,7 +223,10 @@ void AALSBaseCharacter::RagdollStart() GetMesh()->SetAllBodiesBelowSimulatePhysics(NAME_Pelvis, true, true); // Step 3: Stop any active montages. - MainAnimInstance->Montage_Stop(0.2f); + if (MainAnimInstance) + { + MainAnimInstance->Montage_Stop(0.2f); + } // Fixes character mesh is showing default A pose for a split-second just before ragdoll ends in listen server games GetMesh()->bOnlyAllowAutonomousTickPose = true; @@ -258,21 +249,21 @@ void AALSBaseCharacter::RagdollEnd() GetMesh()->bOnlyAllowAutonomousTickPose = false; SetReplicateMovement(true); - if (!MainAnimInstance) + // Step 1: Save a snapshot of the current Ragdoll Pose for use in AnimGraph to blend out of the ragdoll + if (MainAnimInstance) { - return; + MainAnimInstance->SavePoseSnapshot(NAME_RagdollPose); } - // Step 1: Save a snapshot of the current Ragdoll Pose for use in AnimGraph to blend out of the ragdoll - MainAnimInstance->SavePoseSnapshot(NAME_RagdollPose); - // Step 2: If the ragdoll is on the ground, set the movement mode to walking and play a Get Up animation. // If not, set the movement mode to falling and update the character movement velocity to match the last ragdoll velocity. if (bRagdollOnGround) { GetCharacterMovement()->SetMovementMode(MOVE_Walking); - MainAnimInstance->Montage_Play(GetGetUpAnimation(bRagdollFaceUp), - 1.0f, EMontagePlayReturnType::MontageLength, 0.0f, true); + if (MainAnimInstance) + { + MainAnimInstance->Montage_Play(GetGetUpAnimation(bRagdollFaceUp), 1.0f, EMontagePlayReturnType::MontageLength, 0.0f, true); + } } else { @@ -297,33 +288,29 @@ void AALSBaseCharacter::Server_SetMeshLocationDuringRagdoll_Implementation(FVect TargetRagdollLocation = MeshLocation; } -void AALSBaseCharacter::SetMovementState(const EALSMovementState NewState) +void AALSBaseCharacter::SetMovementState(const EALSMovementState NewState, bool bForce) { - if (MovementState != NewState) + if (bForce || MovementState != NewState) { PrevMovementState = MovementState; MovementState = NewState; - FALSAnimCharacterInformation& AnimData = MainAnimInstance->GetCharacterInformationMutable(); - AnimData.PrevMovementState = PrevMovementState; - MainAnimInstance->MovementState = MovementState; OnMovementStateChanged(PrevMovementState); } } -void AALSBaseCharacter::SetMovementAction(const EALSMovementAction NewAction) +void AALSBaseCharacter::SetMovementAction(const EALSMovementAction NewAction, bool bForce) { - if (MovementAction != NewAction) + if (bForce || MovementAction != NewAction) { const EALSMovementAction Prev = MovementAction; MovementAction = NewAction; - MainAnimInstance->MovementAction = MovementAction; OnMovementActionChanged(Prev); } } -void AALSBaseCharacter::SetStance(const EALSStance NewStance) +void AALSBaseCharacter::SetStance(const EALSStance NewStance, bool bForce) { - if (Stance != NewStance) + if (bForce || Stance != NewStance) { const EALSStance Prev = Stance; Stance = NewStance; @@ -331,9 +318,9 @@ void AALSBaseCharacter::SetStance(const EALSStance NewStance) } } -void AALSBaseCharacter::SetGait(const EALSGait NewGait) +void AALSBaseCharacter::SetGait(const EALSGait NewGait, bool bForce) { - if (Gait != NewGait) + if (bForce || Gait != NewGait) { const EALSGait Prev = Gait; Gait = NewGait; @@ -384,9 +371,9 @@ void AALSBaseCharacter::Server_SetDesiredRotationMode_Implementation(EALSRotatio SetDesiredRotationMode(NewRotMode); } -void AALSBaseCharacter::SetRotationMode(const EALSRotationMode NewRotationMode) +void AALSBaseCharacter::SetRotationMode(const EALSRotationMode NewRotationMode, bool bForce) { - if (RotationMode != NewRotationMode) + if (bForce || RotationMode != NewRotationMode) { const EALSRotationMode Prev = RotationMode; RotationMode = NewRotationMode; @@ -394,20 +381,20 @@ void AALSBaseCharacter::SetRotationMode(const EALSRotationMode NewRotationMode) if (GetLocalRole() == ROLE_AutonomousProxy) { - Server_SetRotationMode(NewRotationMode); + Server_SetRotationMode(NewRotationMode, bForce); } } } -void AALSBaseCharacter::Server_SetRotationMode_Implementation(EALSRotationMode NewRotationMode) +void AALSBaseCharacter::Server_SetRotationMode_Implementation(EALSRotationMode NewRotationMode, bool bForce) { - SetRotationMode(NewRotationMode); + SetRotationMode(NewRotationMode, bForce); } -void AALSBaseCharacter::SetViewMode(const EALSViewMode NewViewMode) +void AALSBaseCharacter::SetViewMode(const EALSViewMode NewViewMode, bool bForce) { - if (ViewMode != NewViewMode) + if (bForce || ViewMode != NewViewMode) { const EALSViewMode Prev = ViewMode; ViewMode = NewViewMode; @@ -415,19 +402,19 @@ void AALSBaseCharacter::SetViewMode(const EALSViewMode NewViewMode) if (GetLocalRole() == ROLE_AutonomousProxy) { - Server_SetViewMode(NewViewMode); + Server_SetViewMode(NewViewMode, bForce); } } } -void AALSBaseCharacter::Server_SetViewMode_Implementation(EALSViewMode NewViewMode) +void AALSBaseCharacter::Server_SetViewMode_Implementation(EALSViewMode NewViewMode, bool bForce) { - SetViewMode(NewViewMode); + SetViewMode(NewViewMode, bForce); } -void AALSBaseCharacter::SetOverlayState(const EALSOverlayState NewState) +void AALSBaseCharacter::SetOverlayState(const EALSOverlayState NewState, bool bForce) { - if (OverlayState != NewState) + if (bForce || OverlayState != NewState) { const EALSOverlayState Prev = OverlayState; OverlayState = NewState; @@ -435,15 +422,15 @@ void AALSBaseCharacter::SetOverlayState(const EALSOverlayState NewState) if (GetLocalRole() == ROLE_AutonomousProxy) { - Server_SetOverlayState(NewState); + Server_SetOverlayState(NewState, bForce); } } } -void AALSBaseCharacter::Server_SetOverlayState_Implementation(EALSOverlayState NewState) +void AALSBaseCharacter::Server_SetOverlayState_Implementation(EALSOverlayState NewState, bool bForce) { - SetOverlayState(NewState); + SetOverlayState(NewState, bForce); } void AALSBaseCharacter::EventOnLanded() @@ -480,19 +467,27 @@ void AALSBaseCharacter::EventOnJumped() { // Set the new In Air Rotation to the velocity rotation if speed is greater than 100. InAirRotation = Speed > 100.0f ? LastVelocityRotation : GetActorRotation(); - MainAnimInstance->OnJumped(); + + if (MainAnimInstance) + { + MainAnimInstance->OnJumped(); + } } void AALSBaseCharacter::Server_PlayMontage_Implementation(UAnimMontage* Montage, float PlayRate) { - MainAnimInstance->Montage_Play(Montage, PlayRate); + if (MainAnimInstance) + { + MainAnimInstance->Montage_Play(Montage, PlayRate); + } + ForceNetUpdate(); Multicast_PlayMontage(Montage, PlayRate); } void AALSBaseCharacter::Multicast_PlayMontage_Implementation(UAnimMontage* Montage, float PlayRate) { - if (!IsLocallyControlled()) + if (MainAnimInstance && !IsLocallyControlled()) { MainAnimInstance->Montage_Play(Montage, PlayRate); } @@ -541,10 +536,25 @@ void AALSBaseCharacter::SetMovementModel() MovementData = *OutRow; } +void AALSBaseCharacter::ForceUpdateCharacterState() +{ + SetGait(DesiredGait, true); + SetStance(DesiredStance, true); + SetRotationMode(DesiredRotationMode, true); + SetViewMode(ViewMode, true); + SetOverlayState(OverlayState, true); + SetMovementState(MovementState, true); + SetMovementAction(MovementAction, true); +} + void AALSBaseCharacter::SetHasMovementInput(bool bNewHasMovementInput) { bHasMovementInput = bNewHasMovementInput; - MainAnimInstance->GetCharacterInformationMutable().bHasMovementInput = bHasMovementInput; + + if (MainAnimInstance) + { + MainAnimInstance->GetCharacterInformationMutable().bHasMovementInput = bHasMovementInput; + } } FALSMovementSettings AALSBaseCharacter::GetTargetMovementSettings() const @@ -620,7 +630,11 @@ bool AALSBaseCharacter::CanSprint() const void AALSBaseCharacter::SetIsMoving(bool bNewIsMoving) { bIsMoving = bNewIsMoving; - MainAnimInstance->GetCharacterInformationMutable().bIsMoving = bIsMoving; + + if (MainAnimInstance) + { + MainAnimInstance->GetCharacterInformationMutable().bIsMoving = bIsMoving; + } } FVector AALSBaseCharacter::GetMovementInput() const @@ -631,13 +645,21 @@ FVector AALSBaseCharacter::GetMovementInput() const void AALSBaseCharacter::SetMovementInputAmount(float NewMovementInputAmount) { MovementInputAmount = NewMovementInputAmount; - MainAnimInstance->GetCharacterInformationMutable().MovementInputAmount = MovementInputAmount; + + if (MainAnimInstance) + { + MainAnimInstance->GetCharacterInformationMutable().MovementInputAmount = MovementInputAmount; + } } void AALSBaseCharacter::SetSpeed(float NewSpeed) { Speed = NewSpeed; - MainAnimInstance->GetCharacterInformationMutable().Speed = Speed; + + if (MainAnimInstance) + { + MainAnimInstance->GetCharacterInformationMutable().Speed = Speed; + } } float AALSBaseCharacter::GetAnimCurveValue(FName CurveName) const @@ -708,7 +730,11 @@ void AALSBaseCharacter::SetAcceleration(const FVector& NewAcceleration) Acceleration = (NewAcceleration != FVector::ZeroVector || IsLocallyControlled()) ? NewAcceleration : Acceleration / 2; - MainAnimInstance->GetCharacterInformationMutable().Acceleration = Acceleration; + + if (MainAnimInstance) + { + MainAnimInstance->GetCharacterInformationMutable().Acceleration = Acceleration; + } } void AALSBaseCharacter::RagdollUpdate(float DeltaTime) @@ -826,6 +852,13 @@ void AALSBaseCharacter::OnMovementModeChanged(EMovementMode PrevMovementMode, ui void AALSBaseCharacter::OnMovementStateChanged(const EALSMovementState PreviousState) { + if (MainAnimInstance) + { + FALSAnimCharacterInformation& AnimData = MainAnimInstance->GetCharacterInformationMutable(); + AnimData.PrevMovementState = PrevMovementState; + MainAnimInstance->MovementState = MovementState; + } + if (MovementState == EALSMovementState::InAir) { if (MovementAction == EALSMovementAction::None) @@ -852,6 +885,11 @@ void AALSBaseCharacter::OnMovementStateChanged(const EALSMovementState PreviousS void AALSBaseCharacter::OnMovementActionChanged(const EALSMovementAction PreviousAction) { + if (MainAnimInstance) + { + MainAnimInstance->MovementAction = MovementAction; + } + // Make the character crouch if performing a roll. if (MovementAction == EALSMovementAction::Rolling) { @@ -878,7 +916,10 @@ void AALSBaseCharacter::OnMovementActionChanged(const EALSMovementAction Previou void AALSBaseCharacter::OnStanceChanged(const EALSStance PreviousStance) { - MainAnimInstance->Stance = Stance; + if (MainAnimInstance) + { + MainAnimInstance->Stance = Stance; + } if (CameraBehavior) { @@ -890,7 +931,11 @@ void AALSBaseCharacter::OnStanceChanged(const EALSStance PreviousStance) void AALSBaseCharacter::OnRotationModeChanged(EALSRotationMode PreviousRotationMode) { - MainAnimInstance->RotationMode = RotationMode; + if (MainAnimInstance) + { + MainAnimInstance->RotationMode = RotationMode; + } + if (RotationMode == EALSRotationMode::VelocityDirection && ViewMode == EALSViewMode::FirstPerson) { // If the new rotation mode is Velocity Direction and the character is in First Person, @@ -908,7 +953,10 @@ void AALSBaseCharacter::OnRotationModeChanged(EALSRotationMode PreviousRotationM void AALSBaseCharacter::OnGaitChanged(const EALSGait PreviousGait) { - MainAnimInstance->Gait = Gait; + if (MainAnimInstance) + { + MainAnimInstance->Gait = Gait; + } if (CameraBehavior) { @@ -918,7 +966,11 @@ void AALSBaseCharacter::OnGaitChanged(const EALSGait PreviousGait) void AALSBaseCharacter::OnViewModeChanged(const EALSViewMode PreviousViewMode) { - MainAnimInstance->GetCharacterInformationMutable().ViewMode = ViewMode; + if (MainAnimInstance) + { + MainAnimInstance->GetCharacterInformationMutable().ViewMode = ViewMode; + } + if (ViewMode == EALSViewMode::ThirdPerson) { if (RotationMode == EALSRotationMode::VelocityDirection || RotationMode == EALSRotationMode::LookingDirection) @@ -941,7 +993,10 @@ void AALSBaseCharacter::OnViewModeChanged(const EALSViewMode PreviousViewMode) void AALSBaseCharacter::OnOverlayStateChanged(const EALSOverlayState PreviousState) { - MainAnimInstance->OverlayState = OverlayState; + if (MainAnimInstance) + { + MainAnimInstance->OverlayState = OverlayState; + } } void AALSBaseCharacter::OnVisibleMeshChanged(const USkeletalMesh* PrevVisibleMesh) @@ -958,15 +1013,8 @@ void AALSBaseCharacter::OnVisibleMeshChanged(const USkeletalMesh* PrevVisibleMes } } - // Force set variables in anim bp. This ensures anim instance & character stay synchronized on mesh changes - FALSAnimCharacterInformation& AnimData = MainAnimInstance->GetCharacterInformationMutable(); - MainAnimInstance->Gait = Gait; - MainAnimInstance->Stance = Stance; - MainAnimInstance->RotationMode = RotationMode; - AnimData.ViewMode = ViewMode; - MainAnimInstance->OverlayState = OverlayState; - AnimData.PrevMovementState = PrevMovementState; - MainAnimInstance->MovementState = MovementState; + // Force set variables. This ensures anim instance & character stay synchronized on mesh changes + ForceUpdateCharacterState(); } void AALSBaseCharacter::OnStartCrouch(float HalfHeightAdjust, float ScaledHalfHeightAdjust) @@ -1114,7 +1162,7 @@ void AALSBaseCharacter::UpdateGroundedRotation(float DeltaTime) else { // Walking or Running.. - const float YawOffsetCurveVal = MainAnimInstance->GetCurveValue(NAME_YawOffset); + const float YawOffsetCurveVal = MainAnimInstance ? MainAnimInstance->GetCurveValue(NAME_YawOffset) : 0.f; YawValue = AimingRotation.Yaw + YawOffsetCurveVal; } SmoothCharacterRotation({0.0f, YawValue, 0.0f}, 500.0f, GroundedRotationRate, DeltaTime); @@ -1139,7 +1187,7 @@ void AALSBaseCharacter::UpdateGroundedRotation(float DeltaTime) // The Rotation Amount curve defines how much rotation should be applied each frame, // and is calculated for animations that are animated at 30fps. - const float RotAmountCurve = MainAnimInstance->GetCurveValue(NAME_RotationAmount); + const float RotAmountCurve = MainAnimInstance ? MainAnimInstance->GetCurveValue(NAME_RotationAmount) : 0.f; if (FMath::Abs(RotAmountCurve) > 0.001f) { diff --git a/Source/ALSV4_CPP/Private/Components/ALSDebugComponent.cpp b/Source/ALSV4_CPP/Private/Components/ALSDebugComponent.cpp index 3822039c..879fcff9 100644 --- a/Source/ALSV4_CPP/Private/Components/ALSDebugComponent.cpp +++ b/Source/ALSV4_CPP/Private/Components/ALSDebugComponent.cpp @@ -34,7 +34,7 @@ void UALSDebugComponent::TickComponent(float DeltaTime, ELevelTick TickType, Super::TickComponent(DeltaTime, TickType, ThisTickFunction); #if !UE_BUILD_SHIPPING - if (!OwnerCharacter || OwnerCharacter->GetLocalRole() != ROLE_Authority) + if (!OwnerCharacter) { return; } diff --git a/Source/ALSV4_CPP/Public/Character/ALSBaseCharacter.h b/Source/ALSV4_CPP/Public/Character/ALSBaseCharacter.h index 517bf86c..8b012a24 100644 --- a/Source/ALSV4_CPP/Public/Character/ALSBaseCharacter.h +++ b/Source/ALSV4_CPP/Public/Character/ALSBaseCharacter.h @@ -77,7 +77,7 @@ class ALSV4_CPP_API AALSBaseCharacter : public ACharacter /** Character States */ UFUNCTION(BlueprintCallable, Category = "ALS|Character States") - void SetMovementState(EALSMovementState NewState); + void SetMovementState(EALSMovementState NewState, bool bForce = false); UFUNCTION(BlueprintGetter, Category = "ALS|Character States") EALSMovementState GetMovementState() const { return MovementState; } @@ -86,19 +86,19 @@ class ALSV4_CPP_API AALSBaseCharacter : public ACharacter EALSMovementState GetPrevMovementState() const { return PrevMovementState; } UFUNCTION(BlueprintCallable, Category = "ALS|Character States") - void SetMovementAction(EALSMovementAction NewAction); + void SetMovementAction(EALSMovementAction NewAction, bool bForce = false); UFUNCTION(BlueprintGetter, Category = "ALS|Character States") EALSMovementAction GetMovementAction() const { return MovementAction; } UFUNCTION(BlueprintCallable, Category = "ALS|Character States") - void SetStance(EALSStance NewStance); + void SetStance(EALSStance NewStance, bool bForce = false); UFUNCTION(BlueprintGetter, Category = "ALS|Character States") EALSStance GetStance() const { return Stance; } UFUNCTION(BlueprintCallable, Category = "ALS|Character States") - void SetGait(EALSGait NewGait); + void SetGait(EALSGait NewGait, bool bForce = false); UFUNCTION(BlueprintGetter, Category = "ALS|Character States") EALSGait GetGait() const { return Gait; } @@ -107,28 +107,28 @@ class ALSV4_CPP_API AALSBaseCharacter : public ACharacter EALSGait GetDesiredGait() const { return DesiredGait; } UFUNCTION(BlueprintCallable, Category = "ALS|Character States") - void SetRotationMode(EALSRotationMode NewRotationMode); + void SetRotationMode(EALSRotationMode NewRotationMode, bool bForce = false); UFUNCTION(BlueprintCallable, Server, Reliable, Category = "ALS|Character States") - void Server_SetRotationMode(EALSRotationMode NewRotationMode); + void Server_SetRotationMode(EALSRotationMode NewRotationMode, bool bForce); UFUNCTION(BlueprintGetter, Category = "ALS|Character States") EALSRotationMode GetRotationMode() const { return RotationMode; } UFUNCTION(BlueprintCallable, Category = "ALS|Character States") - void SetViewMode(EALSViewMode NewViewMode); + void SetViewMode(EALSViewMode NewViewMode, bool bForce = false); UFUNCTION(BlueprintCallable, Server, Reliable, Category = "ALS|Character States") - void Server_SetViewMode(EALSViewMode NewViewMode); + void Server_SetViewMode(EALSViewMode NewViewMode, bool bForce); UFUNCTION(BlueprintGetter, Category = "ALS|Character States") EALSViewMode GetViewMode() const { return ViewMode; } UFUNCTION(BlueprintCallable, Category = "ALS|Character States") - void SetOverlayState(EALSOverlayState NewState); + void SetOverlayState(EALSOverlayState NewState, bool bForce = false); UFUNCTION(BlueprintCallable, Server, Reliable, Category = "ALS|Character States") - void Server_SetOverlayState(EALSOverlayState NewState); + void Server_SetOverlayState(EALSOverlayState NewState, bool bForce); UFUNCTION(BlueprintGetter, Category = "ALS|Character States") EALSOverlayState GetOverlayState() const { return OverlayState; } @@ -381,6 +381,8 @@ class ALSV4_CPP_API AALSBaseCharacter : public ACharacter void SetMovementModel(); + void ForceUpdateCharacterState(); + /** Input */ void PlayerForwardMovementInput(float Value); diff --git a/Source/ALSV4_CPP/Public/Character/ALSCharacterMovementComponent.h b/Source/ALSV4_CPP/Public/Character/ALSCharacterMovementComponent.h index 42db76a0..3610c224 100644 --- a/Source/ALSV4_CPP/Public/Character/ALSCharacterMovementComponent.h +++ b/Source/ALSV4_CPP/Public/Character/ALSCharacterMovementComponent.h @@ -21,7 +21,7 @@ class ALSV4_CPP_API UALSCharacterMovementComponent : public UCharacterMovementCo { GENERATED_UCLASS_BODY() - class FSavedMove_My : public FSavedMove_Character + class ALSV4_CPP_API FSavedMove_My : public FSavedMove_Character { public: @@ -38,7 +38,7 @@ class ALSV4_CPP_API UALSCharacterMovementComponent : public UCharacterMovementCo EALSGait SavedAllowedGait = EALSGait::Walking; }; - class FNetworkPredictionData_Client_My : public FNetworkPredictionData_Client_Character + class ALSV4_CPP_API FNetworkPredictionData_Client_My : public FNetworkPredictionData_Client_Character { public: FNetworkPredictionData_Client_My(const UCharacterMovementComponent& ClientMovement);