Atlat
Atlat
- 91
- Posts
- 5
- Years
- Seen yesterday
Is there a way to check if a second has passed? I'm trying to make it so that a variable decreases every second, and all of my attempts have just led to errors.
Is there a way to check if a second has passed? I'm trying to make it so that a variable decreases every second, and all of my attempts have just led to errors.
# Variable 90 should have pbGetTimeNow.to_i when the time start counting.
# Variable 91 is the variable that the time is decreased.
secondsPassed = pbGetTimeNow.to_i - $game_variables[90]
$game_variables[90] = $game_variables[90] + secondsPassed
$game_variables[91] = $game_variables[91] - secondsPassed
Works all of time if you make a Common Event with parallel trigger.Does that work all of time time, no matter where you are? Or does that only work on, say, the map that it was called on? Because what I need is the former of the two that is always checking for whenever a second passes.
Permanent night time did you mean only shading or the other night effects like encounters?Hello FL. I have a question related to your Unreal Time System script. Would it be possible to set your script up for a specific map in a way so that it's always nighttime there? There's not a way to do something like that with the default map metadata, so I was curious if something like permanent nighttime would be possible with your script. Thanks in advance if you can help me out.
After the script end add:I'm loving your script so far!
However, I'm wondering if there's a way I can make it so that there are only 4 months per year with 31 days per month? The fangame I'm working on is a Pokemon/Harvest Moon type of crossover. Any advice would be appreciated.
module UnrealTime
MONTH_DAYS = 31
MONTHS = 4
INITIAL_YEAR = 1
def self.day
return total_days % MONTH_DAYS + 1
end
# Starts on 1
def self.mon
return (total_days/MONTH_DAYS) % MONTHS + 1
end
def self.year
return total_days/(MONTH_DAYS*MONTHS) + INITIAL_YEAR
end
def self.total_days
c_date = pbGetTimeNow
i_date = initial_date
return (c_date.yday - i_date.yday) + ((c_date.year - i_date.year)*365.250001).floor
end
end
Yes! But this is unrelated with this script, except if you use this script as plan B, so the time won't pass if player has no internet. You can also sync the time on startup and use the script to pass the time, so you don't need to sync frequently.I don't know if this is the right place to ask, but is there any way to make the game connect to the internet and set the game time ALWAYS in a specific time zone?
My question is asked because, I realized that if I plant a berry, and advance the computer's time, it is simply ready.
This script? No. And Unreal time? Yes! I don't know how. I don't know much about rom hacking.Quick Question: I want to ask this real quick but is it possible to apply this to a gba game that I want to play on my GBA console? And maybe mod it so that the time works similar to PLA time cycle? Like an hour = a day and speed it up by taking a rest at a Pokecenter or healing spot?
Yes! But this is unrelated with this script, except if you use this script as plan B, so the time won't pass if player has no internet. You can also sync the time on startup and use the script to pass the time, so you don't need to sync frequently.
You need to call a time API and return it with Time object on pbGetTimeNow.
I have no example about this one because it is a bit tricky. You need to combine (broken link removed), to receive something from time API and parse the input (time value) from a JSON.Can you give me an example script for me to put to check the internet time when starting the game? This part I don't understand, but about booting with your script, I learned easily.
Thanks for the report!Hi there!! Looks like this script is no longer working on the new version of essentials (v20) D:
toclass PokeBattle_Scene
and it should work on v20!!class Battle::Scene
Thanks! Since it's just this, script was updated!Just change line 271 from
to
and it should work on v20!!
Edit: Oh no... emojis.. I don't know how to make that go away. It's replacing a colon and an `S`.
class Battle : : Scene (without spaces, except after the word `class`)