Hey forum,
I’ve been wanting to find a way to load XML data so I’ve been looking around and came across some useful file system resources like
https://answers.unrealengine.com/questions/120392/how-can-i-load-text-from-file-with-blueprint.html
https://wiki.unrealengine.com/Save_System,Read%26_Write_Any_Data_to_Compressed_Binary_Files#Loading
FXmlFile | Unreal Engine Documentation
And so I created a simple replica of what I saw there, which is this:
MyBlueprintFunctionLibrary.h
#pragma once
#include "Kismet/BlueprintFunctionLibrary.h"
#include "MyBlueprintFunctionLibrary.generated.h"
UCLASS()
class T_FILE_LOAD_API UMyBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, Category = "save")
static bool FileSaveString(FString SaveTextB, FString FileNameB);
UFUNCTION(BlueprintPure, Category = "save")
static bool FileLoadString(FString FilenameA, FString& SaveTextA);
}
and
MyBlueprintFunctionLibrary.cpp
#include "FTL_Overdrive.h"
#include "MyBlueprintFunctionLibrary.h"
bool UMyBlueprintFunctionLibrary::FileSaveString(FString SaveTextB, FString FileNameB)
{
return FFileHelper::SaveStringToFile(SaveTextB, *(FPaths::GameDir() + FileNameB));
}
bool UMyBlueprintFunctionLibrary::FileLoadString(FString FileNameA, FString& SaveTextA)
{
return FFileHelper::LoadFileToString(SaveTextA, *(FPaths::GameDir() + FileNameA));
}
However, running on Mac OSX, I’ve been using Microsoft Visual Studio Code as opposed to the regular Visual Studio. The problem with Code is that it doesn’t seem to have the same sort of compiler functionality as Visual Studio has. It has ‘build’ though. So I run a build task with the .Build.cs file selected and I see some status icon flicker in the bottom-hand status bar, presumably saying “I’m building now”.
But I don’t know what it’s done at this point. When I open the Unreal Editor, there are no Blueprints to be found by typing in ‘save’ or ‘text’ or ‘file’ that were any different from the ones that came with the Editor. I’ve tried restarting the Editor too.
What is it I’m supposed to do to get my C++ code integrated into the Editor as a Blueprint?
Sorry, total C++ and Unreal coding noob - experienced programmer though so you can throw crazy coding jargon my way without worrying to confuse me.