Hi there, I am wondering how to mark progress on steam achievements using C++ and how to ‘unlock’ them. There are several tutorials for doing it in blueprints (ie https://youtu.be/ATdkoeSJ2WA?t=8m36s), however, none fully doing it in C++.
Could someone help point me in the right direction as to how to do this in C++?
As i was doing in my game, i just got bored of trying to make sure how to do it in C++, so i did it in blueprints. For that i went and added a blueprint implementable event to my gamemode, and just implemented the achievements there. Yes, its not a really good solution, but for my testing to see if i could make achievements work it was enough.
Thank you for your response! I have unfortunately had threads go entirely unanswered in the past and never got a single response on others so I am glad that this one did not end up with the same fate.
So you did yours entirely in blueprints? You see, my project, with the basic framework of https://www.unrealengine.com/marketplace/multiplayer-first-person-shooter-kit [SUP]1[/SUP] is based entirely in C++ (except for things the like UI) and I am not entirely sure how I would incorporate blueprints easily into it due to the framework. Unfortunately I do not know blueprints very well :-(.
[SUP]1[/SUP]: I have added my own improvements that I am currently working on some as well. For instance, I am working on making it more dynamic and adding new features etc. It is a a pass-time/learning experience.
My project is a mix of C++ as blueprints. Programming the core in C++, and implementing some higher level things like enemy behaviors in blueprints. If its a mayority C++ codebase, then doing that is harder.
Can’t remember what class/file specifically, you’ll have to do some digging around - but there’s a generic interface for unlocking achievements which works with all platforms. Check the persistent user / local player and suchlike.
Thank you! I was able to find it (it is in ShooterPlayerController), however how would I go about implementing it on a character as apposed to a PlayerController? Within ShooterGame, it uses a lot of things that are exclusive to PlayerController and switching a Character based class to a PlayerController one is proving challenging.
It shouldn’t be too much trouble, but the reason they do it on the Player Controller is because it’s linked to the Player then, and they can easily access all the things they need such as the save game / local player for storing achievement progress - The Pawn could change at any time, so it would make more sense to create a custom Controller and use that for your project I imagine.
That makes sense as to why it would be done in there. This is merely a proof of concept project where I try features etc that I want to implement within others, when i get them working I transfer them over. The project I want to eventually get them working on does have a player controller, however the default FPS project does not and that is why I am wondering.
What is the equivalent of GetCapsuleComponent()->InitCapsuleSize(55.f, 96.0f); in a PlayerController?
Technically there isn’t any, a Player Controller has no physical presence in the world (for all intents and purposes anyway). That function in particular is only applicable to character pawns or things with Capsule Components.
I was able to get the achievements working and successfully figure out why they were not working originally however it turns out that UserId.IsValid() within
I was able to create a temporary hotfix for the issue by simply getting it again directly without using the cache (used the last line of code above), however, I am not sure why it was not returning a cached copy.