レベルエディタのメニューから「ファイル File」> 「新規C++クラス New C++ Class」を選びます。親クラスは Actor にします。ファイル名は SaveToText とします。公開設定はパブリックを選んでおきます。クラス作成ボタンを押すとしばらくのコンパイル時間の後にヘッダファイルと cpp ファイルが作成され、VS が開きます。
C++ のエディタが開いていない場合はコンテンツブラウザの C++ クラス(C++ Classes)フォルダ内にある SaveToText のファイルをダブルクリックします。そして、SaveToText.hと SaveToText.cpp を下記のように書き換えます。
クラス名の自動生成されている部分class ゲーム名_APIは書き換えずにおきます。 class AMBITIONEARLYHOURSKY_API USaveToText : public UBlueprintFunctionLibrary あとは public: の行以下の部分を追加するだけでOKです。
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "SaveToText.generated.h"
UCLASS()
class AMBITIONEARLYHOURSKY_API USaveToText : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category = "save")
static bool FileSaveString(FString SaveTextB, FString FileNameB);
UFUNCTION(BlueprintPure, Category = "save")
static bool FileLoadString(FString FileNameA, FString& SaveTextA);
UFUNCTION(BlueprintCallable, Category = "save")
static FString FileLoadAndReturnString(FString FileNameA);
};