Why is OnlineSubsystemSteam not working?

I’m trying to access OnlineSubsystemSteam so that I can add Achievements, but it describes itself as the NULL OnlineSubsystem. What am I doing wrong?

I’m in Unreal 4.26. Here are the steps that I’ve done:

  1. Made sure OnlineSubsystem and OnlineSubsystemSteam are checked in Plugins in the editor.

  2. Added this to build.cs:
    PublicDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "OnlineSubsystemSteam"});

  3. Put this in the .uproject file:

"Plugins": [
	{
		"Name": "OnlineSubsystemSteam",
		"Enabled": true
	}
  1. Added this to DefaultEngine.ini:
[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"

[PacketHandlerComponents]
+Components=OnlineSubsystemSteam.SteamAuthComponentModuleInterface
  1. Call this from the BeginPlay in my main actor:
IOnlineSubsystem* subsystem = IOnlineSubsystem::Get();
if (subsystem != nullptr)
	Logger::log("Found OnlineSubsystem:", subsystem->GetSubsystemName().ToString(), "appID:", subsystem->GetAppId());

This then proceeds to print NULL as the subsystemName and an empty string for the AppID. Also, shift+tab to open the Steam overlay doesn’t work. This happens both when running from the editor through Standalone, and when making a package. When making a package, I do see that the file steam_api64.dll is included in it.

What am I doing wrong here?

What kind of package do you create? Because it only works with Development, and not with Shipping.
Another option is to go to your project folder, right click on your .uproject file and click Launch Game.

I’m indeed making a Shipping build. But are you saying that OnlineSubsystemSteam doesn’t work with Shipping builds? That seems really odd to me, isn’t the whole point of this to make a Steam integration to release to customers? Or am I misunderstanding what you’re saying?

You’re right. When you want to upload your game to Steam through Steamworks and it will be launched via Steam, you’ll need a shipping build. But if you want to test stuff without uploading to Steam, you need a development build.
I wish it were explicitly written somewhere, because I had to learn it through trial and error and frustration.

Ahhhhhh, that works indeed! That is so random and arbitrary! Thanks!

Is there also some trick to getting Steam to work without making a package? I read somewhere that I need to run as Standalone Game from the editor to get Steam to work, but that doesn’t actually work when I try it.

Is there also some trick to getting Steam to work without making a package?

Yes, as I wrote above, go to your project folder, right click on your .uproject file and click Launch Game.

Ah yes, I can use that while the editor is open, so in practice that means I can make changes and run immediately. Works for me, thanks!