Global (Literally) Variables?

So is there a way to create a variable that is accessible across devices? For my game, I'd like to have a global counter so that each time somebody downloads the game, they get a different and unique number. Is that possible?


Short answer: yes, it is, but it's no easy task.

Long answer: if said variable shall be accesible from various devices, it obviously must be stored somewhere in the web. Meaning that to check for this variable, every player must have an internet connection to read that variable, then increase it by one, etc. Even if we ignore that this is a security nightmare, you still would have to store it somewhere where it's guranteed to be always avaiable.

The easiest thing (which is still disproportionaly complex) would be reading this very page's download statistic, which is diificult and probably against the terms of service.

There are some trickeries that allow you to make it seem like every player gets an unique number that increases with time (hint: system time), but i guess you consider it cheating. Not that many people would ever make the effort to double-check it.


Shouldn't be that hard; but might stop working at some point in the future.

Find a web service that provides free hit counters (Here's one). That little script contacts a script on their servers every time it is viewed, incrementing the number. Once you've signed up, you could easily modify the javascript they give you so that instead of writing the value to the page, it passes it to ASLEvent to give Quest its number.

However, this will tell you how many times the game is started, not how many times it's been downloaded. If you want to keep the same number when the player starts a new game, you would have to store it in a cookie or LocalStorage – and that functionality is disabled in the desktop player. So you could do it in the web version, but not on desktop.


Why?


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums