Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Collecting stats in GS game

LokitoesLokitoes Posts: 142Member, PRO

Hi all,

I'm hoping to be able to collect stats on the number of clicks a user has made on the screen within a game. This would be as a log for me as the developer to keep, not a public facing click counter. I'm sure there is a simple way to count clicks but I've never had to do it before - what would be the best way to get started?

For context: this would not be a game that people download to their own devices, it would be set up on my device for them to use. So the log doesn't have to be sent anywhere, just perhaps held in the background somehow.

Problem is that it needs to accumulate over time rather than refreshing with each use, OR needs to save somewhere before it refreshes - so that I can keep a running count. Is this possible?



  • tatiangtatiang Posts: 11,870Member, Sous Chef, PRO, Senior Sous-Chef
    edited August 11

    You can have a rule that increases a game attribute by one each time the mouse is down. Save and Load that attribute and it will always be available and will continue to increase without ever resetting (unless you tell it to).

    As for viewing the value, you could make a separate scene that has a Display Text actor and maybe a password to access that scene. Or else just a rule in an actor (say the pause button) in the main scene that says something like:

    When Mouse is Down
         Change attribute game.clickCount to game.clickCount+1
         Timer after 5 seconds
              Display Text [game.clickCount]

    It's unlikely anyone will decide to hold down the pause button for a full 5 seconds, for example.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • bob loblawbob loblaw Posts: 383Member, PRO

    i think he’s saying he wants to see the clicks of others (that’s how i read it). i don’t think gs has a function that will send data.

  • bob loblawbob loblaw Posts: 383Member, PRO
    edited August 13

    @Lokitoes, having a read through this thread just now:

    i got the impression that maybe that might be something along the lines of what you were after.

  • adent42adent42 Posts: 1,448Key Master, Head Chef, Executive Chef, Member, PRO GameSalad Employee

    Aside from saving it in-app and then grabbing the app and looking at an "admin" screen later to see the click (using the logic by @tatiang), you could store the clicks to a table and send them to a server via the Network Send Table To URL behavior.

  • LokitoesLokitoes Posts: 142Member, PRO

    Thanks guys (sorry for slow response) this works well.

Sign In or Register to comment.