x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How can I create a plugin library?

I want to extend the functionality of Ue4 and I have already looked at plugins but I am not sure how I would create a c++ library that I can easily share between projects.

I only need to expose some functions and I don't need a cpp file.

I started with the BlankPlugin and I changed all the names, I deleted the private folder and changed the Build file to

 namespace UnrealBuildTool.Rules
 {
     public class Functional : ModuleRules
     {
         public Functional(TargetInfo Target)
         {
             PublicIncludePaths.AddRange(
                 new string[] {
                     "Developer/Functional/Public"
                 }
                 );
 ...

The public folder only contains one file, functional.h with the content of

 #pragma once
 
 void foo{}

The plugin sits in my current Ue4 project. How would I access 'foo' in my Ue4 project?

I mean I can access it if I include the header like this

 #include "../../Plugins/Developer/Functional/Source/Functional/Public/Functional.h" 

But that's bypassing the Ue4 plugin functionality

Product Version: Not Selected
Tags:
more ▼

asked Jun 04 '14 at 06:01 PM in C++ Programming

avatar image

maikklein
120 28 25 37

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

First you should determine whether you want to create a plugin module or a library module. Plugins are usually a self-contained module (or set of modules) that implement some API to extend functionality in the Editor or a game. A library on the other hand is a module whose functionality can be shared with other modules. It's possible and not uncommon to implement a plugin that also contains some library modules that the plugin uses internally.

From your description it sounds like you just want to implement a module that can be shared between projects, so it's not really a plugin (but other plugins may use it). You would create that just like any other regular module.

If you provide more details on which modules you will have in your plugin and how they depend on each other, then I can help with you correctly setting up the module dependencies. In general, any module referencing a shared module must have a module dependency to that shared module in its Build.cs file. It must also include one or more public headers from the shared module that declare the shared module's API. The module that implements the actual plugin (i.e. implements some Editor or Game API and hooks into the Editor or Game) does not need any public header files since it won't be used by anything else. You will have to set up the .uplugin file correctly, so that this module is loaded as a plugin.

By the way, the PublicIncludePaths array is no longer needed. All public header files in a module are now detected automatically. This is not the case the private header files, so the PrivateIncludePaths array is still needed if you have header files in subfolders within your Private directory.

more ▼

answered Jun 05 '14 at 04:08 PM

avatar image maikklein Jun 05 '14 at 07:25 PM

Thank you for the response, I probably want to create a 'library module'. Basically I want to extend the functionality of TArray by adding some functions like map fold etc.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question