mklabs / ue4-targetsystemplugin

Dark Souls inspired Camera Lock On / Targeting system plugin

Home Page:https://www.unrealengine.com/marketplace/target-system-component-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to adjust build.cs for use of TargetSystemComponent through C++?

antonlissone opened this issue · comments

How to adjust build.cs for use of TargetSystemComponent through C++? Can you please explain how to do this?

Hi, the rule of thumb to include classes from other modules / plugins:

  1. Check if the class is DLL exported (should be prefixed with _API macro, sometimes this macro is used only on a few methods but it's mostly cases within the engine itself)
  2. Check which module the class you want to include is part of. In your case, it's TargetSystem. For other times where you'll need to do the same, you can get the module name by looking at the folder hierarchy (should be the directory after the Source/ folder and before Public/ and Private/ folders), and / or finding the relevant ModuleName.Build.cs
  3. In your module (plugin or game) you want to add a dependency to that module, you need to edit your ModuleName.Build.cs and add a new module dependency in Public or Private dependencies (prefer to use Private stuff, as adding a lot of module in Public dependencies can increase compile times by a lot). So in your case, you'll need to add TargetSystem dependency to your Build.cs file for your module.
  4. The path to include then can be the relative path under the module source Public/ folder, in this case to include the main component in this plugin that would be #include "TargetSystemComponent.h" since it's at the root of the Public/ folder.

I'm assuming you're trying to create a C++ child class of UTargetSystemComponent in this example.

See http://kantandev.com/articles/ue4-code-modules for further details (especially the "Exposing code to other modules" part)

I hope that answers your question.

Thank you for the quick reply. Most of my game code is in C. So to disable target lock on enemy death I’d like to do that in c++ instead of blueprints.

I know I need to include it in my build.cs but for some reasons none of the paths/names work… so I was hoping you’d be able to state the exact items that need to be added:)