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"

EnvQueryTest not working?

I tried to create a custom test ... however the test result is always false ?!

UEnvQueryTest_ValueIsSet.h

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #pragma once
 
 #include "CoreMinimal.h"
 #include "EnvironmentQuery/EnvQueryTest.h"
 #include "UEnvQueryTest_ValueIsSet.generated.h"
 
 /**
  * 
  */
 UCLASS()
 class CASINO_API UUEnvQueryTest_ValueIsSet : public UEnvQueryTest
 {
     GENERATED_BODY()
 
     UUEnvQueryTest_ValueIsSet(const FObjectInitializer& ObjectInitializer);
     
     virtual void RunTest(FEnvQueryInstance& QueryInstance) const override;
     virtual FText GetDescriptionTitle() const override;
     virtual FText GetDescriptionDetails() const override;
 
 
 };


UEnvQueryTest_ValueIsSet.cpp

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #include "UEnvQueryTest_ValueIsSet.h"
 #include "SlotMachineActorBase.h"
 #include "EnvironmentQuery/Items/EnvQueryItemType_ActorBase.h"
 #include "Runtime/Engine/Classes/Engine/Engine.h"
 
 
 UUEnvQueryTest_ValueIsSet::UUEnvQueryTest_ValueIsSet(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
 {
     Cost = EEnvTestCost::Low;
     ValidItemType = UEnvQueryItemType_ActorBase::StaticClass();
 }
 
 void UUEnvQueryTest_ValueIsSet::RunTest(FEnvQueryInstance & QueryInstance) const
 {
 
     for (FEnvQueryInstance::ItemIterator It(this, QueryInstance); It; ++It)
     {
         
         GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("SetScore"));
         It.SetScore(TestPurpose, FilterType, true,true);
     }
 
 }
 
 FText UUEnvQueryTest_ValueIsSet::GetDescriptionTitle() const
 {
     return FText();
 }
 
 FText UUEnvQueryTest_ValueIsSet::GetDescriptionDetails() const
 {
     return FText();
 }
 


What am I missing? I couldnt find any doccumentation regarding custom test's. Is it a Bug (am I getting it wrong ? am I not setting the score to the desired result so it should pass the test ?)?

Product Version: UE 4.20
Tags:
more ▼

asked Dec 07 '18 at 10:46 AM in C++ Programming

avatar image

L1ne
11 2 4 9

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

My Fault ... FilterType has to be "EEnvTestFilterType::Match" then it works fine!

more ▼

answered Dec 08 '18 at 11:12 AM

avatar image

L1ne
11 2 4 9

(comments are locked)
10|2000 characters needed characters left
Your answer
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