I’ve little problem in C++. I’m really new to the C++ API of UE4, and for my game’s project (tactical RPG), I wanted to create a tool (or even just a C++ class) which could be run in the editor, and where we could change two values : NumberRaws and NumberColomns, to generate on the fly a grid, directly in the map view of the editor.
So I’ve made my custom editor’s config, everything is compiled and work fine. After that, I decided to look at that tutorial : http://orfeasel.com/creating-custom-editor-assets/, to create a custom asset called “Grid” which could be my C++ class to generate the grid on the fly, directly in the editor.
So I added all of that C++ classes on my module’s directory (Grid.cpp/Grid.h and UGridFactory.cpp/UGridFactory.h). After that, I included “AssetTools” in the public dependencyModulesNames of my module Build.cs file. But here is the problem, when I include “AssetTypeCategories.h” in my Grid.cpp file (which is the class which handles the grid generation on the fly), that’s not recognized.
I’m certainly doind wrong things in one step, but where ? I really don’t know. Any help is appreciate guys Thank you really really much in advance !
After adding AssetTools did you close the editor and regenerated the project files? (Right click on uproject and select Generate Visual Studio project files).
You don’t need that semicolon for #include. I just tried adding #include “AssetTypeCategories.h” into my test project and it compiled successfully (4.17 p3) after adding “AssetTools” into the build file.
Oh sorry, that was a mistake No, I don’t have that “;” in my code.
Still have the problem… ;(
But did you try to add AssetTypesCategories.h in a module which launch in the editor ? Maybe the problem come from here, don’t you think ?
Oh wait, I didn’t include DynamicallyLoadedModulesNames, it’s probably because of that !
I just add the module like “UnrealEd”… with PublicIncludePathModuleNames.AddRange(new string] { “AssetTools” });
I did that because I follow the tutorial I linked before. Quote : “In order to access the AssetTypeCategories.h file you need to add the “AssetTools” in your project’s public dependencies:” And that works for him. But he doesn’t have that code in a custom module.