Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hey I'm trying to make real time timers for constructing things but I need the timers to keep counting down when a player leaves the game so when he's back he can see how much time is left.. the game is for mobile |
||||
|
ooh, hmm. I don't think that can be done. Well, actually, it MIGHT be doable if you have the know-how and have the Studio edition (so you can edit the source code for the Android client and then add that feature). |
||||
|
wrote: ooh, hmm. I don't think that can be done. Well, actually, it MIGHT be doable if you have the know-how and have the Studio edition (so you can edit the source code for the Android client and then add that feature). Alright thanks, I guess imma make a city building game without building wait times haha |
||||
|
Coppercube User wrote: Hey I'm trying to make real time timers for constructing things but I need the timers to keep counting down when a player leaves the game so when he's back he can see how much time is left.. the game is for mobile What you can try to do is write the current time to a text file somewhere private where the user wont know (probably a default windows location like C:/AppData/Local/Temp) then the next time the game is ran, compare the current time to the last time that was stored into the text file, then do stuff. |
||||
|
Method proposed by xanimalking is just perfect to do this.. |
||||
|
(probably a default windows location like C:/AppData/Local/Temp). the game is for mobile
|
||||
|
Cucu wrote: (probably a default windows location like C:/AppData/Local/Temp). the game is for mobile I missed that. If that is so, then I have no suggestions. I don't even think it's possible in mobile. If you can somehow write to your app's external cache, then you could but... CopperCube doesn't allow you to write directly as Java code. |
||||
|
Maibe you can use a variable "counter" (as example) and use the behavior "Every few seconds do something" to increment the variable "counter". (Apply this behavior to the Root Scene Node: named "New 3d Scene") You can indicate (on the behavior parameters) in Miliseconds how much time you need to use in small increments.. I use this method on a project some years ago, for mobile and worked fine for me. Hope this can help you! Update: But also.. you need some text-file to store the time-stamp data from the last time the player was off. |
|