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

Outdoor light

  • 11
    Posts
    10
    Years
    • Seen Dec 29, 2015
    Can anyone suggest me the way to make a map like this, with the window's light effect:

    h*ttp://hydrargirium.deviantart.com/art/Postcards-from-Glowhill-192343308

    Please delete the "*" since I can't post link.

    Thanks for your support.
     
  • 15
    Posts
    10
    Years
    • Seen Jun 19, 2014
    Hello,

    There's a few was I think you can accomplish this:

    Firstly you could recolor the tiles on the bottom to be a shade lighter although I think that would kind of be a pain.

    Second for the light spill you could take your windows/doors and create a box of yellow or other light color and make it semi transparent. Then you can change the priority of that light box to go over anything else giving it the appearance that there's actually a source from the window/door. Doing it this way would also make it so the light would even spill over characters instead of this way where the character walks over it. That also depends on the way you want it to look I suppose.
    h*ttp://imgur.com/t1qQmNQ

    There is a third way I found out by watching atomic reactor's Youtube. You can make an event and name it "OutdoorLight" and it will create a light wherever the event is. There is an example of this on the Route 5 map in Pkmn Essentials' default maps. The only issue I have with this, I have not figured out how to change the shape, brightness or color of the light source. If anyone does know I would greatly appreciate any info.

    Thank you and good luck Haithuong313
     

    Minokun

    The Rival in Space
  • 107
    Posts
    10
    Years
    • Seen Sep 18, 2019
    Hello,

    There's a few was I think you can accomplish this:

    Firstly you could recolor the tiles on the bottom to be a shade lighter although I think that would kind of be a pain.

    Second for the light spill you could take your windows/doors and create a box of yellow or other light color and make it semi transparent. Then you can change the priority of that light box to go over anything else giving it the appearance that there's actually a source from the window/door. Doing it this way would also make it so the light would even spill over characters instead of this way where the character walks over it. That also depends on the way you want it to look I suppose.
    h*ttp://imgur.com/t1qQmNQ

    There is a third way I found out by watching atomic reactor's Youtube. You can make an event and name it "OutdoorLight" and it will create a light wherever the event is. There is an example of this on the Route 5 map in Pkmn Essentials' default maps. The only issue I have with this, I have not figured out how to change the shape, brightness or color of the light source. If anyone does know I would greatly appreciate any info.

    Thank you and good luck Haithuong313

    I just recently had this question myself!

    In the PokémonFeild Script, there's a section called Lights! From there you can look at this script here:
    Code:
    class LightEffect_Basic < LightEffect
      def initialize(event,map=nil,filename=nil)
        super
      end
    
      def update
        return if !@light || !@event
        super
        @light.opacity = 100
        @light.ox=32
        @light.oy=48
        if (Object.const_defined?(:ScreenPosHelper) rescue false)
          @light.x = ScreenPosHelper.pbScreenX(@event)
          @light.y = ScreenPosHelper.pbScreenY(@event)
          @light.zoom_x = ScreenPosHelper.pbScreenZoomX(@event)
        else
          @light.x = @event.screen_x
          @light.y = @event.screen_y
          @light.zoom_x = 1.0
        end
        @light.zoom_y = @light.zoom_x
        @light.tone=$game_screen.tone
      end  
    end

    And then you can change the shape by messing with this:

    Code:
    @light.zoom_x = ScreenPosHelper.pbScreenZoomX(@event)

    Or this:

    Code:
    @light.zoom_x = 1.0

    By changing those lines to:

    Code:
    @light.zoom_x = ScreenPosHelper.pbScreenZoomX(@event) * 2

    And This:

    Code:
    @light.zoom_x = 2.0

    That should double the light's size! Trust me it works!

    Also you can change the opacity if the light is too strong or weak. (Credit to Umbreon)
     
  • 15
    Posts
    10
    Years
    • Seen Jun 19, 2014
    Awesome! Thank you very much Minokun! Furthering the customization of the lighting can you A) Use something else to call the script besides "OutdoorLight"? Would you be able to define different lights that you can call upon when needed.

    And B) Can you take that script, modify it, and put it into the event editor under adding scripts to have the event take priority?

    Thanks again!
     

    Minokun

    The Rival in Space
  • 107
    Posts
    10
    Years
    • Seen Sep 18, 2019
    Awesome! Thank you very much Minokun! Furthering the customization of the lighting can you A) Use something else to call the script besides "OutdoorLight"? Would you be able to define different lights that you can call upon when needed.

    And B) Can you take that script, modify it, and put it into the event editor under adding scripts to have the event take priority?

    Thanks again!

    I'm actually not sure... I tried to do some research on these topics, but it didn't work out to well... I'll try and ask around.
     
  • 1,224
    Posts
    10
    Years
    This is a really basic way I just made up, it needs modifications to make it aesthetically pleasing, and might need to be expanded upon because windows are generally different shapes, which is the reason you can't just use OutdoorLight.

    In PokemonField, after class LightEffect_Lamp (around line 221) add this

    Code:
    class LightEffect_WindowLight < LightEffect
      def initialize(event,map=nil)
        super
         @light.setBitmap("Graphics/Pictures/WE")
      end
    
      def update
        return if !@light || !@event
        super
        @light.opacity = 100
        @light.ox=32
        @light.oy=48
        if (Object.const_defined?(:ScreenPosHelper) rescue false)
          @light.x = ScreenPosHelper.pbScreenX(@event)
          @light.y = ScreenPosHelper.pbScreenY(@event)
          @light.zoom_x = ScreenPosHelper.pbScreenZoomX(@event)
        else
          @light.x = @event.screen_x
          @light.y = @event.screen_y
          @light.zoom_x = 1.0
        end
        @light.zoom_y = @light.zoom_x
        
      end  
    end

    This is the light effect it is going to add, and this where you will make modifications for the aesthetics, and add similar classes/change this one so you can make different lights for different windows.
    You need to have a file named "WE" in Graphics/Pictures

    Now after
    Code:
    elsif map.events[i].name=="Light"
          spriteset.addUserSprite(LightEffect_Basic.new(map.events[i],map))
    which is also in PokemonField, around the 1400 range of lines, add
    Code:
    elsif map.events[i].name=="WindowLight"
         spriteset.addUserSprite(LightEffect_WindowLight.new(map.events[i],map))

    This lets you initiate the light effect by naming the event "WindowLight"

    Edit: I'm thinking of changing it so that you can include parameters in your event name and control the shape of the light that way. However, some windows are contained in multiple tiles, which can add up to a lot of events. Might cause a bunch of lag.
     
    Last edited:
  • 11
    Posts
    10
    Years
    • Seen Dec 29, 2015
    @everybody: Thank you for your support. I don't think using OutdoorLight is a good solution since windows have many shapes.

    This is an answer I got from Alucus@deviantart:
    yeah i have to admit making the light effect is easy, its making a day night system thats difficult. The light effect is just a fog overlay. make a fog thats the same size as the map, and make the lighting effects in photoshop in the areas of the fog where the windows would be. The script for the day night cycle though, i dont have a clue about im affraid
    I have not yet to try since I encounter some problems using photoshop...

    @mej71: Is your script able to be switched between night and day, since the light can't be on all day?
     
  • 1,224
    Posts
    10
    Years
    @everybody: Thank you for your support. I don't think using OutdoorLight is a good solution since windows have many shapes.

    This is an answer I got from Alucus@deviantart:

    I have not yet to try since I encounter some problems using photoshop...

    @mej71: Is your script able to be switched between night and day, since the light can't be on all day?

    Not as is, but this should do it

    Code:
    class LightEffect_WindowLight < LightEffect
      def initialize(event,map=nil)
        super
         @light.setBitmap("Graphics/Pictures/WE")
      end
    
      def update
        return if !@light || !@event
        super
        shade=PBDayNight.getShade
        if shade>=144   # If light enough, call it fully day.
          shade=255
        elsif shade<=64   # If dark enough, call it fully night.
          shade=0
        else
          shade=255-(255*(144-shade)/(144-64))
        end
        @light.opacity = 255-shade
        @light.ox=32
        @light.oy=48
        if (Object.const_defined?(:ScreenPosHelper) rescue false)
          @light.x = ScreenPosHelper.pbScreenX(@event)
          @light.y = ScreenPosHelper.pbScreenY(@event)
          @light.zoom_x = ScreenPosHelper.pbScreenZoomX(@event)
        else
          @light.x = @event.screen_x
          @light.y = @event.screen_y
          @light.zoom_x = 1.0
        end
        @light.zoom_y = @light.zoom_x
         @light.tone.set($game_screen.tone.red,
                          $game_screen.tone.green,
                          $game_screen.tone.blue,
                          $game_screen.tone.gray)
      end  
    end

    untested
     

    lucario170

    pokemon writer.
  • 27
    Posts
    13
    Years
    Well i have done something like that in my game using the same outdoor script see it if it interests you :
    1.This is the tile which i'm gonna use:
    Outdoor light
    2.I edited the image by showing only the parts that's gonna glow at night (like the window panes):
    Outdoor light
    3.Next I save/import the image it to the "graphics/picture" folder.
    4.pass the name of the saved image as parameter in the outdoorlight()

    like Outdoorlight(XXX) where "xxx" is name of the image that you saved.
    5.Save and run ,instead seeing the light-blob you would see the window panes,doors or whatever you edited illuminating in the night.

    Mine looks like this:
    Outdoor light
    note:positioning the window panes might be tricky,either adjust the image or try playing around the scripts so that illuminated parts exactly hide the dull-tinted ones in the background.
     
    Back
    Top