Screenshot Function In Packaged Game

Hi! I have a camera feature in my game that uses the “HighresShot 1” Command when it saves a pic. I have it set up to save the image to my desktop that I specified in the project settings window.

My question is, when I package my game, how would it be possible to have a relative filepath so that the picture would save on another user’s PC?

Still looking for an answer. Anyone?

There is nothing built into the engine that I am aware of that would send this picture across a network to another users PC.
Something you would have to code in yourself, unless you leverage Steam or some other system that allows screenshot sharing.

i think op means save to a non hard coded filepath like */user/pictures/screenshots and not something like c:/users/XXmikeXX/pictures

Yes, this is what I meant thank you

I’m still trying to figure this one out, any suggestions?

quick question, where did you set the filepath? was it in a config file? just so i can have a play around and see if i can get something working

Sure! The screenshot directory is in the Project Settings under Engine - General Settings

Anyone ever figure this out? I’ve struggled mightily on this.

I’m trying to figure this out but nothing yet

Write a platform specific plugin that does the right thing for each platform.
On Windows, call SHGetKnownFolderPath() and return that path.
On MacOS, call NSSearchPathForDirectoriesInDomains().
On Linux, use getenv(“XDG_PICTURES_DIR”) and if that’s empty, use getenv(“HOME”)+"/Pictures"
On Android, iOS, and other systems, use the respective appropriate system-specific methods.

Assuming you know a little C++, and have Visual Studio/C++ 2019 installed (not VS Code!) (community Edition is fine) then it’s actually quite easy to write a Blueprint Library in C++ to export functionality from a few functions.