• 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 Trading Card Game 2 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.

Sandstorms and night time

Florio

Pokemon Crimson Skies Owner
  • 391
    Posts
    16
    Years
    I have noticed that there is a problem with the sandstorms and how they look at night. Take a look at these pictures.

    [PokeCommunity.com] Sandstorms and night time
    [PokeCommunity.com] Sandstorms and night time


    As you can see, the sandstorm looks good in the daytime, but awful in the nighttime. Probably because Essentials doesn't tint the weather effects to adjust to the time of day.

    My question is, is there a way to make it so that the sandstorm matches the time of day, and has a darkness tint so that it looks good in the nighttime?
     
    Here's the method that controls the sandstorm bitmaps, and the colors (in PokemonFieldWeather )

    Code:
    def prepareSandstormBitmaps
          if !@sandstormBitmap1
            bmwidth=200
            bmheight=200
            @sandstormBitmap1=Bitmap.new(bmwidth,bmheight)
            @sandstormBitmap2=Bitmap.new(bmwidth,bmheight)
            sandstormColors=[
               Color.new(31*8,28*8,17*8),
               Color.new(23*8,16*8,9*8),
               Color.new(29*8,24*8,15*8),
               Color.new(26*8,20*8,12*8),
               Color.new(20*8,13*8,6*8),
               Color.new(31*8,30*8,20*8),
               Color.new(27*8,25*8,20*8)
            ]
            for i in 0..600
              @sandstormBitmap1.fill_rect(rand(bmwidth/2)*2, rand(bmheight/2)*2, 2,2,sandstormColors[rand(7)])
              @sandstormBitmap2.fill_rect(rand(bmwidth/2)*2, rand(bmheight/2)*2, 2,2,sandstormColors[rand(7)])
            end
            @weatherTypes[4][0][0]=@sandstormBitmap1
            @weatherTypes[4][0][1]=@sandstormBitmap2
          end
        end

    My first thought would be to have sandstormColors be set conditionally dependent on the time of day. For the actual colors to use, I would make a method that returns the tone changes in PokemonTime and apply that. The only current method I see that does it is a private method, but making a new one should be too difficult.

    My only concern is that with different tones applied, it might not look like a sandstorm anymore.
     
    Here's the method that controls the sandstorm bitmaps, and the colors (in PokemonFieldWeather )

    Code:
    def prepareSandstormBitmaps
          if !@sandstormBitmap1
            bmwidth=200
            bmheight=200
            @sandstormBitmap1=Bitmap.new(bmwidth,bmheight)
            @sandstormBitmap2=Bitmap.new(bmwidth,bmheight)
            sandstormColors=[
               Color.new(31*8,28*8,17*8),
               Color.new(23*8,16*8,9*8),
               Color.new(29*8,24*8,15*8),
               Color.new(26*8,20*8,12*8),
               Color.new(20*8,13*8,6*8),
               Color.new(31*8,30*8,20*8),
               Color.new(27*8,25*8,20*8)
            ]
            for i in 0..600
              @sandstormBitmap1.fill_rect(rand(bmwidth/2)*2, rand(bmheight/2)*2, 2,2,sandstormColors[rand(7)])
              @sandstormBitmap2.fill_rect(rand(bmwidth/2)*2, rand(bmheight/2)*2, 2,2,sandstormColors[rand(7)])
            end
            @weatherTypes[4][0][0]=@sandstormBitmap1
            @weatherTypes[4][0][1]=@sandstormBitmap2
          end
        end

    My first thought would be to have sandstormColors be set conditionally dependent on the time of day. For the actual colors to use, I would make a method that returns the tone changes in PokemonTime and apply that. The only current method I see that does it is a private method, but making a new one should be too difficult.

    My only concern is that with different tones applied, it might not look like a sandstorm anymore.

    I think it'll still look good, it looks awful during night time right now because it doesn't match the darkness. Is there any way you or anyone else could write up a script to do this?
     
    Hey guys I still really need this and if I could get help on it I would be very grateful. And plus I am sure many other people could make great use of this.
     
    Hey guys I still really need this and if I could get help on it I would be very grateful. And plus I am sure many other people could make great use of this.

    I literally gave you all the information you needed already. Replace prepareSandstormBitmaps with

    Code:
    def prepareSandstormBitmaps
          t=Time.now
          if t.hour != @sandstorm_hour
            @sandstorm_hour=t.hour
            @sandstormBitmap1.dispose if @sandstormBitmap1
            @sandstormBitmap2.dispose if @sandstormBitmap2
          end
         if (!@sandstormBitmap1 || @sandstormBitmap1.disposed?)
            bmwidth=200
            bmheight=200
            @sandstormBitmap1=Bitmap.new(bmwidth,bmheight)
            @sandstormBitmap2=Bitmap.new(bmwidth,bmheight)
            toneadjust=(PBDayNight.isNight?(pbGetTimeNow) || PBDayNight.isEvening?(pbGetTimeNow))?PBDayNight.getTone():Tone.new(0,0,0,255)
            sandstormColors=[
               Color.new(31*8+toneadjust.red,28*8+toneadjust.green,17*8+toneadjust.blue,toneadjust.gray),
               Color.new(23*8+toneadjust.red,16*8+toneadjust.green,9*8+toneadjust.blue,toneadjust.gray),
               Color.new(29*8+toneadjust.red,24*8+toneadjust.green,15*8+toneadjust.blue,toneadjust.gray),
               Color.new(26*8+toneadjust.red,20*8+toneadjust.green,12*8+toneadjust.blue,toneadjust.gray),
               Color.new(20*8+toneadjust.red,13*8+toneadjust.green,6*8+toneadjust.blue,toneadjust.gray),
               Color.new(31*8+toneadjust.red,30*8+toneadjust.green,20*8+toneadjust.blue,toneadjust.gray),
               Color.new(27*8+toneadjust.red,25*8+toneadjust.green,20*8+toneadjust.blue,toneadjust.gray)
            ]
            for i in 0..600
              @sandstormBitmap1.fill_rect(rand(bmwidth/2)*2, rand(bmheight/2)*2, 2,2,sandstormColors[rand(7)])
              @sandstormBitmap2.fill_rect(rand(bmwidth/2)*2, rand(bmheight/2)*2, 2,2,sandstormColors[rand(7)])
            end
            @weatherTypes[4][0][0]=@sandstormBitmap1
            @weatherTypes[4][0][1]=@sandstormBitmap2
          end
        end

    and add
    Code:
    @sandstorm_hour=0
    to the initialize clause.

    This seems to only change the bitmaps once each play session, so you have to let it know when to do it again. Sandstorm becomes a mix of pale yellow and blue. So you can still tell that it's a sandstorm.
     
    Last edited:
    I literally gave you all the information you needed already. Replace prepareSandstormBitmaps with

    Code:
    def prepareSandstormBitmaps
          t=Time.now
          if t.hour != @sandstorm_hour
            @sandstorm_hour=t.hour
            @sandstormBitmap1.dispose if @sandstormBitmap1
            @sandstormBitmap2.dispose if @sandstormBitmap2
          end
          if (!@sandstormBitmap1 || @sandstormBitmap1.disposed?)
            bmwidth=200
            bmheight=200
            @sandstormBitmap1=Bitmap.new(bmwidth,bmheight)
            @sandstormBitmap2=Bitmap.new(bmwidth,bmheight)
            toneadjust=(PBDayNight.isNight?(pbGetTimeNow) || PBDayNight.isEvening?(pbGetTimeNow))?PBDayNight.getTone():Tone.new(0,0,0)
            sandstormColors=[
               Color.new(31*8+toneadjust.red,28*8+toneadjust.blue,17*8+toneadjust.green),
               Color.new(23*8+toneadjust.red,16*8+toneadjust.blue,9*8+toneadjust.green),
               Color.new(29*8+toneadjust.red,24*8+toneadjust.blue,15*8+toneadjust.green),
               Color.new(26*8+toneadjust.red,20*8+toneadjust.blue,12*8+toneadjust.green),
               Color.new(20*8+toneadjust.red,13*8+toneadjust.blue,6*8+toneadjust.green),
               Color.new(31*8+toneadjust.red,30*8+toneadjust.blue,20*8+toneadjust.green),
               Color.new(27*8+toneadjust.red,25*8+toneadjust.blue,20*8+toneadjust.green)
            ]
            for i in 0..600
              @sandstormBitmap1.fill_rect(rand(bmwidth/2)*2, rand(bmheight/2)*2, 2,2,sandstormColors[rand(7)])
              @sandstormBitmap2.fill_rect(rand(bmwidth/2)*2, rand(bmheight/2)*2, 2,2,sandstormColors[rand(7)])
            end
            @weatherTypes[4][0][0]=@sandstormBitmap1
            @weatherTypes[4][0][1]=@sandstormBitmap2
          end
        end

    and add
    Code:
    @sandstorm_hour=0
    to the initialize clause.

    This seems to only change the bitmaps once each play session, so you have to let it know when to do it again. Sandstorm becomes a mix of pale yellow and blue. So you can still tell that it's a sandstorm.

    Okay so I did what you said and this is what it looks like now:
    Spoiler:


    It really doesn't look all that much better... it looks more like static fuzz than sand. Is there anyway to make it look better? Also as you said the sandstorm doesn't change along with the time of day so if someone AFK's for 12 hours and comes back there will be a blue sandstorm in midday (but if you exit and come back to the sandstorm map, it adjusts to the time of day):
    Spoiler:


    How would I go about giving it a darker tint, and making it so that the color changes along with the time of day (without entering/exiting the map).
     
    Okay so I did what you said and this is what it looks like now:
    Spoiler:


    It really doesn't look all that much better... it looks more like static fuzz than sand. Is there anyway to make it look better? Also as you said the sandstorm doesn't change along with the time of day so if someone AFK's for 12 hours and comes back there will be a blue sandstorm in midday (but if you exit and come back to the sandstorm map, it adjusts to the time of day):
    Spoiler:


    How would I go about giving it a darker tint, and making it so that the color changes along with the time of day (without entering/exiting the map).

    I fixed the tint, see the previous post. As for updating it, I'm not entirely sure.
     
    I fixed the tint, see the previous post. As for updating it, I'm not entirely sure.

    That is the script I used for the blueish tint that is has now in that pic. It needs to be a darker tint IMO, it looks better than it did but I think it could still be better. The blue/greenish is weird.

    And it isn't a big deal if it isn't updated since I imagine someone wouldn't stay too long on this map anyways. But the tint for the nighttime sandstorm definitely needs to be fixed and be darker than that greenish-blue tint.
     
    That is the script I used for the blueish tint that is has now in that pic. It needs to be a darker tint IMO, it looks better than it did but I think it could still be better. The blue/greenish is weird.

    And it isn't a big deal if it isn't updated since I imagine someone wouldn't stay too long on this map anyways. But the tint for the nighttime sandstorm definitely needs to be fixed and be darker than that greenish-blue tint.

    I know it's the same post, but I edited it. It's still blueish-green, but it's a darker tone at night, I changed the alpha values for the sandstorm colors. Is there a color you want it to be besides that?
     
    I know it's the same post, but I edited it. It's still blueish-green, but it's a darker tone at night, I changed the alpha values for the sandstorm colors. Is there a color you want it to be besides that?

    I think it should be more of a blueish-black than a blueish-green. Tell me if you can do that or not, and I would appreciate it.
     
    Last edited:
    I think it should be more of a blueish-black than a blueish-green. Tell me if you can do that or not, and I would appreciate it.

    I mixed up the blue/green on the rbg for some reason, green is much less prominent now(edited post). You're welcome to make it those colors if you want, but I think it looks fine like this.
     
    I mixed up the blue/green on the rbg for some reason, green is much less prominent now(edited post). You're welcome to make it those colors if you want, but I think it looks fine like this.

    I just tried it and now its almost impossible to see it. I might just try messing around with the tones myself.
     
    Overall the sandstorm script you provided isn't a fix to the solution, but it will do for now. It seems to have random tints at random times of the day, and sometimes the sandstorm doesn't show up at all anymore. So hopefully the sandstorms can be upgraded in V15 of Essentials (whenever that is coming).
     
    Back
    Top