I’m very new to game development, so I’m probably over my head here. But I really want to understand how I can have a countdown timer keep running even if the app is closed, can I achieve this with gdevelop? I want to make a game like neko atsume, if you’ve heard of that.
Basically I want random (with set % chance of something happening) events that happen even when the app is closed. So when the player turns it on again, there’s progress from the time elapsed since the last time the game was open.
I’ve asked a couple times on discord and answers were quite vague, albeit helpful and kind. I’ve searched this topic in the greater scope of programming and it looks super complicated, I was trying not to have to learn coding when I installed gdevelop. Any help on this topic would be great, thanks.
You’ll need a timer that runs, an event that tracks the current timestamp once the timer hits 5 minutes or a minute or something, and the file storage events to save the last timestamp upon exit, and reads it when you load the game. Then you would do all your calculations based off the time that has passed…I think?
I wouldn’t call that “quite vague” at all.
Okay, well we don’t have to argue about whether it is vague or not.
Do you know if I can get some help with these mentioned suggestions, such as the timer? I cannot find any of these options in either conditions or actions scroll down menus. I’m assuming I would need to add my own code? I have not been able to find the tutorial/ information I need to understand these steps. Thanks.
If you cannot find the timer, you haven’t looked for it, because it’s there, and it’s quite visible, and there’s even a search feature to help you find it.
There’s also a section about timers in the official documentation, and they’re covered by the basic tutorials, which means you haven’t even done that.
@Gruk He is new here, so it may be a little complex for him to understand.
@Chriswang the solution given by Silver Streak may be vague to you now since you have basic knowledge of the features. The solution he told needs knowledge about running a timer variable, then storing it using the File Storage feature.
After the user has rejoined the game, the timer value stored needs to be read and then you can find out the time he has already spent in the game.
I’ll leave the links that you can go through:
- Storage: Storage [GDevelop wiki]
- Timers: Timers [GDevelop wiki]
@Nilarjun thanks, you explaining this confirms with me that the timer and storage features can indeed achieve what I want, I just didn’t venture deep enough yet. Thank you for linking the resources.
@Gruk did I say I couldn’t find the timer? Please don’t assume and take things out of context. But yes I did get impatient on the tutorials and started to wonder if these features were too basic to achieve what I wanted.
Maybe this is your way of trying to help, I appreciate that if it’s the case. But understand that many people come to gdevelop for an easier way out from coding, and that means they might not always do ALL of EVERY tutorial thoroughly and have researched everything before asking questions. The way you reply may rub people the wrong way. If you’re a senior member here, please know you are not being welcoming at all.