In this tutorial we are going to go through a work-around for packaging games with plugins in them.
"Plugin 'Your Plugin' failed to load because module 'Your Module' could not be found. Please ensure the plugin is properly installed, otherwise consider disabling the plugin for this project."
Created for UE4 v4.6.1
So in the other Plugins Tutorial, we showed you how to add the plugin to the UE4 Engine, but unfortunately the plugins will not package correctly as of build 4.6.1. According to this post on the Answer Hub, however, they plan on implementing full support for this method in the near future, possibly as soon as 4.7.
So, our original plugin tutorial will eventually be the "official" method of installing the plugin into UE4, but we are going to change a few steps along the way to get this thing running.
So first things first, you need to get Microsoft Visual Studio 2013 Express for Windows Desktop. Once you have that installed, we can start on fixing our project so that it packages plugins.
If you had any projects open, close them and re-open them after Visual Studio has been installed. This will let us use some features previously unavailable to us. Navigate to your BluePrints folder in your Content Browser, and then go to File>>Add Code To Project. This will trick UE4 into thinking we have a C++ project.
Then name it something like "BlankPlayerController" or "CppPlayerController" so that we know that it is just there for looks, and doesn't actually do anything. Then click Create Class.
The editor will prompt you with a message asking if you would like to edit the code now. Click Yes, and this will load Visual Studio.
Now here is where things deviate from our other tutorial. You will need to navigate to your Epic Games\4.6\Engine\Plugins folder and REMOVE the plugin you are having trouble with, and make a backup copy somewhere convenient.
Now navigate to your Project folder that you are working out of, and create a new folder called "Plugins." You will want to now put your custom plugin in this folder. So the directory hierarchy should look like "MyProject\Plugins\MyCustomPlugin." MyCustomPlugin being the folder holding all of your plugin stuff, be it the VictoryPlugin or whatever other plugin you like.
The reason we move the plugin into the project folder is because when we try to build it in Visual Studio later, it will ignore the plugin if it is in the main 4.6\Engine\Plugins\ folder. If we try to put the plugin in both the project folder and the 4.6\Engine\Plugins folder, Visual studio will complain that there are 2 copies. I don't know why.
Now go back to your Visual Studio window and navigate to BUILD>>Configuration Manager in the menus.
A popup menu will appear with the build configuration settings. For a simple test deployment, select Development_Game from the dropdown box under "Configuration" and then select x64 (for a 64 bit system) from the dropdown box under Platform.
Now click the close button, and in the main menu select BUILD>>Build Solution. This will create all the C++ files needed for our test deployment to our desired operating system. When you see build succeeded at the bottom then you are ready to start packaging your project in UE4.
Close your UE4 editor if it was open, and re-open your project. A message will popup telling you that some modules were build with a different version, and ask if you would like to rebuild them now. Click Yes.
When your editor re-opens, go ahead and package your project for windows. Now there should be a successful package of the game, with all plugins implemented.
If you tweak settings in the Configuration Manager, you can also make builds for android and other platforms.
If there are any problems/questions, just leave a comment and we will try to get it straightened out.