• 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)

Okay, so I know this is an old thread at this point, but I want to make sure it's not a problem with this plugin but likely another plugin's compatibility (specifically Auto Multi Save in v21.1). If I quit the game entirely, everything works fine, and if I use the quit button that brings me back to the title screen, it also works just fine. But soft resetting is causing some funky issues where time seems to be further than it would otherwise be. Add on the fact that turning off soft resetting in mkxp isn't working properly ("enableReset": false, but I can still soft reset. This seems to be an issue with mkxp though because even a basic Essentials game with no changes doesn't properly work) so I can't stop people from soft resetting and breaking their games. I'm not sure what and where the issue is, but I want to see if the issue stems from here or from Auto Multi Save (my two most likely candidates for the error origin).
 
Okay, so I know this is an old thread at this point, but I want to make sure it's not a problem with this plugin but likely another plugin's compatibility (specifically Auto Multi Save in v21.1). If I quit the game entirely, everything works fine, and if I use the quit button that brings me back to the title screen, it also works just fine. But soft resetting is causing some funky issues where time seems to be further than it would otherwise be. Add on the fact that turning off soft resetting in mkxp isn't working properly ("enableReset": false, but I can still soft reset. This seems to be an issue with mkxp though because even a basic Essentials game with no changes doesn't properly work) so I can't stop people from soft resetting and breaking their games. I'm not sure what and where the issue is, but I want to see if the issue stems from here or from Auto Multi Save (my two most likely candidates for the error origin).
This is an old thread, but still supported (like practically all of my scripts).

I tested here, and Graphics.frame_rate goes form 60 to 40 when I soft reset. Sounds to me like an Essentials/mkxp-z bug, I already reported about this issue.

In meantime, to fix this issue, put this code after the end of my script:
Code:
module Graphics
  def self.frame_rate
    return 60
  end
end
 
This is an old thread, but still supported (like practically all of my scripts).

I tested here, and Graphics.frame_rate goes form 60 to 40 when I soft reset. Sounds to me like an Essentials/mkxp-z bug, I already reported about this issue.

In meantime, to fix this issue, put this code after the end of my script:
Code:
module Graphics
  def self.frame_rate
    return 60
  end
end
Thanks! That fixed it.
 
Updated to correctly work with game that have frame rates different from 40.

To update saves with the old version (before 1.2), if your TIME_STOPS is false, no action is necessary. If it isn't, in scripts (StartGame script section in Essentials v21.1) after line 'SaveData.load_all_values(save_data)' add line '$PokemonGlobal.convert_old_unreal_time'. Add this code at the end of Unreal Time script:

Ruby:
class PokemonGlobalMetadata
  def convert_old_unreal_time
    return if !@newFrameCount || @newFrameCount==0
    @newSecondCount = 0.0 if !@newSecondCount
    @newSecondCount+=@newFrameCount/40.0
    @newFrameCount = 0
  end
end
 
Good evening, even though im here a few years late im gonna hope that i can get help.
So I know its explained in the first page of the forum, but even though im using the UnrealTime.add_seconds(28800) to pass 8 hours it doesnt change anything.
Im not supossed to use it on a script or im doing something wrong?
I also tried the 3 options to just set the day to an especific hour but it neither worked.
And yes, i did set the variable (in my case to 26) and in the scripts i changed the variable 87 to 26.
Thanks
 
Good evening, even though im here a few years late im gonna hope that i can get help.
So I know its explained in the first page of the forum, but even though im using the UnrealTime.add_seconds(28800) to pass 8 hours it doesnt change anything.
Im not supossed to use it on a script or im doing something wrong?
I also tried the 3 options to just set the day to an especific hour but it neither worked.
And yes, i did set the variable (in my case to 26) and in the scripts i changed the variable 87 to 26.
Thanks
I guess that you are doing something wrong, since other people reported of this working. First, let's make sure that the issue is with the script and not a wrongly configured map. Put this in a script event command.
Code:
print(pbGetTimeNow)
UnrealTime.add_seconds(28800)
print(pbGetTimeNow)
The time changed?
 
I guess that you are doing something wrong, since other people reported of this working. First, let's make sure that the issue is with the script and not a wrongly configured map. Put this in a script event command.
Code:
print(pbGetTimeNow)
UnrealTime.add_seconds(28800)
print(pbGetTimeNow)
The time changed?
It did change the time, so i supposse it has something to do with the map as you said because the screen tone isnt changing.
(Edit): yep, i totally forgot to turn on the setting in the metadata.
Im really thankfull for your help, and amazing plugin
 
Last edited:
  • Like
Reactions: FL
Back
Top