Problem with StatName getting EOS Stat

Hi, I’m trying to implement my own code to expose some EOS calls to Blueprints.
Actually I have an issue with reading user Stats.
This is my C++ function:

void UEOSGameInstance::GetStats(TArray<FString> StatName)
{
    if (OnlineSubsystem)
    {
        if (IOnlineIdentityPtr IdentityPtr = OnlineSubsystem->GetIdentityInterface())
        {
            if (IOnlineStatsPtr StatsPtr = OnlineSubsystem->GetStatsInterface())
            {
                FUniqueNetIdRef LocalUserId = IdentityPtr->GetUniquePlayerId(0).ToSharedRef();
                TArray<FUniqueNetIdRef> StatUsers;
                StatUsers.Add(LocalUserId);
                StatsPtr->QueryStats(LocalUserId, StatUsers, StatName, FOnlineStatsQueryUsersStatsComplete::CreateUObject(this, &UEOSGameInstance::OnGetStatsComplete));
            }
        }
    }
}

This function is implemented in a Game Instance class called “EOSGameInstance” and this is how I use it in Blueprint:

Theese are my Stats defined in Dev portal:

Now, if I use “TEST” as StatName it works as expected.
If I use “SumStat” (or any other) I have this error:

LogEOSSDK: Warning: LogEOS: Error response received from backend. ServiceName=[StatsAchievements], OperationName=[GetPlayerStats], Url=[<Redacted>], HttpStatus=[404], ErrorCode=[errors.com.epicgames.stats.definition_not_found], NumericErrorCode=[UNSET], ErrorMessage=[The stat definition doesnt exist.]
LogEOSSDK: Warning: LogEOSStats: Failed to get player stats. Error=EOS_NotFound

It seems that it only works with Stat names with all capital chars, but I’ve not been able to found any indication to this in the documentation.
Instead I see that official documentation uses capital chars: link to documentation

I’m pretty sure there is something I don’t understand, so please anyone experiencing this issue can point me out to a solution so I can use Stat Names in Camel Case?

Thank you

2 Likes

Interested in this issue, I follow.

I have found in an old post (link) that “the EOS OSS Plugin requires you to define all stats in capitals as it uses case-insensitive mapping (FNames) in certain parts of the codebase”.
I have not been able to find out this in docs but… that’s it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.