From e032ddaaa5c8e76cac70be74bde3be0232d503d8 Mon Sep 17 00:00:00 2001 From: Kevin Poretti Date: Sat, 29 Jul 2023 21:18:34 -0400 Subject: [PATCH] Move state macros to plugin and make CanTransition virtual function --- Content/BPML_StateMacros.uasset | Bin 0 -> 65713 bytes .../Input/FFInputBufferComponent.cpp | 1 + .../UnrealFightingFramework/State/FFState.cpp | 72 ++++++++++-------- .../UnrealFightingFramework/State/FFState.h | 9 ++- .../State/FFStateMachineComponent.cpp | 17 ++++- .../State/FFStateMachineComponent.h | 13 +++- 6 files changed, 70 insertions(+), 42 deletions(-) create mode 100644 Content/BPML_StateMacros.uasset diff --git a/Content/BPML_StateMacros.uasset b/Content/BPML_StateMacros.uasset new file mode 100644 index 0000000000000000000000000000000000000000..be47fa1dc9839c0700e26f085253240c6282f3c8 GIT binary patch literal 65713 zcmeHQ34jyT`JW)5A}HR9BD-islq1RJL{xGv3oMJUSQQn*?kpSJ-7HBKTogscqbgdf zRck#c)@t#hmO{PJs#WX1*xGtvt*uh)Ew-NZ;Q#&Jn=hG6Cdp)3SZa5cWM;ni-uJ%y zeeb;q^XU0U-t_sFEnDX7q$mUWD9T54#<2^1#y@(R_sfZ!`fpyQ{OarlM;_jnU>6=R zbk4H6#ykJ|{C=xm`0YD`W)SS$KQD>j5vY6fz2hgXI%4g*hnopD{Ll3_JY0A9?a`ep zuYT^lHL+0y+vI#{^`N@%4O@5ihC5eI`r0#qV8^Au+ORadI`rB;S6-E>7`p#=2o^l; z$1g=|A3E&zJNH`FxqstpBMJ6?^Xg4+2e1Bkw~daKfd`^vjv(0i7c0t3G|`XfoESE=nX%9~+!jJ7xBabS$mb#u}1|6xHpkoKN3h+7tzhUN=ZlD(UR> zI0ANO(BX6W0*-Jr;&a(uj)*(pb@<)EP{2-A`&+aP~&?KQ53?Z3?VGT z>2oZ7mLG7-W0ybs*`$m1Ui{>`dn#{OJ2`Oopfw*%T>WCGc`x6(C8!TPAf%tthuTkg z>@wS4ba&KIGb8S!r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=LoK zbO3x9r*~#BPX6POaP($HyoY_O0W-tz@=p@Iww!;92s9=1!4Rn<99J41g&0rkb zfwL!g``;VjLJ&0_K6%PKN+JFSjk4{0`S??JyZEL7Q!ZM#^4Fb#r|#F=IgftW7%+~0 zX0VH3`X0V2U(InStateContext.Avatar); + if(SAI) + { + if(!(SAI->CheckStance(StanceRequired) && SAI->CheckStateEnabled(StateType) && SAI->CheckStateEntryConditions(EntryConditions))) + { + return false; + } + } + + IFFStateOwnerInterface* SOI = Cast(InStateContext.Owner); + if(SOI) + { + if(!SOI->CheckInputSequences(InputSequences)) + { + return false; + } + } + + return OnCanTransition(InStateContext); +} + + void UFFState::Enter(const FFFStateContext& InStateContext) { if(InStateContext.Avatar) @@ -54,43 +91,12 @@ void UFFState::Update(float OneFrame, const FFFStateContext& InStateContext) void UFFState::Finish(const FFFStateContext& InStateContext) { - InStateContext.Parent->SwitchToEntryState(); + InStateContext.Parent->GoToEntryState(); } -bool UFFState::CanTransition_Implementation(const FFFStateContext& InStateContext) +bool UFFState::OnCanTransition_Implementation(const FFFStateContext& InStateContext) { - /** - * Check to see if avatar implements StateAvatarInterface - * if so then - * Check if the avatar is in the correct stance to perform this action - * Check if the state is enabled - * Check that all state entry conditions are met if there are any - * - * Check to see if the owner implements the StateOwnerInterface - * Check input conditions if there are any - * - * If all state entry conditions are good and at least one input condition is good then we can transition - * so return true otherwise return false - */ - IFFStateAvatarInterface* SAI = Cast(InStateContext.Avatar); - if(SAI) - { - if(!(SAI->CheckStance(StanceRequired) && SAI->CheckStateEnabled(StateType) && SAI->CheckStateEntryConditions(EntryConditions))) - { - return false; - } - } - - IFFStateOwnerInterface* SOI = Cast(InStateContext.Owner); - if(SOI) - { - if(!SOI->CheckInputSequences(InputSequences)) - { - return false; - } - } - return true; } diff --git a/Source/UnrealFightingFramework/State/FFState.h b/Source/UnrealFightingFramework/State/FFState.h index 53edfea..bd73626 100644 --- a/Source/UnrealFightingFramework/State/FFState.h +++ b/Source/UnrealFightingFramework/State/FFState.h @@ -109,8 +109,7 @@ public: * all state entry conditions were met AND * at least one input sequence is present in the Owner's input buffer */ - UFUNCTION(BlueprintNativeEvent, Category="UFF|State") - bool CanTransition(const FFFStateContext& InStateContext); + virtual bool CanTransition(const FFFStateContext& InStateContext); /** * Called whenever this state is transitioned into. @@ -151,6 +150,12 @@ public: UFUNCTION(BlueprintCallable) virtual void Finish(const FFFStateContext& InStateContext); + /** + * Blueprint hook for overriding the CanTransition logic + */ + UFUNCTION(BlueprintNativeEvent, Category="UFF|State|Events") + bool OnCanTransition(const FFFStateContext& InStateContext); + /** * Blueprint hook for whenever this state is transitioned into */ diff --git a/Source/UnrealFightingFramework/State/FFStateMachineComponent.cpp b/Source/UnrealFightingFramework/State/FFStateMachineComponent.cpp index ab225f8..4af0eb3 100644 --- a/Source/UnrealFightingFramework/State/FFStateMachineComponent.cpp +++ b/Source/UnrealFightingFramework/State/FFStateMachineComponent.cpp @@ -85,7 +85,16 @@ void UFFStateMachineComponent::RemoveState(FName StateToRemove) UE_LOG(LogTemp, Error, TEXT("UFFStateMachineComponent::RemoveState is not yet implemented")); } -void UFFStateMachineComponent::SwitchStates(UFFState* NewState) +void UFFStateMachineComponent::GoToState(FName NewStateName) +{ + UFFState* NewState = FindStateWithName(NewStateName); + if(NewState) + { + GoToState(NewState); + } +} + +void UFFStateMachineComponent::GoToState(UFFState* NewState) { check(CurrentState); check(NewState); @@ -97,12 +106,12 @@ void UFFStateMachineComponent::SwitchStates(UFFState* NewState) CurrentSubStateLabel = NAME_None; } -void UFFStateMachineComponent::SwitchToEntryState() +void UFFStateMachineComponent::GoToEntryState() { // can't have an entry state if there are no states check(States.Num() > 0); - SwitchStates(States[0]); + GoToState(States[0]); } @@ -170,7 +179,7 @@ void UFFStateMachineComponent::FixedTick(float OneFrame) if(StateToTransitionTo && (CurrentState->Name != StateToTransitionTo->Name || StateToTransitionTo->bCanTransitionToSelf)) { - SwitchStates(StateToTransitionTo); + GoToState(StateToTransitionTo); } else { diff --git a/Source/UnrealFightingFramework/State/FFStateMachineComponent.h b/Source/UnrealFightingFramework/State/FFStateMachineComponent.h index 0c8f6fa..82066d9 100644 --- a/Source/UnrealFightingFramework/State/FFStateMachineComponent.h +++ b/Source/UnrealFightingFramework/State/FFStateMachineComponent.h @@ -62,19 +62,26 @@ public: */ void RemoveState(FName StateToRemove); + /** + * Transitions from CurrentState to the new state with the name passed to this function + * + * Triggers the Exit callback on the CurrentState and the Enter callback on the new state + */ + void GoToState(FName NewStateName); + /** * Transitions from CurrentState to the new state passed to this function * * Triggers the Exit callback on the CurrentState and the Enter callback on the new state */ - void SwitchStates(UFFState* NewState); + void GoToState(UFFState* NewState); /** * Transitions from CurrentState to the default entry state */ - void SwitchToEntryState(); + void GoToEntryState(); - UFUNCTION(BlueprintPure) + UFUNCTION(BlueprintPure) FORCEINLINE int64 GetTicksInState() const; /**