I'm trying to get the FOnlineSubsystemSteam singleton so I can detect if Steam is initialized before I try to host/join a multiplayer game and pop up an error if it's not. When I call IOnlineSubsystem::Get() and try to use Cast on the result I just get the compiler error:
I know FOnlineSubsystemSteam inherits from IOnlineSubsystem so I'm not sure why this is failing. What modules do I need to include in my project or headers in the file to get this working? Or is there some other way I can find out if the Steamworks API is initialized?
asked Sep 04 '15 at 05:29 PM in C++ Programming
From what I remember the OnlineSubsystems themselves are inaccessible to game projects by default. Two things you can do though:
or something similar. It will still be a generic online subsystem pointer, but if it returns anything you know it's a steam
/3. If you really want to tightly bind to steam, you can add Steamworks to your PublicDependencyModuleNames in your Project.Build.cs and call the Steam API functions directly. The ones you want are probably SteamClient and SteamAPI_IsSteamRunning
Follow this question
Once you sign in you will be able to subscribe for any updates here