• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Script: [v13+] Unreal Time System (like Minecraft)

Howdy! I've been trying to use this script for a while, and no matter what I do I always get the same crash whenever time changes.

[PokeCommunity.com] [v13+] Unreal Time System (like Minecraft)


It occurs when I pass time using the variable, enter another map, then transfer to another map. It also occurs when I speed time up and enter the map, then another one. I think it may relate to tones but I'm not sure. I'm using v17.2. Any help is sincerely appreciated!
 
Ah, nvm, I found out the problem, my bad! It wasn't the script.
 
I'm having a weird issue where the time shading stays on twilight and won't progress on from that. Is there any way to fix this?
 
I'm having a weird issue where the time shading stays on twilight and won't progress on from that. Is there any way to fix this?
The game tone only refreshes each 30 real time seconds. To change this refresh interval, at PField_Time, change the '30' on line 'Graphics.frame_count-@dayNightToneLastUpdate>=Graphics.frame_rate*30'.

I updated the script description to include this tip.
 
Hi! Does the script update the game day/night switches, such as
Code:
s:PBDayNight.isDay?

If not is there a way to make it so that it does?
 
I have a strange issue and I think more people may have it, when I trigger on/off the turbo, the time jumps from one "custom" hour to another "custom" hour, and back to the other. I guess there's something with this script, as when I use the turbo normally this doesn't happen




Edit: Ok, I solved it, in line:
time_played=(time_played*NTS_TIMEPROPORTION)/Graphics.frame_rate

I replaced Graphics.frame_rate for 40, in this way:
time_played=(time_played*NTS_TIMEPROPORTION)/40

And now it works fine, when I press turbo (which mainly was switching framerate from 40 to 100 and viceversa) it doesn't jump to a different hour
 
Last edited:
Hi! Does the script update the game day/night switches, such as
Code:
s:PBDayNight.isDay?

If not is there a way to make it so that it does?
Yes! This script updates these things, but script variable tiggers like "s:PBDayNight.isDay?" only are "checked" on special times, like when map loads.

Example: if you enter on map by night time and spend time until day, you need to reenter the map to activate events triggered on "s:PBDayNight.isDay?". This is Vanilla Essentials behaviour.
 
Would there be any way to change the names of the days of the week?
I'm using this script combined with the Simple HUD Menu and the names appear in English, I wanted to change them to my language.
 
Would there be any way to change the names of the days of the week?
I'm using this script combined with the Simple HUD Menu and the names appear in English, I wanted to change them to my language.
Add this code above main:
Code:
def getPortugueseWeekDay(time)
  ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"][time.wday]
end

And call it:
Code:
getPortugueseWeekDay(pbGetTimeNow)

Is there a time counter? I would like to do an event that lasts X hours or X days. How do I do this?
There several ways of doing this. I suggest this: Save total seconds on one variable, like
Code:
$game_variables[XX] = pbGetTimeNow.to_i

So, you can subtract from current time and do comparisons.


Example: I only allow player pass three days after the time is save.

To save time I use:
Code:
$game_variables[99] = pbGetTimeNow.to_i

To check, I use a conditional:
Code:
(pbGetTimeNow.to_i - $game_variables[99]) >= 3 * (60 * 60 * 24)
 
Spoiler:


Cool But will this works on PE 18.1
 
Hi! I love your script! I realize this is probably a different system entirely, but I was wondering if you knew how to set eggs to hatch by your time script, rather than by steps taken. I have a number of events I want to tie to time passing, but eggs are one of the big ones.
 
Hi! I love your script! I realize this is probably a different system entirely, but I was wondering if you knew how to set eggs to hatch by your time script, rather than by steps taken. I have a number of events I want to tie to time passing, but eggs are one of the big ones.
When an egg is generated, instead of using eggsteps, create another variable to save the received egg date (sum the time to egg hatch). On egg check (last lambda on PScreen_EggHatching), check this variable instead of eggsteps.
 
Last edited:
I don't think the day/night system has changed between updates.
I converted this script into a v19 plug-in and it didn't error, I haven't fully tested it or anything but in theory it should work fine.
 
All my maps are darkening even those inside the house, how do I make certain maps that this script does not work? I hope you can understand
 
All my maps are darkening even those inside the house, how do I make certain maps that this script does not work? I hope you can understand

That shouldn't be. Did you somehow tag the used tiles as "outdoor"? I'm using a really old version of Pokémon Essentials (v15) but I don't think that there is a difference in this regard. In the script "PField_Time" around line 119 or so you should see something like this:

Spoiler:


So, if the map is "outdoor", the game shades it according to the time. The unreal time script doesn't influence the shading process. At least not to my knowledge. My outdoor maps are shading, my indoor maps are not. Please double check not to accidentally use any outdoor tiles inside a house.

Also, I have a question regarding the change of night and day. Is it possible to have a seperate screen appear, that announces day / night?
I'm asking because I have some events taking place exclusively during the day or the night. And it looks really weird if something just suddenly disappears. So I was thinking, maybe it's possible to "hide" the disappearance by having an announcement appear. Sort of like in Majoras Mask, if anyone has played it, where there appears the "dawn of the <whatever day it is>" screen.
 
Last edited:
Also, I have a question regarding the change of night and day. Is it possible to have a seperate screen appear, that announces day / night?
I'm asking because I have some events taking place exclusively during the day or the night. And it looks really weird if something just suddenly disappears. So I was thinking, maybe it's possible to "hide" the disappearance by having an announcement appear. Sort of like in Majoras Mask, if anyone has played it, where there appears the "dawn of the <whatever day it is>" screen.
Time of Day Introduction.
 
You say it works with 19.1, but I can't seem to get it to work. It just doesn't do anything at all. I'm not sure what I'm doing wrong.

I tried converting it into a plugin, but no matter what I try, it doesn't seem to change time at all.
 
You say it works with 19.1, but I can't seem to get it to work. It just doesn't do anything at all. I'm not sure what I'm doing wrong.

I tried converting it into a plugin, but no matter what I try, it doesn't seem to change time at all.
Put 'p (pbGetTimeNow)' (without the quotes) as a script command on a NPC. The time runs faster? I tested right now on a NPC in v19.1 and this is working.
 
Back
Top