ambiera home ambiera home

Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name:  Password:
Ambiera Forum > CopperCube > Help with CopperCube
While game is off
Author Text

Coppercube User
Guest
Quote
2018-12-14 01:43:49

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


j9907
Registered User
Quote
2018-12-14 01:57:47

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).


Coppercube User
Guest
Quote
2018-12-14 02:10:26

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


xanimalkingx
Registered User
Quote
2018-12-14 03:31:33

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.


just_in_case
Registered User
Quote
2018-12-16 08:54:00

Method proposed by xanimalking is just perfect to do this..


Cucu
Guest
Quote
2018-12-17 16:30:24

(probably a default windows location like C:/AppData/Local/Temp).

the game is for mobile



xanimalkingx
Registered User
Quote
2018-12-17 23:01:41

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.


crusly
Registered User
Quote
2018-12-19 01:59:34

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.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "?nternational" (you are not logged in)


Text:

 

  

Forum Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   





Software: Ambiera Light Forum. © 2008-2019 Nikolaus Gebhardt, Ambiera e.U.