Announcement

Collapse
No announcement yet.

Able Ability System Info and Support Thread

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Originally posted by ExtraLifeMatt View Post

    There is a C++ version on the AbilityComponent that is called whenever an Ability is started (FOnAbilityStart). On the Ability itself, there is no C++ version to override. I'm adding that in the next update for people who don't want to use a Blueprint version (or require some extra work done in C++ before tossing things to BP).

    Next update will be out shortly after 4.19 is available.
    Alright, looking forward to it! I need because I want to put a "stamina cost" variable inside my melee attack ability (which will serve as the parent for every melee attack) and I need access to it in C++ to make sure the character has enough Stamina before actually executing the ability.

    Leave a comment:


  • replied
    wait what... first it takes sequence as input not montage? and second it uses ability montage slot (didnt know it exist) instead of one you have defined in anim montage?
    argh... I've been using it wrong? lemme check today.

    Leave a comment:


  • replied
    Originally posted by AngeIV View Post
    And you will fix ability anim montage blend?
    As far as I can see, that should be working. If you pass in a sequence animation, it plays it as a dynamic montage in the "Ability" Slot with all the various blending values passed in. If you pass it just a montage, it simply plays that montage.

    I can remove the hardcoded "Ability" slot and let users choose a slot to play it as, but other than that I'll take another look around and see if those methods aren't doing what they should be.

    Leave a comment:


  • replied
    And you will fix ability anim montage blend?

    Leave a comment:


  • replied
    Originally posted by jfaztk View Post
    Hello,

    OnAbilityStart() is a BlueprintImplementableEvent; does this mean I can't override/define it in a C++ ability?
    There is a C++ version on the AbilityComponent that is called whenever an Ability is started (FOnAbilityStart). On the Ability itself, there is no C++ version to override. I'm adding that in the next update for people who don't want to use a Blueprint version (or require some extra work done in C++ before tossing things to BP).

    Next update will be out shortly after 4.19 is available.

    Leave a comment:


  • replied
    Hello,

    OnAbilityStart() is a BlueprintImplementableEvent; does this mean I can't override/define it in a C++ ability?

    Leave a comment:


  • replied
    I fixed it, thanks!

    Leave a comment:


  • replied
    Originally posted by fernmerc View Post

    Well I'm not sure how the system works so I just assumed I needed them since they're referenced a few times in the original AblPlayParticleEffectTask... I added AbleCore to the PrivateIncludePaths and that got rid of most errors, all that I get now is:

    Code:
    Error LNK2019 unresolved external symbol "private: static class UClass * __cdecl UAblParticleEffectParamContextActor::GetPrivateStaticClass(void)" (?GetPrivateStaticClass@UAblParticleEffectParamContextActor@@CAPEAVUClass@@XZ) referenced in function "public: virtual void __cdecl UAblPlayParticleEffectAutoScaled::OnTaskStart(struct TWeakObjectPtr<class UAblAbilityContext const ,struct FWeakObjectPtr> const &)const " (?OnTaskStart@UAblPlayParticleEffectAutoScaled@@UEBAXAEBU?$TWeakObjectPtr@$$CBVUAblAbilityContext@@UFWeakObjectPtr@@@@@Z)
    The error happens thanks to this code:
    Code:
    // Set our Parameters.
    for (UAblParticleEffectParam* Parameter : m_Parameters)
    {
    if (Parameter->IsA<UAblParticleEffectParamContextActor>())
    {
    UAblParticleEffectParamContextActor* ContextActorParam = Cast<UAblParticleEffectParamContextActor>(Parameter);
    if (AActor* FoundActor = GetSingleActorFromTargetType(Context, ContextActorParam->GetContextActorType()))
    {
    SpawnedEffect->SetActorParameter(ContextActorParam->GetParameterName(), FoundActor);
    }
    }
    if (Parameter->IsA<UAblParticleEffectParamLocation>())
    {
    UAblParticleEffectParamLocation* LocationParam = Cast<UAblParticleEffectParamLocation>(Parameter);
    FTransform outTransform;
    LocationParam->GetLocation().GetTransform(*Context.Get(), outTransform);
    SpawnedEffect->SetVectorParameter(LocationParam->GetParameterName(), outTransform.GetTranslation());
    }
    }
    The error specifically mentions UAblParticleEffectParamLocation and UAblParticleEffectParamContextActor, any clue what it could be?

    Thanks!
    I assume those are the classes you added? When you see "GetPrivateStaticClass" that means you likely don't have the class exported(e.g. class MYGAME_API UMyClass).

    Leave a comment:


  • replied
    Originally posted by ExtraLifeMatt View Post

    Why are you using my Logging macros? You can use your own if that's the only thing you're trying to pull from the AbleCorePrivate.h, otherwise you'll need to add AbleCore to your PrivateIncludePaths in your .build.cs.
    Well I'm not sure how the system works so I just assumed I needed them since they're referenced a few times in the original AblPlayParticleEffectTask... I added AbleCore to the PrivateIncludePaths and that got rid of most errors, all that I get now is:

    Code:
    Error    LNK2019    unresolved external symbol "private: static class UClass * __cdecl UAblParticleEffectParamContextActor::GetPrivateStaticClass(void)" (?GetPrivateStaticClass@UAblParticleEffectParamContextActor@@CAPEAVUClass@@XZ) referenced in function "public: virtual void __cdecl UAblPlayParticleEffectAutoScaled::OnTaskStart(struct TWeakObjectPtr<class UAblAbilityContext const ,struct FWeakObjectPtr> const &)const " (?OnTaskStart@UAblPlayParticleEffectAutoScaled@@UEBAXAEBU?$TWeakObjectPtr@$$CBVUAblAbilityContext@@UFWeakObjectPtr@@@@@Z)
    The error happens thanks to this code:
    Code:
           
    // Set our Parameters.
            for (UAblParticleEffectParam* Parameter : m_Parameters)
            {
                if (Parameter->IsA<UAblParticleEffectParamContextActor>())
                {
                    UAblParticleEffectParamContextActor* ContextActorParam = Cast<UAblParticleEffectParamContextActor>(Parameter);
                    if (AActor* FoundActor = GetSingleActorFromTargetType(Context, ContextActorParam->GetContextActorType()))
                    {
                        SpawnedEffect->SetActorParameter(ContextActorParam->GetParameterName(), FoundActor);
                    }
                }
                if (Parameter->IsA<UAblParticleEffectParamLocation>())
                {
                    UAblParticleEffectParamLocation* LocationParam = Cast<UAblParticleEffectParamLocation>(Parameter);
                    FTransform outTransform;
                    LocationParam->GetLocation().GetTransform(*Context.Get(), outTransform);
                    SpawnedEffect->SetVectorParameter(LocationParam->GetParameterName(), outTransform.GetTranslation());
                }
            }
    The error specifically mentions UAblParticleEffectParamLocation and UAblParticleEffectParamContextActor, any clue what it could be?

    Thanks!

    Leave a comment:


  • replied
    Originally posted by fernmerc View Post

    I might end up going with the first approach, but the second approach sounds a bit cleaner to me so I want to try to it out (might even do both). I created the C++ task and I more or less duplicated the contents of AblPlayParticleEffectTask but I can't get it to work. I can't #include AbleCorePrivate.h, so I tried moving the logging Macros you set up in it into the task itself but I get compiler errors. Is there a specific way I should approach this? Thanks.
    Why are you using my Logging macros? You can use your own if that's the only thing you're trying to pull from the AbleCorePrivate.h, otherwise you'll need to add AbleCore to your PrivateIncludePaths in your .build.cs.

    Leave a comment:

Working...
X