TimeStamp to check event every 24 hours.. oh my!
Hey guys ,
So as some of you know by now Ive added Power Ups to "Loonimals" that can be purchased via IAP ..
Then a member of the forum (shmuley95) has suggested that i give away free random power up(out of 4 different types) every day (or every 24 hours)
And i liked the idea cause i think this method should help bringing the user back to my game .
So here is the problem .... how to do this ?!
The way i learned from the "OSTime Demo" is that i use this equation for making a timestamp since 1/1/2011 stored to game attribute:
( game.Clock.Year -2011)*365*24+floor(( game.Clock.Month -1)*30.5)*24*60+( game.Clock.Day -1)*24*60+ game.Clock.Hour *60+ game.Clock.Minute + game.Clock.Second /60
Then every time i go back to the menu , make another check to see if 24 hours has passed ,
Meaning storing the current TimeStamp (This time to a temporary self attribute) and compare ,
If "Self.TimeStamp" IS GREATER then "game.TimeStamp"+1440
Do - Store a new game timestamp
Do - Give away a free power up .
(1440 Is the number of minutes in a day)
Im just looking for confirmation that I'm making the right thing with the rules and the formula ..
Also i would like to have your opinions on this one due to the fact that this feature can be hacked easily just by changing the iPhone date..
Roy.
So as some of you know by now Ive added Power Ups to "Loonimals" that can be purchased via IAP ..
Then a member of the forum (shmuley95) has suggested that i give away free random power up(out of 4 different types) every day (or every 24 hours)
And i liked the idea cause i think this method should help bringing the user back to my game .
So here is the problem .... how to do this ?!
The way i learned from the "OSTime Demo" is that i use this equation for making a timestamp since 1/1/2011 stored to game attribute:
( game.Clock.Year -2011)*365*24+floor(( game.Clock.Month -1)*30.5)*24*60+( game.Clock.Day -1)*24*60+ game.Clock.Hour *60+ game.Clock.Minute + game.Clock.Second /60
Then every time i go back to the menu , make another check to see if 24 hours has passed ,
Meaning storing the current TimeStamp (This time to a temporary self attribute) and compare ,
If "Self.TimeStamp" IS GREATER then "game.TimeStamp"+1440
Do - Store a new game timestamp
Do - Give away a free power up .
(1440 Is the number of minutes in a day)
Im just looking for confirmation that I'm making the right thing with the rules and the formula ..
Also i would like to have your opinions on this one due to the fact that this feature can be hacked easily just by changing the iPhone date..
Roy.
Comments
"( game.Clock.Year -2011)*365*24+floor(( game.Clock.Month -1)*30.5)*24*60+( game.Clock.Day -1)*24*60+ game.Clock.Hour *60+ game.Clock.Minute + game.Clock.Second /60"
should be
( game.Clock.Year -2011)*365*24*60+floor(( game.Clock.Month -1)*30.5)*24*60+( game.Clock.Day -1)*24*60+ game.Clock.Hour *60+ game.Clock.Minute + game.Clock.Second /60
and why not make it to seconds roy?(or even millisceconds), will be better then minute
Calvin
Thank you!
That multiply by 60 isn't there in the GameSalad template! but in theory you are right! it should be there!
Also why you suggest seconds? the numbers will be much higher , and GS is not so good with very big numbers , please explain why it will be easier.
Should i drop this idea because this feature can be cheated? can anyone offer a way to overcome the ability of cheating ? how other time based game does it?
Roy.
More info soon
Going to bring this idea to life now
Roy.
And looking forward to what you are going to do!
P.S. maybe gamesalad should let us use server times..
Make a slot machine (like in jetpack joyride) where the players can win power ups ,
And instead of giving away each day a free power up , i can give away each day a free COIN .. a LooniCoin!
This way i don't mind if the user is hacking the system , if he have the patient to mess around with his iPhone date just to get coins , so be it , the machine lets you win once every few attempts anyway so its fine , also this gives me the opportunity to add another IAP - Buy a bag of 50 coins in 0.99$
AND ! it added a mini game to my game , the slot machine ! where the player can win more power ups or more coins !
I wonder if there is a slot machine template somewhere to speed things up ..
Really excited about this idea
Roy.
when the data is lass then pervious, delete all the players coin!(or warn them by a dialog)
because after they have done it a lot of times, they might want to be back and change the times back