Using Microsoft Visual Code to add Assets?

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,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:

#pragma once

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

class T_FILE_LOAD_API UMyBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
		UFUNCTION(BlueprintCallable, Category = "save")
		static bool FileSaveString(FString SaveTextB, FString FileNameB);
	UFUNCTION(BlueprintPure, Category = "save")
		static bool FileLoadString(FString FilenameA, FString& SaveTextA);	


#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. :stuck_out_tongue:

How do you normally build code? What is it you’re building?

Do I need to include some Engine assets to get my code integrated?

Visual Studio Code doesn’t ship with a C/C++ compiler toolchain. On Mac you’d build your project with XCode, the basics are covered in the Quick Start

Thanks. I’ve been trying to compile my code in XCode, but have been running into some issues.

XCode doesn’t seem to like my class definitions. Is there any chance you could spot what I’ve done wrong?

  1. Your constructor and destructor definitions in the .cpp refer to a MyBlueprintFunctionLibrary, there is no such thing, as per the .h it’s supposed to be UMyBlueprintFunctionLibrary. Unless you actually need a constructor/destructor remove them entirely.
  2. T_LOAD_IT_API should probably be FTL_OVERDRIVE_API as that macro is generated from the project name.

Thanks enlight. Whereas the screenshots above don’t seem to suggest this, those are both things I already tried. The results are the same.

But I will remove the constructor and destructor; they were only added there because Unreal put them there as it created the C++ code.

Any other ideas on what may be amiss here?