x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Custom NavArea not working to make AI Jump.

I made a custom NavArea to have my AI jump with nav links however I don't know what is going on with it right now. I have a custom path following component that checks the area flags and will do something if jump is one however instead of it detecting the are of having a flag of 2 it thinks the flag is 0. The real quicker is that it was working when I loaded up the editor however after a build and a compile it stopped working. Here's the code:

UNavArea_Jump.h

 UCLASS()
 class PW_GAME_API UNavArea_Jump : public UNavArea
 {
     GENERATED_BODY()
     UNavArea_Jump(const FObjectInitializer& ObjectInitializer);
 
 public:
     enum AI_Path_Choice
     {
         Jump = 1
     };
 };

UNavArea_Jump.cpp

 UNavArea_Jump::UNavArea_Jump(const FObjectInitializer& ObjectInitializer)
     : Super(ObjectInitializer)
 {
     AreaFlags = (1 << AI_Path_Choice::Jump);
 }

Heres the PWPathFollowingComponent.cpp

 void UPWPathFollowingComponent::SetMoveSegment(int32 SegmentStartIndex)
 {
     Super::SetMoveSegment(SegmentStartIndex);
 
     UE_LOG(YourAI, Warning, TEXT("Set Move Segment Reached"));
 
     const uint16 AreaFlags = FNavMeshNodeFlags(Path->GetPathPoints()[SegmentStartIndex].Flags).AreaFlags;
     const uint16 JumpFlag = uint16(1 << UNavArea_Jump::Jump);
 
     FString checkAreaFlags = FString::FromInt(AreaFlags);
     FString checkJumpFlag = FString::FromInt(JumpFlag);
 
     UE_LOG(YourAI, Warning, TEXT("Area Flags: %s% / JumpFlag: %s%"),*checkAreaFlags, *checkJumpFlag);
 
     if ((AreaFlags & JumpFlag) != 0)
     {
         //Jumping code for path finding
         UE_LOG(YourAI, Log, TEXT("Jump Flag Hit"));
     }
 }

and heres a screenshot of the output log and the navlink selected in the details panel

alt text

Product Version: UE 4.8
Tags:
error.png (1.2 MB)
more ▼

asked Jul 16 '15 at 09:36 PM in C++ Programming

avatar image

Rynold
56 8 9 15

avatar image hellaeon Jan 03 '16 at 12:08 PM

So how did you end up implementing this? I am trying to figure this out currently. By chance could you share the solution? I cannot seem to detect the jump trigger area either

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question