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?
Announcement
Collapse
No announcement yet.
Using Microsoft Visual Code to add Assets?
Collapse
X
-
enlight_2014 replied1. 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.
Leave a comment:
-
Shrooblord repliedThanks. 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?
Leave a comment:
-
enlight_2014 repliedVisual 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
Leave a comment:
-
Shrooblord repliedHow do you normally build code? What is it you're building?
Do I need to include some Engine assets to get my code integrated?
Leave a comment:
-
Shrooblord started a topic Using Microsoft Visual Code to add Assets?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
https://answers.unrealengine.com/que...blueprint.html
https://wiki.unrealengine.com/Save_S..._Files#Loading
https://docs.unrealengine.com/latest...ile/index.html
And so I created a simple replica of what I saw there, which is this:
MyBlueprintFunctionLibrary.h
Code:#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); }
MyBlueprintFunctionLibrary.cpp
Code:#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)); }
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. :P
Leave a comment: