Download

Loading a plugin only when launching game, not editor

I’m experimenting with the Shooter Game sample and a plugin of my own that uses the Steamworks API directly. Because I need the Steam overlay to work, I have to initialise Steamworks before the game window is initialised. I don’t think that the ShooterGameInstance class is initialised early enough, so I have created a new module within the project that was set to initialise on PostConfigInit, and have this module call the Steamworks initialisation function from StartupModule().

This does seem to initialise Steamworks early enough, but it seems to be called on editor startup rather than just on game startup. This means that if I’m running the Unreal Editor for the Shooter Game project, Steam shows me as being in game.

I’d like to have this module only start when the game itself is booting, and not when the editor is booting. I’ve tried messing with the Type properties on both the custom module I made and on the plugin to set them to be ClientOnly, but no combination seems to have actually worked - it either has no effect, or the module itself isn’t picked up properly and so prevents me from compiling.

What method should I be using here? Alternatively, is there a better way to initialise Steamworks early, rather than relying on a PostConfigInit module?

Bumping this. I’m still not convinced my approach is correct.