Hello, I am trying to work with Steamworks lately, and I am trying to do a simple event of pausing my game when the Steam Game Overlay becomes active.
I created a c++ Game Instance class in my game, and I can load it up in the game, as I can create and modify a variable in it. When I write the following code
Header file
include “Engine/GameInstance.h”
include “MusicalRangeInstance.generated.h”
void SteamOverlayActive();
UFUNCTION(BlueprintPure, category = "Steamworks")
bool OnSteamOverlayEnabled(GameOverlayActivated_t *pResult, bool bIOFailure);
CCallResult<UMusicalRangeInstance, GameOverlayActivated_t> m_callResultGameOverlayActive;
And then in cpp file
include “MusicalRange.h”
include “MusicalRangeInstance.h”
include “ThirdParty/Steamworks/Steamv132/sdk/public/steam/steam_api.h”
void UMusicalRangeInstance::SteamOverlayActive() {
SteamAPICall_t hSteamAPICall = SteamUtils()->IsOverlayEnabled();
m_callResultGameOverlayActive.Set(hSteamAPICall, this, &UMusicalRangeInstance::OnSteamOverlayEnabled);
}
bool UMusicalRangeInstance::OnSteamOverlayEnabled(GameOverlayActivated_t *pResult, bool bIOFailure) {
return bIOFailure || (pResult->m_bActive == false);
}
[/code]
The problem I have, is that the c++ compile for UE4 says that GameOverlayActivated_t is not a valid structure. I haven’t been able to find anything on this problem online. I am quite noob when it comes to Steamworks coding, and I am having a lot of trouble understanding the documentation just like that. Examples would be best. Like, it has an example for Call Results, but not really for Callbacks at Steamworks API Overview (Steamworks Documentation)