Labels

Friday, February 6, 2015

How to Get Plugins to Package Correctly in Your UE4 Projects


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.




From the popup menu, select PlayerController and click next.



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.

7 comments:

  1. how do you compile it for updated versions like 4.7 , im getting a error , after compiling it

    ReplyDelete
    Replies
    1. So after messing with it, just download the latest version of whatever plugin pack you are using. I just got the latest version of Rama's for mine, and it worked when it was compiled. If this still doesn't solve the issue, a little more info on your problem may help us sort it out.

      Delete
    2. can you be more specific? do the errors occur during packaging, or does it give you errors when you try to run your app? Maybe some more information would get us going in the right direction

      Delete
  2. This method is great, solved my big problem! Thanks so much, I did not do BUILD >> Build Solution This step is also a success!

    ReplyDelete
  3. Hi, thanks for the tutorial. i am getting this error using 4.8 - packing to android. i am using a json plugin located in the project folder. Would i still need to follow this tutorial or am i missing something?

    thanks loads

    david

    ReplyDelete
  4. Thank you it was very helpful

    ReplyDelete
  5. The depth of articles can easily be felt of this blog. Very precise and straight to the mark. I understood easily the matter of fact which the author of this blog wanted to deliver through his thoughts. Looking for more.
    Custom packaging

    ReplyDelete