x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

track time while game off

Hi!

I'm trying to find out atm how I could track time while game is shut down. Like if player does something that starts a timer for and example player puts a building in to making that takes 1,5h to construct, how do I tack it so that I could A) give a push notification when the construction is ready and B) have the construction done or show correct remaining time when opening the app again?

Do I need some backend shenanigans to do this or is it possible to do this offline? The game in it self doesen't need online so this would be not prefered...

Thanks!

Product Version: UE 4.20
Tags:
more ▼

asked Oct 02 '18 at 02:03 PM in Blueprint Scripting

avatar image

Pekka
3 1 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

This should work:

  • create a variable of type Date Time, let's call it Previous Time

  • use Now to obtain current system time, set Previous Time to Now

  • save this var to a Save Game Object

When you're ready to check the time:

  • load the variable from a save game slot

  • Now - Previous Time = time elapsed

  • format the result as minutes (or whatever you desire)

  • if result > 90 then construction has finished


edit: did not notice it was for mobile, not sure if the above is applicable, should be

more ▼

answered Oct 02 '18 at 04:02 PM

avatar image

Everynone
15.2k 77 25 62

avatar image Pekka Oct 05 '18 at 09:17 PM

Yeh, this worked well, thanks!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

You can use the schedule local notification at time node for, I'm guessing it's only for mobiles though (seems logical), For PC I am unsure.

Same as Everyone - edit: did not notice it was for mobile, not sure if the above is applicable, should be

more ▼

answered Oct 02 '18 at 11:14 PM

avatar image

timsev7n
98 2 5 8

avatar image Pekka Oct 05 '18 at 09:26 PM

This seems to be working also, Thanks!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question