Plugin documentation

I’m trying to set up a new plugin. There seems to be some gaps in the plugin documentation, which is admittedly easy to do, even I find it hard to write appropriate documentation since you don’t know what people won’t know.

I’m getting pretty frustrated trying to make any of it work. This is what I have right now:

It doesn’t even try to build the plugin before saying it can’t link to it. Is this how the plugin is meant to be set up? This is one of the areas the docs are lacking in, they don’t show context for anything that they discuss.

Somehow on the weekend I even ended up with plugin files in the UE4 project, which actually tried to load! I can’t seem to replicate this accident though. Even weirder, after uninstalling and reinstalling UE 4.8, the errant files were still in the UE4 base project. I ended up deleting them since they wouldn’t stay placed in the correct folder structure.

Also a bit of a mystery: any files I make end up in the Intermediate folder. Why not the source folder? The VS project structure seems to have no relation to the real directory structure.

Anyone know how this is meant to be set up?

Oh yeah, this is the example I’m following: Plugins | Unreal Engine Documentation - it flat out doesn’t work. Among other things, following the step for copying the plugin** destroys the plugin it came from** while not relocating the copied files. I get what’s going on - but the person who wrote it probably doesn’t realise that VS doesn’t create new files - it only links to the old ones. As soon as I rename something the original BlankPlugin breaks. I think this is how I got my original attempt to load, but there’s no way of telling how you’d make a genuinely new plugin.

Update: So I read between the lines, found the files in the normal windows file explorer and copied them to my project. Then I loaded them into VS and set up the structure again. Then I loaded them into the structure again because moving them around in the project view seems to kill its links to them. Lo and behold, it actually worked after an initial failure to build. I really wasn’t expecting that to work after the last two weeks of banging my head against this.

I’d be happy to update this tutorial now that I’m intimately familiar with the holes in it. It’s part of the main github repo, right? I could fix it up and do a pull request?

Well it isn’t obvious, but you use the Explorer or the command line to copy around files. VS for Unreal plays its role just only as an Editor and Debugger, not to configure projects, solutions or your plugin. This goes as far as you either create new source files yourself in the appropriate folder or you save them manually in the right folder using VS. You don’t add new files to your project, but you create them in the filesystem and then you regenerate your solution using the Games .uproject File, or if you change the Engine sources, by running GenerateProjectFiles.bat, and reload the solution in VS.

Got it, that makes sense. That’s the context people need.

Back to square one. Loading the project gives this:

I guess that despite the files being in the project, it hasn’t built them. The tutorial suggests that as long as they’re in a “Plugins” directory it’ll find them and sort it out.

I’ve tried locating the actual files both in the project/Plugins folder and the project/source/Plugins folder. Neither work.

Also, this isn’t even when I’m loading the project. This is when I’m loading the UE editor and expecting to see the project browser. Not sure why it’s now auto-loading the project. I did not set it as the default startup project in the editor.

What am I missing here?

About the docs, Im not so sure we can change it in any way, we have write access to the wiki, but Epic manages the docs themselves. The things in the sources are used to generated those docs but I think they do manual work for it too. But I don’t really know.

If you see this when you start without a project it might be that the plugin is or was in the engine source folder? I don’t think the editor tries to load plugins outside its own folder without any project loaded.

I just found this, seems to cover the steps I’ve gone through so far: I Don't Know UDK: Unreal Engine 4, Blender and Substance Designer Tutorials: How to Get Plugins to Package Correctly in Your UE4 Projects

Yep, that was it. I didn’t remove the butchered copy of BlankPlugin from my earlier attempt to copy it inside VS. Thanks. :slight_smile:

Ah. So that was about getting packaged games to include plugins. Not entirely related.

Alright, as best as I can work out, the structure that everything has to be in is *extremely specific.

*This is the way VS should look. I made the project CelShaderPlugin purely for developing this plugin. I’ve seen other developers use one project for all their plugin development.

Note that it doesn’t exactly match the way the UE4 project has the plugins laid out. Do not include the category in your VS folder path.

Probably much less important, this gives you an idea of where I placed the plugin source inside the actual windows project directory:

The important thing here is probably that the structure in VS is correct, but if you run into problems, try making sure your files match the structure in the VS screenshot above and live in the location directly above. In my case I grabbed the files I had been working on and dragged them one-at-a-time from explorer to the VS project browser to link them correctly.

After it rebuilds (and this is the step that failed for me every single time until I got the structure correct):

Once the structure was right, everything worked.

So that’s the level of explicit the tutorials need.

I’m not sure if you’re aware of Plugin Creator wizard that was implemented/integrated with UE 4.8. For now it’s experimental but you can create entire plugin with just one click and not worry about the layout.
Go to Plugins window, select ‘Editor’ section to enable it. Maybe next time you will find it useful.

Cheers

I had no idea, thanks. :slight_smile: Well, I learnt a few things in any case.