How do I keep a Timer after the game is closed?

Get help using Construct 2

Post » Tue Mar 08, 2016 7:20 am

I thought about using phone's time but it's easily exploitable and I don't really know how to do that too. Are there any simple and practical way?
It's, in other words, a countdown that I need to keep track to unlock certain things in the game. Then if the player shutdown the game it won't get lost.

Thanks!

Edit: plugin-system-date-and-time_t63492

I found this great plugin but is this exploitable? Like changing the phone's time?
@rexrainbow
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Tue Mar 08, 2016 1:21 pm

Message: Ken95 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Have you tried using web or local storages?

if you're talking bout keeping the time in accordance to the current time. try making a global variable for time then allow the user to input time. then try to store it in a storage.

Its like the top ten high scores. but try this video. But instead, use time.

https://www.youtube.com/watch?v=z_Z5rGSZnCo

I HOPE THIS HELPS!
B
9
S
1
Posts: 26
Reputation: 479

Post » Tue Mar 08, 2016 1:25 pm

@kossglobal

Sure, machine time could be changed by user.
You might try get timestamp from a server ( rex_firebase_timer plugin, or rex_parse_timer plugin )
B
109
S
27
G
277
Posts: 4,482
Reputation: 154,924

Post » Tue Mar 08, 2016 7:31 pm

Is it reliable? Because using a server that is not yours is unpredictable and could have the service ended in the future, which would ruin the entire game.

Thanks, @rexrainbow .

I was looking at it and I'm getting the time elapsed since logout. But how should I manage different items (which will be unlocked once their own timer end) from different players?
Situation:
Player A
items 1, 2 ,3
item 1 : timer X
item 2 : timer Y
item 3 : timer Z
Player B
items 1, 2 ,3
item 1 : timer X
item 2 : timer Y
item 3 : timer Z

Is this enough?
On start of layout
Define the Player ID to Player A.
Get Timer "item 1" of user ID: "Player A".

Blank condition> Start Timer "item 1" of user ID: "Player A" When Disconnected.

Also, this item would have to be different every time to avoid two items share the same timer. Then, whenever a player earns a new item, it's ID would be Last item ID + 1. Am I following a correct logic regarding to firebase and your plugin?
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Wed Mar 09, 2016 2:32 am

Yes, I though it is correct.
BTW, firebase was bought by google, but I could not promise it will be reliable, or not.
B
109
S
27
G
277
Posts: 4,482
Reputation: 154,924

Post » Wed Mar 09, 2016 2:50 am

@rexrainbow I think it's not a good idea rely on that for something really important to the game then. Aren't there any reliable online source to get the hour? It's just a simple thing you know? Get the time online instead from the phone and then, internally, I manage to know if it's time to unlock the item or not.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Wed Mar 09, 2016 3:55 am

"reliable" is a cost issue.
Build your own server will have the best reliable I agree, but it needs a lot of effort, not only write a simple program, running at a host machine.
Firebase might reliable online in one or two years recently, it is enough for normal case, imo.
( Parse will be closed at 2017, fortunately it had released a open source server for us. I had built it on heroku server already. )
B
109
S
27
G
277
Posts: 4,482
Reputation: 154,924

Post » Wed Mar 09, 2016 4:24 am

@rexrainbow Thanks for the advice :)
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Wed Mar 09, 2016 8:37 pm

kossglobal wrote:@rexrainbow Thanks for the advice :)


http://www.timeapi.org/utc/now
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests