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"

How do I write to a text file?

I was trying to use code I got from this answer forum to make custom nodes for reading and writing to text files but the code was from 4 years ago and I got some errors when I ran it. The code is as follows:

RWTxtFile.cpp

include "RWTxtFile.h"

include "FileHelper.h" #include "Paths.h"

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)); }

RwTxtFile.h

include "CoreMinimal.h"

include "Kismet/BlueprintFunctionLibrary.h" #include "RWTxtFile.generated.h"

/** / UCLASS() class MAZE2_API URWTxtFile : public UBlueprintFunctionLibrary { GENERATED_BODY() public:

     UFUNCTION(BlueprintPure, Category = "Custom", meta = (Keywords = "LoadTxt"))
         static bool LoadTxt(FString FileNameA, FString& SaveTextA);

     UFUNCTION(BlueprintCallable, Category = "Custom", meta = (Keywords = "SaveTxt"))
         static bool SaveTxt(FString SaveTextB, FString FileNameB);


The errors are as follows: One or more of the moduels specified using the '-module' argument could not be found.

The command "C:\UnrealEngine-4.19.2-release\UnrealEngine-4.19.2-release\Engine\Build\BatchFiles\Build.bat UE4Editor Win64 Development-WaitMutex-FromMsBuild" excited with code 5. Please verify that you have sufficient rights to run this command.

I have zero experience with C++ and have no idea what to make of this so let me know if there's a quick fix or a better way to go about what I'm trying to do.

Product Version: UE 4.19
Tags:
more ▼

asked Jul 09 '18 at 07:14 PM in C++ Programming

avatar image

MatthewJaffe
1 1 1

avatar image Daxter154 Jul 09 '18 at 08:04 PM

The error suggests that you don't have admin permissions on some file which is preventing it from running. But it is extremely difficult to read your code in its current form. Also exact copy-pasted errors would help.

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

0 answers: sort voted first
Be the first one to answer this question
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