Verse Persistence Issue: unique specifier on classes that lack the allocates effect

Hi everyone,

After the recent update to version 31.00, I’ve encountered a warning in the code for the player_stats_manager as outlined in
Persistent Player Statistics.

The editor is showing warnings for the unique specifier on classes that lack the allocates effect. The ecosystem updates also state this detail: v31.00 Ecosystem Updates], however it doesn’t provide a solution for existing classes that use the specifier.

Could I get some help on how to fix this?

Thank you!

4 Likes

I think it is asking you to pass a constructor to your “DebugString” if you want, pass a little more of the fragment or the code and I will try to correct it :slight_smile:

If you don’t solve it before!

Hi,

Thanks for your reply. The code is actually taken right out of the documentation for persistent players statistics.

StatType := module:
     score_stat<public> := class<computes><unique>(stat_type):
         DebugString<override>():string = "Score"
 
     win_stat<public> := class<computes><unique>(stat_type):
         DebugString<override>():string = "Win"
 
     loss_stat<public> := class<computes><unique>(stat_type):
         DebugString<override>():string = "Loss"
 
     # Instances of each stat_type you can use in your experience
     Score<public>:score_stat = score_stat{}
     Win<public>:win_stat = win_stat{}
     Loss<public>:loss_stat = loss_stat{}

In my implementation you can see the warnings:

Just to be clear, the code works. The issue is that unique specifier is going to be deprecated on classes that lack the ‘allocates’ effect:

Verse v31.00 updates

The problem is that there no effect specifier called ‘allocates’.

I’m just trying to get ahead of it before it becomes a problem. If I remove the <unique> class specifier then the code doesn’t compile.

Hopefully I’ve provided some more clarity.

Thanks again for your help!

Hello do you have a discord i can contact you ?

Did you find a solution to this ?

I need a fix for this as well…

Moved to the bug forum. We’ll get someone to take a look and will let you know if we need more information.

2 Likes

Thank you, I’ll keep my eyes peeled!

Not really, I’m reworking the code entirely on my end to avoid using the specifier.

hi,
The UEFN Feature template Verse Device Template fails so UEFN-Verse team will have to fix by the next version of Verse comes out

Could you please share the solution here too? Your reddit post got removed for some reason

Here I repost the solution, you can check:

4 Likes

This does solve the problem - Epic, can we update the wiki?

Hello and thank you for your post. I’m going to try it. If I have any useful updates I’ll be sure to let everyone know!

#change where is 
DebugString<override>():string = "Deaths

#for this
DebugString<override>()<transacts>:string = "Deaths

#add transacts

#in condition change this
if(Stat = StatType.Elo):
#for this
if(Stat.DebugString() = StatType.Elo.DebugString()):

#dont forget this if not instantiate yet

# Instances of each stat_type you can use in your experience
Kills<public>:kill_stat = kill_stat{}
Deaths<public>:death_stat = death_stat{}
Elo<public>:elo_stat = elo_stat{}
Version<public>:version_stat = version_stat{}