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"

Convert absolute path to in-game path

Hello,

Is there a method somewhere that can help me convert a full path

D:\LearningThunder\games\LineageNext\l2next-utils\Plugins\L2Next_Commons\Content\test

That I choose from directory browser in my UE4 plugin. (this is the path to search the assets in)

But actually my assets are located in this path (used copy refference in asset browser)

**L2Next_Commons/test/**1-1_2.1-1_2

So later if I would need to do this:

 FStringAssetReference DiffuseAssetPath(MyPath);
 UTexture* DiffuseTexture = Cast<UTexture>(DiffuseAssetPath.TryLoad());

MyPath should be using L2Next_Commons/test/ + assetname

So in the end:

How to convert this:

D:\LearningThunder\games\LineageNext\l2next-utils\Plugins\L2Next_Commons\Content\test

to this:

L2Next_Commons/test/

Product Version: UE 4.19
Tags:
more ▼

asked Sep 02 '18 at 09:06 AM in C++ Programming

avatar image

One.Thun
11 1 5

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

1 answer: sort voted first

/Game should give you access to the Content folder. But usually what I do is just put some variables that I will then expose to blueprint. I can then create a BP derived from my cpp file and set whatever I want from the Content folder.

more ▼

answered Sep 02 '18 at 09:33 AM

avatar image

TheDreamCatcher
263 2 4 6

avatar image One.Thun Sep 02 '18 at 09:59 AM

No its incorrect, /Game will give me the access to content folder INSIDE the main Game, it will not give me the path to content folder inside a plugin

avatar image TheDreamCatcher Sep 02 '18 at 10:02 AM

Oh my bad I did not read that right. try something like IPluginManager::Get().FindPlugin(TEXT("MyPlugin"))->GetContentDir();

avatar image One.Thun Sep 02 '18 at 10:18 AM

Thanks, Ill try something)

(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