• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • The Eevee Expo Game Jam has concluded! 🎉 Head on over to the game jam forum to play through the games.
    Don't forget to come back September 21st to vote for your favorites!
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!

Issue with Wild Encounters

Katelyn888

Novice
Member
Joined
Apr 7, 2025
Posts
33
As the title says, this is an issue that I recently started to experience. Quick background: Based on Essentials Overworld Time, morning ends at 10a, but afternoon doesn't start until 12, leaving a 2 hour gap between. This is something that I was never a fan of back when the original G/S/C came out, so after a while of learning some Essentials, I decided to change this.

Here's where I'm stumped: After changing the morning time to run until 12p, I was still getting Overworld morning encounters for a day or two before it stopped. In response, I modded the script, I had removed "day" where it said morning and from the other "mornings" as well and everything was working fine. A few days ago, I installed the Overworld Wild Encounters script by derFischae and everything was still working. Yesterday during a playtest, there was a wild encounter on the map, but ended up having to battle my rival on the Route. AFTER the battle, all of my morning encounters stopped working. Afternoon/Evening/Night all work except that I'm not running into any "tile" encounters; just the ones that show up in the overworld, which I was able to do the night before. Nothing was changed from that previous night to the next morning, so I'm not sure. Also, all my versions are set to 0 for each encounter map. Any help appreciated. I don't know how to post a screenshot on here as it's just giving me a place to put an internet link, so here's the rough code:

Day and night system
#===============================================================================
def pbGetTimeNow
return Time.now
end

#===============================================================================
#
#===============================================================================
module PBDayNight
HOURLY_TONES = [
Tone.new(-70, -90, 15, 55), # Night # Midnight
Tone.new(-70, -90, 15, 55), # Night
Tone.new(-70, -90, 15, 55), # Night
Tone.new(-70, -90, 15, 55), # Night
Tone.new(-60, -70, -5, 50), # Night
Tone.new(-40, -50, -35, 50), # Day/morning
Tone.new(-40, -50, -35, 50), # Day/morning # 6AM
Tone.new(-40, -50, -35, 50), # Day/morning
Tone.new(-40, -50, -35, 50), # Day/morning
Tone.new(-20, -25, -15, 20), # Day/morning
Tone.new(-20, -25, -15, 20), # Day/morning
Tone.new(-20, -25, -15, 20), # Day/morning
Tone.new( 0, 0, 0, 0), # Day/afternoon # Noon
Tone.new( 0, 0, 0, 0), # Day/afternoon
Tone.new( 0, 0, 0, 0), # Day/afternoon
Tone.new( 0, 0, 0, 0), # Day/afternoon
Tone.new( 0, 0, 0, 0), # Day/afternoon
Tone.new( 0, 0, 0, 0), # Day/afternoon
Tone.new( -5, -30, -20, 0), # Day/evening # 6PM
Tone.new(-15, -60, -10, 20), # Day/evening
Tone.new(-15, -60, -10, 20), # Day/evening
Tone.new(-40, -75, 5, 40), # Night
Tone.new(-70, -90, 15, 55), # Night
Tone.new(-70, -90, 15, 55) # Night
 
As the title says, this is an issue that I recently started to experience. Quick background: Based on Essentials Overworld Time, morning ends at 10a, but afternoon doesn't start until 12, leaving a 2 hour gap between. This is something that I was never a fan of back when the original G/S/C came out, so after a while of learning some Essentials, I decided to change this.

Here's where I'm stumped: After changing the morning time to run until 12p, I was still getting Overworld morning encounters for a day or two before it stopped. In response, I modded the script, I had removed "day" where it said morning and from the other "mornings" as well and everything was working fine. A few days ago, I installed the Overworld Wild Encounters script by derFischae and everything was still working. Yesterday during a playtest, there was a wild encounter on the map, but ended up having to battle my rival on the Route. AFTER the battle, all of my morning encounters stopped working. Afternoon/Evening/Night all work except that I'm not running into any "tile" encounters; just the ones that show up in the overworld, which I was able to do the night before. Nothing was changed from that previous night to the next morning, so I'm not sure. Also, all my versions are set to 0 for each encounter map. Any help appreciated. I don't know how to post a screenshot on here as it's just giving me a place to put an internet link, so here's the rough code:

Day and night system
#===============================================================================
def pbGetTimeNow
return Time.now
end

#===============================================================================
#
#===============================================================================
module PBDayNight
HOURLY_TONES = [
Tone.new(-70, -90, 15, 55), # Night # Midnight
Tone.new(-70, -90, 15, 55), # Night
Tone.new(-70, -90, 15, 55), # Night
Tone.new(-70, -90, 15, 55), # Night
Tone.new(-60, -70, -5, 50), # Night
Tone.new(-40, -50, -35, 50), # Day/morning
Tone.new(-40, -50, -35, 50), # Day/morning # 6AM
Tone.new(-40, -50, -35, 50), # Day/morning
Tone.new(-40, -50, -35, 50), # Day/morning
Tone.new(-20, -25, -15, 20), # Day/morning
Tone.new(-20, -25, -15, 20), # Day/morning
Tone.new(-20, -25, -15, 20), # Day/morning
Tone.new( 0, 0, 0, 0), # Day/afternoon # Noon
Tone.new( 0, 0, 0, 0), # Day/afternoon
Tone.new( 0, 0, 0, 0), # Day/afternoon
Tone.new( 0, 0, 0, 0), # Day/afternoon
Tone.new( 0, 0, 0, 0), # Day/afternoon
Tone.new( 0, 0, 0, 0), # Day/afternoon
Tone.new( -5, -30, -20, 0), # Day/evening # 6PM
Tone.new(-15, -60, -10, 20), # Day/evening
Tone.new(-15, -60, -10, 20), # Day/evening
Tone.new(-40, -75, 5, 40), # Night
Tone.new(-70, -90, 15, 55), # Night
Tone.new(-70, -90, 15, 55) # Night
Regarding adding images: https://eeveeexpo.com/resources/1521/

Regarding your post: You've only really posted the tone definitions of the day night cycle. I see you altered the comments, was that the only thing you've changed? If so, you haven't done anything because comments aren't read by the system.

Otherwise, can you post just the changes you've made in the script?
 
Yeah, what @wrigty12 stated. From what I gather, you just changed these two lines in vanilla Essentials

Code:
Expand Collapse Copy
    Tone.new(  0,   0,   0,  0),   # Day
    Tone.new(  0,   0,   0,  0),   # Day

Into this:

Code:
Expand Collapse Copy
Tone.new(-20, -25, -15, 20), # Day/morning
Tone.new(-20, -25, -15, 20), # Day/morning

Since comments are ignored (#Day/morning), changing that bit does literally nothing to the system. Basically, all the code does that you posted just changes the tint of the screen a little for those two hours but it otherwise has no bearings on when morning/night pokemon appear. You'd have to poke around other places in the code for that. Specifically, right below the code you posted in Essentials is this:

Code:
Expand Collapse Copy
  # Returns true if it's day.
  def self.isDay?(time = nil)
    time = pbGetTimeNow if !time
    return (time.hour >= 5 && time.hour < 20)
  end

  # Returns true if it's night.
  def self.isNight?(time = nil)
    time = pbGetTimeNow if !time
    return (time.hour >= 20 || time.hour < 5)
  end

  # Returns true if it's morning.
  def self.isMorning?(time = nil)
    time = pbGetTimeNow if !time
    return (time.hour >= 5 && time.hour < 10)
  end

  # Returns true if it's the afternoon.
  def self.isAfternoon?(time = nil)
    time = pbGetTimeNow if !time
    return (time.hour >= 14 && time.hour < 17)
  end

  # Returns true if it's the evening.
  def self.isEvening?(time = nil)
    time = pbGetTimeNow if !time
    return (time.hour >= 17 && time.hour < 20)
  end
You'd need to change the numbers on the return (time.hour... bits that separate the different times of day there. Basically, they set the time parameters on when day/night/evening/morning are by returning true during certain defined times.


Anyhow, that all said, I'm inclined to say the issue your facing probably has to do with the script you added ("Overworld Wild Encounters script by derFischae"), although I'm not personally familiar with it so posting what you added and where for that would be quite helpful. I think it's also worth considering that sometimes when you add new scripts to your game and continue an old save that did not originally have that script, things will get screwed up because your load is after the point where the relevant code might have been set up initially. That said, you could just start a fresh game and see if the issue resolves itself.
 
Yeah, what @wrigty12 stated. From what I gather, you just changed these two lines in vanilla Essentials

Code:
Expand Collapse Copy
    Tone.new(  0,   0,   0,  0),   # Day
    Tone.new(  0,   0,   0,  0),   # Day

Into this:

Code:
Expand Collapse Copy
Tone.new(-20, -25, -15, 20), # Day/morning
Tone.new(-20, -25, -15, 20), # Day/morning

Since comments are ignored (#Day/morning), changing that bit does literally nothing to the system. Basically, all the code does that you posted just changes the tint of the screen a little for those two hours but it otherwise has no bearings on when morning/night pokemon appear. You'd have to poke around other places in the code for that. Specifically, right below the code you posted in Essentials is this:

Code:
Expand Collapse Copy
  # Returns true if it's day.
  def self.isDay?(time = nil)
    time = pbGetTimeNow if !time
    return (time.hour >= 5 && time.hour < 20)
  end

  # Returns true if it's night.
  def self.isNight?(time = nil)
    time = pbGetTimeNow if !time
    return (time.hour >= 20 || time.hour < 5)
  end

  # Returns true if it's morning.
  def self.isMorning?(time = nil)
    time = pbGetTimeNow if !time
    return (time.hour >= 5 && time.hour < 10)
  end

  # Returns true if it's the afternoon.
  def self.isAfternoon?(time = nil)
    time = pbGetTimeNow if !time
    return (time.hour >= 14 && time.hour < 17)
  end

  # Returns true if it's the evening.
  def self.isEvening?(time = nil)
    time = pbGetTimeNow if !time
    return (time.hour >= 17 && time.hour < 20)
  end
You'd need to change the numbers on the return (time.hour... bits that separate the different times of day there. Basically, they set the time parameters on when day/night/evening/morning are by returning true during certain defined times.


Anyhow, that all said, I'm inclined to say the issue your facing probably has to do with the script you added ("Overworld Wild Encounters script by derFischae"), although I'm not personally familiar with it so posting what you added and where for that would be quite helpful. I think it's also worth considering that sometimes when you add new scripts to your game and continue an old save that did not originally have that script, things will get screwed up because your load is after the point where the relevant code might have been set up initially. That said, you could just start a fresh game and see if the issue resolves itself.

So, I had done that, but wow, can't believe that I forgot about it. This was a few days a part. When I originally went to modify the time, I modified both morning/day (which I'm guessing you are referring to as comments, which is starting to make sense because, like in event, is green for comments. I'm only about a month into learning/using the program, so forgive me for any "wording"). I did see that below and had changed it to 11 instead of 12! So, I was getting morning encounters up until 11, where I wouldn't have them for an hour.

Regarding the overworld encounters; I found out it's a setting that I missed in the scripts as the thread for that is like 60 pages long.

Thank you again for your help!

Katelyn
 
Back
Top