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"

how to get external file with Fpaths?

bool URWTxtFile::LoadTxt(FString FileNameA, FString& SaveTextA) { return FFileHelper::LoadFileToString(SaveTextA, *(FPaths::GameDir() + FileNameA)); }

bool URWTxtFile::SaveTxt(FString SaveTextB, FString FileNameB) { return FFileHelper::SaveStringToFile(SaveTextB, *(FPaths::GameDir() + FileNameB)); }

hello looking for a solutions how can i change the locations so i can get my file from e:/drive/temp/text/textfile.txt not the same folder as the gamedir folders can i change anything on the Fpaths thanks in advance :D noob c++

Product Version: UE 4.20
more ▼

asked Oct 31 '18 at 11:49 PM in C++ Programming

avatar image

3 1 4

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

1 answer: sort voted first

Have you tried just using e:/drive/temp/text/textfile.txt as the path you want to write to? That should work.


more ▼

answered Nov 01 '18 at 04:16 AM

avatar image

351 7 6 13

avatar image EliteTech Nov 04 '18 at 06:15 PM

yea is a blueprint function is only seaching in GameDir found another way around but still really wanna to change it to AsolutDir so i can call any txt file on my pc but still dont know how iam really new for this c++ coding :D thanks for reply

avatar image TestyRabbit Nov 04 '18 at 06:49 PM

So if you're trying to get a file from your computer in C++, you should be able to write something like this: FFileHelper::LoadFileToString(SaveTextA, *"e:/drive/temp/text/textfile.txt";) And just get the file directly, instead of using FPaths. The point of FPaths is to help you get files from common places on any computer, regardless of installation location. If you know your file will always be at "e:/drive/temp/text/textfile.txt" then you could use what I posted above. Although you should know that using hard-coded absolute paths like that usually isn't a good idea, especially when it is not even on the C: drive.

avatar image EliteTech Nov 05 '18 at 02:36 PM

ohh ok :D thanks i c so the best solutions is too keep everything under the same gamedir it make sense. was hoping for an easy fix on that fpaths :P but i found another solutions victory plugins works like magic so i just take a step back from c++ really make no sense for me :S iam 3d graphic designer sadly cant handle the coding :D but i know is the only choice :D thanks for the reply

(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