What must i do in my event query generator to show statistics? C++

My custom generators doesn’t show performance statistics (they are derived from UEnvQueryGenerator)

I Was reading the class → UEnvQueryGenerator_ActorsOfClass ← that does show statistics. But I don’t see any special code related to statistics. Neither in the declaration nor in the implementation.

My class just overrides the function.
void GenerateItems(FEnvQueryInstance& QueryInstance) const;
Because I think I don’t need the other functions. And anyway, they don’t seem to be related to statistics…

What is the minimum I should do for my generator to show statistics?
Thank you so much!!

Hello!

I think that your query may be invalid in some way.
Try to play the game and look into OutputLog ,LogEQS category. It may show something like this:
image
In that case I did not set ItemType to anything.

For example, in mentioned ActorsOfClass ItemType is set here:

1 Like

Hi @nikita.aksenov
Thanks for your reply.
I have not error messages and the generator apparently works correctly.

I just found out that there is a way to display statistics… and it is running the game in simulation mode.

Is this normal?

Or I’m very absent-minded. Or I have a serious memory problem. Or they changed this in version 5.5.1…

The thing is, I don’t remember that stats only worked in simulation mode.
If it’s always been… I think I’m getting old. :man_facepalming:

Thank you so much for your help!!

1 Like

Hmm, seems weird :confused:

I’ve tried to replicate your situation:

  • Created custom generator, child of UEnvQueryGenerator
  • Override GenerateItems function, without any logic though
  • Set item type, so my query is valid
  • Run game as usual, in Selected Viewport

For me this setup works:

I’m on a UE 5.3 though, maybe in 5.5 something changed.

Sorry for not being able to help :c

1 Like

On the contrary… you are helping a lot.
Thanks to your code I just realized this.

For some reason → GENERATED_BODY() ← doesn’t work for me.
It only works if I use this → GENERATED_UCLASS_BODY()

I can’t declare a constructor either. The compiler tells me it already exists.

So I think there is some problem with the constructor and with the GENERATED_BODY() macro in generators…

I always had this problem on older versions of the engine… (Only with generators)…
So I don’t think it’s a problem with version 5.5.1. (I think I started using C++ in version 5.2 or 5.3).

The problem must be something else.

1 Like

Are you sure it’s not an error regarding your constructor script? UEQGLifeBonusGenerator is throwing Object inizalization errors. Did you create the more verbose version of the constructor correctly? Maybe you missed a super call?
in header:

UEQGLifeBonusGenerator (const FObjectInitializer& ObjectInitializer);

cpp

UEQGLifeBonusGenerator::UEQGLifeBonusGenerator (const FObjectInitializer& ObjectInitializer)
	: Super(ObjectInitializer)
{
// init code here
}

I’m guessing the class is named UEQGLifeBonusGenerator as unreal adds linker garbled info in the front.

Also make sure your initializer code is public

public:
UEQGLifeBonusGenerator (const FObjectInitializer& ObjectInitializer);

Your error also mentions

LNK1169: One or more simultaneously defined symbols were found

Did you include a cpp inside of a cpp?

2 Likes

That solved all the problems. Now it even works in the other game modes too.

UEQGLifeBonusGenerator(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());

I could swear I tried to do this the first time I got the error.

This time it worked the first time.

Thank you very much for the help @3dRaven and @nikita.aksenov

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.