hi, for example i made my custom class based on Blueprint Function Library and want expose steam function
SteamAPICall_t RequestLobbyList()
but accidently C++ project can’t find what SteamAPICall_t is, in steamwork sdk
// handle to a Steam API call
typedef uint64 SteamAPICall_t;
const SteamAPICall_t k_uAPICallInvalid = 0x0;
of couse i can copy these lines inside my C++ project, but is here a way to connect whole steamwork sdk and let visual studio find such declarations itself (automatically)?
to be more specific:
i added custom C++ class called steam_functions
in VS i got 2 files
steam_functions.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Kismet/BlueprintFunctionLibrary.h"
#include "Steam_Functions.generated.h"
/**
*
*/
UCLASS()
class STEAM_TRAINING_API USteam_Functions : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, Category = "Steam")
void UE_RequestLobbyList();
};
SteamAPI_SetMiniDumpComment("Minidump comment: SteamworksExample.exe
");
Error 5 error LNK2019: unresolved external symbol __imp_SteamAPI_SetMiniDumpComment referenced in function "private: void __cdecl USteam_Functions::UE_RequestLobbyList(void)" (?UE_RequestLobbyList@USteam_Functions@@AEAAXXZ) D:\ue4\projects\4.7.6\steam_training\Intermediate\ProjectFiles\Steam_Functions.cpp.obj steam_training
seems VS have no idea where get this function’s body and i have no idea how link (implicitly) .lib file with solution that already a library! on man told lubrary solution have no linker option!!! and that’s true, in raw win32 app linker option exist!
installed 2013 ultimate and what you think? c/c++ folder doesn’t exist as well! just wtf? when i create new win32 project both in express and ultimate c/c++ folder exist in properties! in this case i have really few questions:
is it blocked or just missed by launcher when generating vs solution?
if it’s blocked, then why and how should i then use steam functions?!?!
Why do you need to manually integrate the SteamWorks SDK? UE4 already has it integrated (see OnlineSubsystemSteam) which has calls to the RequestLobbyList and such already provided for you. In any event, I opened up my project and I have the VC++ Directories, if you right click on your project -> properties, it’ll be under the Configuration Properties.
Rama actually has an excellent guide for setting up SteamWorks within a project here.
You probably want to also read through this document if you haven’t yet.
If the system can’t find the API, then that tells me your Build.cs/Target.cs files aren’t setup properly. Once those are fixed, you’ll need to regenerate your project solution (just right click on your UProject file and select Regenerate Solutions) so it actually reads the config changes and populates your include directories to point at the Steamworks SDK in the ThirdParty directory.
// Fill out your copyright notice in the Description page of Project Settings.
using UnrealBuildTool;
public class steam_training : ModuleRules
{
public steam_training(TargetInfo Target)
{
PublicDependencyModuleNames.AddRange(new string] { "Core", "CoreUObject", "Engine", "InputCore" });
PrivateDependencyModuleNames.AddRange(new string] {
"OnlineSubsystem",
"OnlineSubsystemUtils"
});
// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string] { "Slate", "SlateCore" });
// Uncomment if you are using online features
PrivateDependencyModuleNames.Add("OnlineSubsystem");
// if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
// {
// if (UEBuildConfiguration.bCompileSteamOSS == true)
// {
DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
// }
// }
}
}
my target.cs
// Fill out your copyright notice in the Description page of Project Settings.
using UnrealBuildTool;
using System.Collections.Generic;
public class steam_trainingTarget : TargetRules
{
public steam_trainingTarget(TargetInfo Target)
{
Type = TargetType.Game;
bUsesSteam = true;
}
//
// TargetRules interface.
//
public override void SetupBinaries(
TargetInfo Target,
ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
ref List<string> OutExtraModuleNames
)
{
OutExtraModuleNames.AddRange( new string] { "steam_training" } );
}
}
i also want say, that steam pop up work fine in packaged game, steam statistic too Steam Community :: lI Spacewar 0.6 hour, but i really don’t know how get access to steam functions, because ingine does only steam init
what did i try:
in projetc settings in VS add path to steam_api.h folder at include line
in projetc settings in VS add path to steam_api.lib folder at include lib line
the only file i couldn’t find from rama’s guide is
WinPlatform.Automation.cs
In Visual Studio, this file is in the folder Programs/Automation/Win.Automation/WinPlatform.Automation.cs. Open it, and check that this string has your Steam API version:
string SteamVersion = "Steamv131";
searched WinPlatform.Automation.cs over whole HDD by name, 0 matches, probably this file inside UE source code and not just compiled one, but in case shift+tab pop up work fine, sure this string fine too, the only problem - VS can’t find from where should it take
but VS doesn’t inderline it with red and right click go to definition/declaration work fine on SteamMatchmaking/RequestLobbyList/SteamAPICall_t , all three lead to steam_api.h
yeah, it’s fine too, i added both paths to x64 lib and x32, i will make archive in a minute with whole project if you can waste some time for me and try it on your own, maybe somehow magicaly it would work on your PC and then we can try find the difference
in OnlineSubsystemSteam.cpp at D:\ue4\installed\Epic Games\4.7\Engine\Source\Runtime\Online\OnlineSubsystemSteam\Private\OnlineSubsystemSteam.cpp i also changed this function at line 404
bool FOnlineSubsystemSteam::IsEnabled()
{
if (bSteamworksClientInitialized || bSteamworksGameServerInitialized)
{
return true;
}
// Check the ini for disabling Steam
bool bEnableSteam = true;
GConfig->GetBool(TEXT("OnlineSubsystemSteam"), TEXT("bEnabled"), bEnableSteam, GEngineIni);
if (bEnableSteam)
{
// Steam doesn't support running both the server and client on the same machine
bEnableSteam = !FParse::Param(FCommandLine::Get(),TEXT("MultiprocessOSS"));
//#if UE_EDITOR
if (bEnableSteam)
{
bEnableSteam = IsRunningDedicatedServer() || IsRunningGame();
}
//#endif
}
return bEnableSteam;
}
so i just commented these //#if UE_EDITOR and //#endif to try allow steam in editor as well, but seems it didn’t help and it’s blocked somewhere else inside source code of engine additionally
One other thing to try might be just start from scratch, follow Rama’s tutorial line by line, and see what you get. If I get a chance, I’ll run through things locally and see what I can find out.
as i said in packaged game steam pop up work fine, the only problem in VS, checked rama’s guide again, nothing new
here is link https://yadi.sk/d/l_yn3IwBgRVs2, if you can waste some time for me, would be great, because maybe noone yet tryed use steam functions and only just pop up, then our research additionaly to rama’s guide may save days digging around later for someone!
i don’t even sure epic’s tryed use steam function from UE project, because in Engine they use Steam init of course and rebuilding whole engine seems very strange for me, but i got source code already and ready for such !@#$%^
and what you think i got? right, nothing, did someone esle even try use RequestLobbyList for matchmaking in UE? seems not or it was so lucky smart guy, who didn’t ask anywhere in internet lol