Allow 1 action per day in GameSalad

mmzbrmmzbr Member Posts: 311
edited January 2012 in Working with GS (Mac)
Im working in a project that I want a restriction based on time. Is possible to implement this?
Example: Theres a button what make a action, but I want to restrict the use to 1 action per day (resets 24 hours after the use). Its that possible using(saving attribute) and probably, device clock/timer?

Thanks in advice for the fastest help with my past questions. Game Salad Community is the best!

Comments

  • mmzbrmmzbr Member Posts: 311
    @tshirtbooth First thanks again (I should mention you in the project credits). I just don't get the game.yestarday part, its a custom attribute? And how I set the cool down (24 hours in this case)? Sorry for dumb questions, I'm new using GSalad.
  • morphinegamingmachinemorphinegamingmachine Member, PRO Posts: 449
    have attribute called "last time used hour" "last time used min" and "last time used day"
    when you first use the button save the current hour to "last time used hour" the current minute to "last time used min, and for "last time used day", change that to current day plus one

    in your rule have if all are true, the current min, hour, and day are greater then "last time used min, hour, and day" let them use/do the action again and save the new attributes so they can't use for the next 24 hours
  • calvin9403calvin9403 Member Posts: 3,186
    Yep what tshirtbooth says is you need to made a custom attribute

    But I have another way

    Make an attribute action used? Bool false

    When button touch is press or whatever you have and action used is false, do action and then change it to true

    When attribute action used is true timer after 86400 seconds change it to false

    That way you can do change the time you want for the user, 86400 secs is a day


    Calvin
  • mmzbrmmzbr Member Posts: 311
    @morphinegamingmachine - Thanks for method, I will try that!
    @calvin9403 - I will test your method, seems the way I want it, because the time controller. Thanks!

    Those Methods are passive right? The user don't need to have the game/app running to time goes down?
Sign In or Register to comment.