• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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)

Byliyth

A Giant Mess
13
Posts
5
Years
    • Seen Jul 4, 2020
    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.

    unknown.png


    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!
     

    Byliyth

    A Giant Mess
    13
    Posts
    5
    Years
    • Seen Jul 4, 2020
    Ah, nvm, I found out the problem, my bad! It wasn't the script.
     
    4
    Posts
    3
    Years
    • Seen Jan 13, 2021
    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?
     

    FL

    Pokémon Island Creator
    2,450
    Posts
    13
    Years
    • Seen today
    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.
     
    311
    Posts
    4
    Years
  • 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?
     
    39
    Posts
    8
    Years
    • Seen May 2, 2024
    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:

    FL

    Pokémon Island Creator
    2,450
    Posts
    13
    Years
    • Seen today
    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.
     

    DragonN3xus

    Still looking for the One Piece
    24
    Posts
    4
    Years
  • 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.
     
    232
    Posts
    7
    Years
    • Seen Apr 24, 2024
    Is there a time counter? I would like to do an event that lasts X hours or X days. How do I do this?
     

    FL

    Pokémon Island Creator
    2,450
    Posts
    13
    Years
    • Seen today
    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)
     

    YashPokeFan123

    #PokeFan
    283
    Posts
    3
    Years
    • Seen Apr 28, 2023
    Spoiler:


    Cool But will this works on PE 18.1
     
    2
    Posts
    3
    Years
    • Seen Mar 24, 2021
    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.
     

    FL

    Pokémon Island Creator
    2,450
    Posts
    13
    Years
    • Seen today
    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:
    277
    Posts
    15
    Years
  • 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.
     

    etique

    etique
    268
    Posts
    6
    Years
    • Seen Oct 30, 2022
    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
     
    53
    Posts
    8
    Years
  • 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:

    FL

    Pokémon Island Creator
    2,450
    Posts
    13
    Years
    • Seen today
    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.
     
    5
    Posts
    6
    Years
    • Seen Oct 21, 2021
    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.
     

    FL

    Pokémon Island Creator
    2,450
    Posts
    13
    Years
    • Seen today
    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