Is there a function to get a text file from an internet path?
We’re working on a scrabble-type game. We have a text file written like this:
UNREAL*completely unbelievable
and the c++ script we wrote loads each line of this file into an array
TArray<FString> take;
FFileHelper::LoadANSITextFileToStrings(*path, NULL, take);
Then splits each line of that array at the “*” into two other arrays (so we can use them in blueprint since we’re still learning c++).
FString left;
FString right;
take[i].Split("*", &left, &right, ESearchCase::IgnoreCase, ESearchDir::FromStart);
words.Add(left);
definitions.Add(right);
We want the game to load the text file from an internet path so the player can’t manipulate the dictionary by editing the text file. We’d want to load something like “http://www.mysite.com/textfiles/dictionary,txt” if that’s a possibility.
Any ideas?
Ok, first if all, websites are not internet, its just one of services running on internet and they using protocol called HTTP. So what you call internet path, is HTTP address/path, and its definity not file system path (Some APIs unifies HTTP as well as other internet protocols with file system APIs, but thats not the case with UE4 so maybe that confused you). UE4 have build in HTTP client APIs allowing you to get files via HTTP, here you got refrence
I didnt used it yet myself, but on breef look on refrence i think you use this static function to access HTTP module instince
Thats just bluprint binding with extra support, those guys seems to want to use C++ with just normal text http output, HTTP was always there before that plug in was made, simply not accessable via blueprint
These answers aren’t just for the people asking the questions, they’re just as much for other people with similar problems. Either way it’s very much related and a valid alternative.
Thank you both for your answers! , I haven’t the slightest idea how to use your solution, but I haven’t any doubts that it is the way to go as my familiarity with the language improves. Dieselhead, I wanted to delve into your solution but unfortunately our project is 4.4+ and that library only works with 4.3. Bummer too, because it looks great!
I’ll just have to keep experimenting. Much love.