Daily bonus

j75j75 Member, PRO Posts: 235
How would I go about using the device clock to control a daily bonus actor to appear?
Ideally I would like to set an attribute to true at a specific time of day.
Thanks.

Comments

  • gingagaminggingagaming FREELANCE GS DEV Member Posts: 1,685
    This should work for you. It will create a button at 12 midday just change the 12 to any hour you want. I think that is what you was asking for?

    Create an integer attribute called savehour

    Then create an actor with the following 2 rules

    If attribute savehour is NOT equal to 12 (or any hour you want) change self.alpha to 0

    When touch is pressed AND attribute savehour = 12 (or any hour you want)
    Open scene daily bonus

    Then put another actor in any scene you want to create the daily bonus from with the following rule

    Change attribute savehour to game.clock.hour
  • j75j75 Member, PRO Posts: 235
    edited January 2014
    Thanks. That will get me on my way.
    Questions: Is clock.hour in a 24 hour format? eg 1PM = 13?
    Does the GS previewer ignore clock.hour or does it use the computer's clock?
  • j75j75 Member, PRO Posts: 235
    edited January 2014
    Thanks you guys.

    Uptimistik, I always enjoy looking at your stuff.
    I think got it figured out.
    If device.clock.hour=12
    Change attribute DailyBonus to true
    If DailyBonus=true, move BonusActorButton onto scene.
    When BonusActorButton is touched, change DailyBonus to false and open bonus scene.

    Will check out your example to see how you worked it.

    Now I just need to make some sort of timer to tell the user how much time is left until their daily bonus will be available.
  • j75j75 Member, PRO Posts: 235
    So, with my idea, the user actually has to be playing when the clock strikes 12 in order for the attribute to be changed. How do work it so the game knows that 12 has occurred for that particular day, even if it is opened at 3PM?

    BTW @Uptimistik your link doesn't show a download option.
  • @jesse75 did you ever figure this out to work on different times for the day?

  • @J75 did you ever figure this out to work on different times for the day?

  • HopscotchHopscotch Member, PRO Posts: 2,782

    @stratton.e.matt@gmail.com

    you can also look at our off-line timer/daily bonuses/anti-hacking option on APPFormative (link below) if you are worried about people cheating by playing around with the clock time on the device.

Sign In or Register to comment.