How do I make a resin system similar to genshin or wuwa. Wherein there is a variable that is bind with time that caps at 240 and regen 1 every 12 minutes. And it can track the time even if the game is not running. Sorry im new, i just started last week.
Hello.
Your question is pretty confusing. I’m not familiar with this kind of systems.
You are much more likely to get help if you take more time with formulating your post. Explain clearly and with detail. Draw pictures to demonstrate your ideas. Make sure others understand what you are trying to do.
If you are new then you will have VERY bad experience
Even so gdevelop is easy to learn you still need to LEARN
SO i leave you with choice
Either take my advice and take your time to learn how to do stuff by watching youtube tutorials/checking some examples
Or go with bad experience by pushing yourself into something that will just get harder each step
To make regen system you simple make number variable for example let’s call it Energy
Now there is condition called compare two numbers
Easiest way to find it is to add condition and in search bar type compare
So you will make event
Condition
Compare two numbers mod(TimeFromStart(),720) is greater than 1
Variable energy LESS THAN 240
Trigger once
Action
Change Energy ADD 1
This will add 1 to Energy variable each 12 mins until Energy variable reaches 240
When it reaches it then it will stop adding more
I mean it will at 1 at beginning of each 12 mins cycle then wait 12 mins and repeat
If you want it to add 1 when cycle ends and not right from the start of cycle then you need
mod(TimeFromStart(),720) is greater than 718
To simplify imagine you have 1 minute and you will get 1 apple
You can get 1 apple at 1st sec of each minute
Or you can get 1 apple at 59th sec of each minute
That’s the difference
And then for tracking time while game is off you can use extension below
Hello and welcome. I have a tutorial example which shows Life being refilled by 1 every 5 minutes until it reaches a cap of 5 Lives. You can download the example and see how it works because it sounds similar to what you mention in your topic.
If you change the project Global Variables MaxLife to 240 and RegenLength to 720000 (12 minutes in milliseconds) you can see it working with the exact values you want.
I have recently updated this example to be compatible with the current version of GDevelop if you would like to see it. Scroll down to see the GDevelop project file that I uploaded. It should be free although I think itch does always ask for a donation but you can ignore that and click continue to download.