# How to compile a custom EQS test?

**URL:** <https://forums.unrealengine.com/t/how-to-compile-a-custom-eqs-test/658792>\
**Category:** Getting Started & Setup\
**Tags:** unreal-engine, UE5-0, question\
**Created:** [September 29, 2022, 7:00am UTC](https://forums.unrealengine.com/t/how-to-compile-a-custom-eqs-test/658792 "2022-09-29T07:00:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [September 29, 2022, 7:00am UTC](https://forums.unrealengine.com/t/how-to-compile-a-custom-eqs-test/658792/1 "2022-09-29T07:00:33Z")

</div>

I want to make a very simple filter for an environment query.

This is the query:

 ![00-Query](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/0/d/90dad02afc65980bf15c985f0a95731e427e9f85.png)

I just want the AI to find the weapons that don’t has an owner.

In blueprint it would be something like this (I haven’t tested the code yet)

 ![01-test](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/6/2/762455a7e0bae79e5f56f5d74678b217ac32edd7.png)

I have been looking for information to make my own test but according to what I have read it can only be done in C++.

Source:

> [@Custom EQS test](https://forums.unrealengine.com/t/custom-eqs-test/435305):
>
> Hello here, I want to create a custom EQS test, however it’s not possible in Blueprint and I can’t find any documentation on how to achieve it in C++. Can someone lead me where to start or provide any documentation about this subject please?

So I tried to follow the instructions but I have many doubts.

Instructions:

> **[How to Write an EQS Test in UE4 | Mercuna](https://mercuna.com/writing-eqs-test/)**
>
> Mercuna uses EQS tests in our navigation middleware. Learn how we do it

Class reference:

> **[FEnvQueryResult](https://docs.unrealengine.com/5.0/en-US/API/Runtime/AIModule/EnvironmentQuery/FEnvQueryResult/)**

At the moment I only know that the class must have this structure and you override these virtual functions.

 ![2-class](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/2/4/c244e3ef39fc5696862610dfae2c980c36ee6de7.png)

So the questions are:  
-What Libraries must be included?  
-Can be it edited with Visual Studio?  
-What type of project should be created?  
-Is there any PATH given to the linker and/or compiler? How to do it?  
-Once it is compiled, how to integrate it into Unreal?

I know, a lot of newbie questions!!

Perhaps a complete step-by-step example would be of great help!!

Thank you so much!!

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [September 30, 2022, 6:12am UTC](https://forums.unrealengine.com/t/how-to-compile-a-custom-eqs-test/658792/2 "2022-09-30T06:12:41Z")

</div>

Ok… everything was a complete disaster!!

I tried to follow some tutorials

This video:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/3/3/53378494d60e1fa6f75f9f1fbec820f6cef2420c.jpeg "UE5 How to make a custom EQS Test for water (C++)") ](https://www.youtube.com/watch?v=rZ6hsf3wccM)

And this video:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/e/8/2e8d424190cd3b10607dda2864eea81be538d764.jpeg "How to Setup Visual Studio 2022 for Unreal Engine") ](https://www.youtube.com/watch?v=8xJRr6Yr_LU)

But everything went wrong.  
Create a new C++ class and all the problems started.

 ![1-newCPP](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/2/0/c20cba2c88e517a66fae7ba4a6507a7f54b0b7fc.png)  
 ![2-parent](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/e/5/7e5a7f4087f4ce4193501f8f92f11c391778ade3.png)  
 ![3-path](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/6/a/56ae3c533e7457bf736d41c64946fc597458844a.png)

It asks me to recompile the editor for my IDE.  
 ![4-BuildForIDE](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/2/5/d25f9f62f0c2b46fc74c47126827f9a63d8d699c.png)

It also asks me to recompile the project.  
 ![5-recompilePorject](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/b/8/5b87e9ce25c51d985a062064c119ede8ab9cb479.png)

Hidden levels is also a problem  
 ![6-hiddenLevel](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/0/4/2042c8e87f24be0855b38c695d4cb1ee8d1429f7.png)

So I go to GitHub and get the Unreal 5 source code

 ![10-souceCode](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/3/f/b3fd80a604cd5ca7dad95b2b2322a5142d0feba5.png)

But the scripts don’t work and it doesn’t generate the project files

 ![7-ErrorGeneratingFiles](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/f/c/cfc57e6782b0ea8966a4878f47ce5573e75b85f1.png)

So I want to open my project and still not use C++, but the project won’t open because it doesn’t recognize the version. He asks me to rebuild it.

![11-modules missing](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/c/8/1c85e9a1c0fdbf49af708ae0ac5fa23ffeaf20ab.png)

I choose the option “YES” and it does not work.

![12-rebuid manually](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/0/b/e0bc12890380838b6e46a033d582635a1206f210.png)

Now I’m locked in a dead end.

Luckily I have a backup of my project. I can fix everything without losing my progress. I just had to replace the “Content” folder of my latest version in the previous version.

But all this was a very bad experience!!

That’s why I want to ask the people of Unreal to please make manuals or tutorials to be able to do this kind of thing safely.

I have come close to losing entire months of work.  
I was very lucky to have made a backup beforehand.

Thank you very much!!

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [January 18, 2025, 1:41pm UTC](https://forums.unrealengine.com/t/how-to-compile-a-custom-eqs-test/658792/3 "2025-01-18T13:41:32Z")

</div>

I just found this post again after two years.  
I want to say, i managed to compile the test.  
From the date of the post I guess I was only using blueprints at that time.

Bad idea.

* * *

Solution:

0-Do not download or compile the GidHub engine source code  
1-Create a new C++ project and migrate all your files to the new project.  
2-Learn how to configure the .uproject file  
3-Learn how to configure the .Target.cs file  
4-Learn how to configure the .Build.cs file  
5-Nativize all your blueprints to C++  
6-Never use Visual Studio again  
7-DONE!!

* * *

Now you are free and you have all the power of C++ in your hands.  
Nothing can stop you now!! 🙂

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [February 17, 2025, 1:41pm UTC](https://forums.unrealengine.com/t/how-to-compile-a-custom-eqs-test/658792/4 "2025-02-17T13:41:56Z")

</div>

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