How to wrap existing C++ code into a plugin or a module

Hi, this is the first time I use the forum. I would have used the aswerhub but I have several questions about how distributions and plugins works.
I’ve read “An Introduction to UE4 Plugins” but it doesn’t answer my questions. I could just rewrite all my code, it’s not much, but just thinking about it makes me feel stupid.

I’m developing a game for fun mostly and I found Etodd’s dialogger that was exactly what I needed for my dialogue system. So I developed in C++ an importer that would let me have blueprints of my dialogues. It was tricky since there were almost no articles about how to create a new asset type from a text file, but I managed to finish it. I’m considering making a tutorial for this.

Thing is… I did it inside a test project. It was my first time to use c++ for a non-academic project and I messed up a lot, but now it’s working fine and I need to migrate the code into my project and I don’t know really how. I tried making a module or a plugin but no one say what I should do if I already have code somewhere else.

Also, I’d like to release this plugin into github, again I can’t understand how to do it and I’m worried for the UELA license of the engine.

Sounds like you have put all your code inside the game module of your test project. What I would do is make a new module in the test project and migrate the code into there so it is stand alone. You will need to fix up some API macros so they are named after your new module. From this you can copy that module into another project or plugin just fine.

Remember you can move source around using the windows explorer just fine as long as you run the ‘Generate Visual Studio project files’ command by right clicking the .uproject afterwards.

whoa there, I wasn’t expecting a reply anymore. I had lost hope.

I wish someone told me that sooner. I was tired of waiting for a response and I just rewrote all the code inside a plugin, with few improvements. Thank anyway.