Note that there are some explanatory texts on larger screens.

plurals
  1. POpercentComplete for Achievements not returning with decimal values
    primarykey
    data
    text
    <p>From this thread: <a href="https://stackoverflow.com/questions/7131728/about-percentcomplete-in-gkachievement">about percentComplete in GKAchievement</a></p> <p>I've managed to report achievement progress so far and I have no problems when the progress submitted doesn't include decimal values like do a task 10 times to get this x achievement. Each reportProgress will then be 10%.</p> <p>However, I'm trying to code an achievement which can only be completed after doing a task 1000 times. So that's 0.1 progress for each task done.</p> <p>Is there a fix on how to get the decimal values when retrieving percentComplete? I'm not sure if the saved value or the returned value is converted to an int.</p> <p>What I am trying to do is retrieve the current achievement progress from GameCenter and increment it with 0.1d every time the task is done. If I try to report a progress of 4.1d, I get this in the log:</p> <p><em>Reporting achievement de.company.testapp.achievement1, with <strong>4.100000</em></strong></p> <p>That is a system generated log. So is it correct to assume GameCenter is saving it as double with decimals and only returning the whole number when you request for percentComplete?</p> <p>Sure I could keep a local counter but I'm trying to avoid score inconsistency when the user switches to another device, or if the local authenticated user changes within the device. It might be a little too much to synch scores or update our server to keep track of every single achievement of every single player. </p> <p>Anybody has any suggestion on how I should properly handle tracking this kind of achievement?</p> <p>Thanks in advance.</p> <p>PS. I'm developing in Unity so I'm using the GameCenterPlatform but I tried retrieving the percentComplete in objective-c side but it also returns whole number for percentCompleted.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload