Hi, I am implementing Achievements to my game. But in order to use them, I first have to query achievements using AchievementsInterface->QueryAchievements. So What is a good way in a lifecycle of the app to do that? Is there any callback, that I can get, when IOnlineSubsystem has been initialized?
I tried various callbacks from IOnlineIdentity, but none of them gets called, even though I registered callback properly (like I did dozens of times for dozen of different interfaces).
Hey @Bojann,
As a debugging method, I would suggest using the WriteAchievements function call to act as a flag for when it’s being thrown. You can use the ResetAchievements callback to erase all changes it makes.
My only other suggestion is maybe to use something like the GetOnlineStatus function to check if you’ve successfully gotten online.
I hope this can help!
-Zen
Hello @ZenLeviathan, I am aware f all testing that has to be done. My achievements functionality is working quite fine, and I am able to reset achievements when needed.
When I manually query them, all is good. But my problem is when to query, and I want to do it automatically when user is logged in. So, I tried GetOnlineStatus() in GameInstance::Init(), but it’s offline then. Later in the game, player is online. But I can’t seem to get the callbacks. So what I did in GameInstance::Init() is next
I get these logs, which means, this registration of delegates is being done, but none of these callback methos get executed at all.
Also, I cant assign Identity->OnLoginStatusChangedDelegates because I can’t create method that has ESomeEnum::Type to use as a callback. If anyone knows how do to that, I would really appreceate it.
@Bojann, How does your header look? I know for some Enums you need to declare UProperty() or UEnum(), that’s one of the only reasons I can think of for not being able to create a method callback unless your Online Services aren’t connected properly. I wish I could help more!
-Zen
Hey @ZenLeviathan, thanks a lot, no worries. I know about UPROPERTY() Macro. Issue was, SteamIdentity does not call these as it does not login on this way. So If I call IdentityInterface::AutoLogin, these do get executed, and that is what I did :). So problem is resolved.
Again, thanks for reaching out, this is how it looks now, and works perfectly