Explanation on plugins and generated code.
Currently reading this guide on plugins: https://docs.unrealengine.com/latest/INT/Programming/Plugins/
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?
asked Jun 19 '16 at 12:26 PM in C++ Programming
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 :p 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 :p
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.
answered Jun 19 '16 at 03:20 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here