How do I Determine how many days since last launch ?

Get help using Construct 2

Post » Sun May 15, 2016 6:04 pm

is there a way to detect how many hours [actually I just want to know how many days] since the last time the game was opened ?
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Mon May 16, 2016 1:57 pm

I think you can obtain system date/time through a plugin or simple expressions (i'm not sure about this last).

First, set the date and time in a persistent data like local storage everytime the app's closed. Then when the app is opened again, calculate the hours/days difference between current and stored time.

Sorry about my english D:
B
19
S
6
G
2
Posts: 256
Reputation: 2,640

Post » Mon May 16, 2016 3:49 pm

You want this on a global basis or a per-user basis?
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"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
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Mon May 16, 2016 5:10 pm

Per user.
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Mon May 16, 2016 5:11 pm

Josek5494 wrote:I think you can obtain system date/time through a plugin or simple expressions (i'm not sure about this last).

First, set the date and time in a persistent data like local storage everytime the app's closed. Then when the app is opened again, calculate the hours/days difference between current and stored time.

Sorry about my english D:


You have been very helpful.

The next question is, how to retrieve the date time in an easy to calculate way that allows me to easily calculate how many 24hours have passed since last launch ? :)
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Mon May 16, 2016 5:17 pm

@Toddler

Please don't multipost the same topic in different sections.

I've merged the posts and removed the duplicate.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
131
S
29
G
81
Posts: 5,328
Reputation: 56,630

Post » Mon May 16, 2016 5:42 pm

Message: Josek5494 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Toddler wrote:
You have been very helpful.

The next question is, how to retrieve the date time in an easy to calculate way that allows me to easily calculate how many 24hours have passed since last launch ? :)


You can use Rex's date plugin: http://c2rexplugins.weebly.com/rex_date.html

I haven't tested it yet but it seems very good and easy ^^
B
19
S
6
G
2
Posts: 256
Reputation: 2,640

Post » Mon May 16, 2016 11:53 pm

The minute I use it it reports an error, I wrote in his discussion thread, hope to hear from him soon.
You are very helpful josek5494, thanks !
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Tue May 17, 2016 4:53 pm

Toddler wrote:
Josek5494 wrote:The next question is, how to retrieve the date time in an easy to calculate way that allows me to easily calculate how many 24hours have passed since last launch ? :)


Do you care if your date and time can be manipulated by users? And do you need to translate these times between users or do you only care that a given user can see his own time played/last time the client was updated?
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"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
22
S
6
G
1
Posts: 1,414
Reputation: 4,822

Post » Tue May 17, 2016 5:50 pm

The last one !
WOW you are detail ! I am so going to be helped ! Thanks !
B
12
S
3
Posts: 288
Reputation: 1,694

Next

Return to How do I....?

Who is online

Users browsing this forum: Lancifer, Yahoo [Bot] and 4 guests