Hi, i made c++ class based on NONE class in the list of editor and wrote these simple lines in it
SteamClass.h contain
#pragma once
/**
*
*/
class TESTSTEAMSIMPLE_API SteamClass
{
public:
SteamClass();
~SteamClass();
UFUNCTION(BlueprintCallable, category = Steam)
void happy_SteamInit();
};
SteamClass.cpp contain
#include "TestSteamSimple.h"
#include "Engine.h"
#include "SteamClass.h"
SteamClass::SteamClass()
{
}
SteamClass::~SteamClass()
{
}
void SteamClass::happy_SteamInit()
{
UE_LOG(LogTemp, Warning, TEXT("test"));
/*
if (!SteamAPI_Init())
{
UE_LOG(YourLog, Warning, TEXT("steam SteamAPI_Init failed"));
}
*/
}
But when i open level blueprint and tryes add call to happy_SteamInit it isn’t exist in the list even with “conext sensetivity” checked off
When i added UCLASS(), GENERATED_UCLASS_BODY() and renamed class to USteamClass (as stated in compile errors in VS) i got next code:
SteamClass.h contain
#pragma once
/**
*
*/
UCLASS()
class TESTSTEAMSIMPLE_API USteamClass : public UObject
{
public:
USteamClass();
~USteamClass();
GENERATED_UCLASS_BODY()
UFUNCTION(BlueprintCallable, category = Steam)
void happy_SteamInit();
};
SteamClass.cpp contain
#include "TestSteamSimple.h"
#include "Engine.h"
#include "SteamClass.h"
USteamClass::USteamClass()
{
}
USteamClass::~USteamClass()
{
}
void USteamClass::happy_SteamInit()
{
UE_LOG(LogTemp, Warning, TEXT("test"));
/*
if (!SteamAPI_Init())
{
UE_LOG(YourLog, Warning, TEXT("steam SteamAPI_Init failed"));
}
*/
}
i get couple error during complile
Error 2 error code: 2 D:\ue4\TestSteamSimple\Intermediate\ProjectFiles\Error TestSteamSimple
Error 3 error MSB3073: The command ““D:\ue4\engine\Epic Games\4.4\Engine\Build\BatchFiles\Build.bat” TestSteamSimpleEditor Win64 Development “D:\ue4\TestSteamSimple\TestSteamSimple.uproject” -rocket” exited with code -1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets 38 5 TestSteamSimple
4 IntelliSense: identifier “FWindSourceSceneProxy” is undefined d:\ue4\engine\Epic Games\4.4\Engine\Source\Runtime\Engine\Classes\Components\WindDirectionalSourceComponent.h 20 2 TestSteamSimple
5 IntelliSense: identifier “FOnSelectedLevelsChangedEvent” is undefined d:\ue4\engine\Epic Games\4.4\Engine\Source\Runtime\Engine\Classes\Engine\World.h 1929 2 TestSteamSimple
6 IntelliSense: no instance of constructor “FReadSurfaceDataFlags::FReadSurfaceDataFlags” matches the argument list d:\ue4\engine\Epic Games\4.4\Engine\Source\Runtime\Engine\Public\UnrealClient.h 55 92 TestSteamSimple
7 IntelliSense: no instance of constructor “FReadSurfaceDataFlags::FReadSurfaceDataFlags” matches the argument list d:\ue4\engine\Epic Games\4.4\Engine\Source\Runtime\Engine\Public\UnrealClient.h 63 87 TestSteamSimple
8 IntelliSense: identifier “FMeshBatchElement” is undefined d:\ue4\engine\Epic Games\4.4\Engine\Source\Runtime\ShaderCore\Public\VertexFactory.h 488 131 TestSteamSimple
9 IntelliSense: no default constructor exists for class “UObject” d:\ue4\TestSteamSimple\Source\TestSteamSimple\SteamClass.cpp 8 1 TestSteamSimple
10 IntelliSense: expected an identifier d:\ue4\TestSteamSimple\Source\TestSteamSimple\SteamClass.h 15 2 TestSteamSimple
The goal i try to achieve is custom C++ function to run SteamAPI_Init() function and activate steam