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"

Cast to a class that exists in another plugin?

I have two plugins. PluginOne contains a custom Actor class called ATick. This is spawned in game.

From PluginTwo, I need to find that Actor, and cast to the class.

In PluginTwo, I have added the PluginOne module name into the modules list of Build.cs.

I can include the header, and Intelsense does not complain at:

 AActor* Ticker = getInEditor("Tick"); //function that searches and finds the Actor
 ATick* node = Cast<ATick>(Ticker); 

When I try to build though, i get unresolved external symbol errors.

Do I need to link something else to use a class cross-plugin like this? Or is there a different way to cast?

Thanks!

Product Version: UE 4.13
Tags:
more ▼

asked Nov 22 '16 at 05:28 PM in C++ Programming

avatar image

antithing
272 19 26 45

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

1 answer: sort voted first

Hi, does your ATick class have the API macro?

 class TICKMODULE_API ATick : public AActor
 {
   // ...
 };

Here, TICKMODULE would be the name of the module/plugin where ATick is defined. This internally adds the DLL export code needed for separate DLLs to be able to access each other's definitions. This solved this kind of issues when I encountered them.

more ▼

answered Mar 02 '17 at 02:53 AM

avatar image

Muelas.Aitzol
312 10 4 13

(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