Explanation on plugins and generated code

Currently reading this guide on plugins: Plugins | Unreal Engine Documentation

This paragraph caught my eye.

Plugins are allowed to declare new UObject types (UCLASS, USTRUCT, etc) in header files in a Classes subdirectory in their module code folders. The Unreal Engine build system will detect these files and generate code as needed to support these UObjects. You will need to follow the normal rules for using UObjects within C++ modules, such as including the generated header file and the module’s generated.inl file in one of your module’s source files.

What code would the engine need to build to support the uobjects?

Thsi docs seems to confuse you. If you did UE4 C++ project and you can do something there, you are already know how to make plugin… you simply not aware of it yet :stuck_out_tongue: Let me explain…

UE4 code is divided in to modules (if you ever seen Linux kernel modules, they work in similar manner), each module contain specific feature (or part of it) and each loaded extends the engine itself. When you create C++ project, it create project and extra code module, that code module is not diffrent from what any engine module, it work exactly the same way, you can do exactly same things and you technically extending engine code by adding game code in to it to make all things work. Explore engine source code, you will notice that the way code is structured is not much different from what you see in C++. Same goes with plugins, it just diffrent way of distributing modules, your plugin directory works exactly the same as C++ project directory, aspecially Source directory, you can move the code form C++ project and it will work same way (ofcorse you would need to fix names and stuff :p).

So if you done anything on UE4 with C++ you already know how to make plugins… you just need to learn different thing which is extending editor if you interested on that, and you can do some from anywhere C++ game project too, plugin just makes code usable on different projects. Sadly that is not very well documented and most stuff you will need to search thru community tutorials (in UE4 wiki for example) or by looking up in engine source code to see how things in editor are coded.

You also seem to not understand what UObject is, it a root class that most classes inherent from (this includes all Actors) all those classes are classified as UObjects. Those classes are managed by reflection system and overlal UE4 memoery managment system, UE4 simply register, monitor and manage them all the time online normal C++ classes which are not visible to the engine. Look in “Class Viewer” in editor (Windows->Devloper Tools->Class Viewer) it will show you inherence tree of all UObject classes in the engine and if you disable all filters you will see everything ultimately inherence from Object class. You already used UObjects if you used C++ game project :stuck_out_tongue:

Also importent note, UBT (UE4 build system) need to informed to comple module, there is a list of modules where you need to add them, in C++ game project you have them listed in uproject file and plugin you got them in uplugin file. UE4 will automaticly add one if you do C++ game project, or use that plugin generator

If you extend editor (you interact in editor code in any way, except Slate salte cna work without editor), you need to place editor code in sperate module and mark it as editor module. Really loook up how other editor plugins are made to see what i mean.

https://github.com/EpicGames/UnrealEngine/tree/release/Engine/Plugins

Hey there- I know I’m a bit late, but I got the chance to come back and read everything. Thank you, legitimately, for the detailed explanation. I’ll definitely take a look at some editor plugins as that’s where I’d eventually like to head. Thanks again.