How to open OS file browser while in-game and utilize selected path

Dear Friends at Epic,

My fundamental goal :

to know what the full path of the game is, wherever the user chooses to run it from, in other words, how to determine the full file path of where the .uasset is.

My question:

Since I dont know how to retrieve the full file path of the .uasset for my game, I want to open a windows explorer / OS specific file browser so that the user can select their install directory, and then I’d like to retrieve what they select as a string.

I looked up info on shell32.h and

ShellExecute(NULL, "open", "C:\", NULL, NULL, SW_SHOWDEFAULT);

But when I include shell32.h it is not found as a library

system("explorer C:\\");

opens an explorer but I dont know how to get the string info back and I have read that using System() is not such a good idea :slight_smile:

I wanted to do a manual search through the user’s computer to find the .uasset myself but FileManager will not accept a root drive path like C:\ for recursive find file function

Any ideas?



Hi Rama,

We are curious what exactly you are trying to accomplish by looking for .uasset file locations.


I am making a multiplayer in-game level editor that is specific to my game in every way (not a duplicate of ue4 editor at all)

I save a looot of data out to binary files

I want to be able to always save these files in a subfolder of the main game directory where the .uasset is located :slight_smile:

But currently, when another rocket beta tester unzips my game, they can place the game wherever they want without an installation process

so I’d like to be able to detect where the .uasset is located within their computer so I can make a subfolder called JoyLevels where I place all saved level files as they are made in the in-game editor

Currently, I have a variable in game.ini that I ask people testing my game to edit to be their main game folder location.

but if I could auto-detect the .uasset location I would save them from having to do this step each time I send out a new beta ( more like an alpha)



I think what you want is to call the FPaths::GameContentDir() function (defined in /Engine/Source/Runtime/Core/Public/Misc/Paths.h). This will be the relative path to the project’s content directory (e.g. /MyProject/Content/). From there you can look for whichever files your plugin needs.



is what I needed!

Thanks so much Mike!