How to make weather effects overall pictures ?

Hello.

Before, to simulate night effect, I used the command Tint Screen.

That way the rain is over the tint effect.

But recently I changed my mind and I'm using a picture witch covering my map.

Now the rain effect is below the picture.

Simple question: Is it possible to show the weather effect over pictures ?

If yes ( with a script ) make it possible to alternate with a switch please.

Thanks in advance.
Knock knock ...
You need to change the z level. Despite being a 2d engine, there are still three geometrical planes. X, y, and z. Z is the order in which the engine draws things, so 3 would be drawn over 1, for example.


I'm not positive if you can do it through the default show picture command, but there are multiple "fog" scripts that can be used to literally just draw a picture and determine its z value. Shaz has one that I use somewhere.
Hello ZServ.


Ok I understand the Z stuff. And only X/Y exist.


I did my own "fog" system with variable. exausting but it works.


My only problem/wish is the weather level effect.


I already changed the strength and dimness in the script editor


and hoped to see a "Z" setting ... in vain.


I can continue without to resolve my "wish", but I realy wanted to see the difference.


I was just hoping it could be a simple script.


Let see if someone take the challenge.
Draw your picture with this. Make an autorun event on each map that calls a common event. In that common event, a conditional branch, set to a switch of your choosing.


If switch is on, draw it at a Z level above the weather. If it's off, draw it at a Z level below the weather.


I have no idea what the Z level is for weather effects, so you'll need to do some toying around to find out. I don't think it'd be above 100. But, this setup will give you what you want. It'll draw the picture above or below the weather based on whether or not a switch is on. The only change you'll really need to make is that you'll need to re-call the common event if you want to change it on the fly.
Well, I tried the script.


I've been able to see the weather effect over the picture.


I thought if I set X,Y to 0 the picture will stick the map, but it stick the screen


and it move with the hero.


show_fog(1, "NUIT OPEN-EST", 0, 255, 0, 100, 0, 0, 101)


Info: the  Z101 it's to show the picture over the events.


Noob Question: What is HUE ?


Back to the story...


I making night effect that is a picture witch stick to the x0,y0 of the map


cause I have holes that simulate fire's light effect... ok this is a pic.


Capture%20drsquoeacutecran%2083.png



Now I wondering if it's not a paralaxe script I need more than fog to stick the picture.


PS: There's no more preview post ?  Cause I see only the Submit Reply button.
It's actually pretty easy to change.


Solution to your 1st question


There's 3 viewports for sprites (sort of like layers) and those layers have their own ''Z''.


Pictures and weather effects are both on the 2nd viewport, since weather effects have no Z assigned to them, they are at 0 while pictures Z are = to picture number.


You can simply lower the Z of pictures


If you go into the scripts, Sprite_Pictures


Line 64 should be: self.z = @picture.number


Replace it with: self.z = @picture.number - 101


or if you want to to add some bonus functionality


set it to self.z = @picture.number - 50


That would make it so every picture with a picture number above 50 will display above your weather effects while everything under 50 will display below.


Solution to your 2nd Question


Pictures are always displayed via screen.x and screen.y


A simple ghetto solution is to put an invisible event in the top left corner of your map


Set it to Parallel Process


Create 2 variables called Picture X and Picture Y, one to track screen.x and another for screen.y and a Label called Reset


The content of the event should be something like this


Show Picture: (whatever settings you choose)


Label: Reset


Control Variables: Picture X = This event's screen X


Control Variables: Picture Y = This event's screen Y


Control Variables: Picture X -= 16


Control Variables: Picture Y -= 32


Move Picture: (use the 2 variables created to determine X and Y, put the settings you want and set Time at 1 frame with wait for completion on, otherwise it will freeze up the game)


Jump to Label: Reset


The label is important, parallel processes are looping by default but it does so every 2 frames rather than the 1 frame you need.


There you go, hope it helps!
Merci Saboera


It's exactely what I'am doing for a while with the :


Show Picture: (whatever settings you choose)


Label: Reset


Control Variables: Picture X = This event's screen X


Control Variables: Picture Y = This event's screen Y


Control Variables: Picture X -= 16


Control Variables: Picture Y -= 32


Move Picture: (use the 2 variables created to determine X and Y, put the settings you want and set Time at 1 frame with wait for completion on, otherwise it will freeze up the game)


Jump to Label: Reset


But I'm doing it with Loop ( btw, is that give the exact effect label and loop ?)


I realize a simple parallel processes is only like 30frs/s but Label and loop are like 60frs/s


Merci for the Sprite_Pictures hint, I'll check this out.
Glad I could help.


I'm not quite sure if there is a difference between labels and loops function wise for this in particular. Maybe one is more efficient than the other performance wise, I don't know but both loop and labels should function essentially the same.


Personally I prefer labels over loops since it has more flexibility and it looks cleaner when you read the content of your events.


Labels and loops allows you to bypass the 30 fps reset from parallel processes, yes. Technically speaking, loops and labels don't really have a frame rate. You probably know this already but it's always worth stating just in case. If there is no wait command of some sort, it would loop endlessly within the same frame, essentially freezing the game, it's having that 1 frame wait command or wait for completion ticked on at 1 frame time that makes it execute at 60 fps.


Edit: Just a question for you since I got an idea.


Are you using parallaxes for anything? Because in theory you could tweak them to behave exactly like the picture without the hassle and performance loss from running a parallel process event.
Sorry. I dident see your edited post.


I dont use parallaxes script, so I use only one from the editor capability.


The only "visual problem" with the picture to the event position, is the one late pixel


when the hearo moving whitch cause like if a shadow leaves the wall for one pixel.


I dont know if the parallaxes script that peoples use, stick perfectely without latency.
Alright, I can confirm that parallaxes are working perfectly with this, I just tested it and might end up using this method for stuff in my game. You don't really need a parallaxes script for this, I'm not sure why everyone relies so much on scripts in general when it's an easy tweak to make yourself.


Basically here's how to do it.


First, your parallax should always be the same size in pixels as your map, otherwise it won't move around properly. For the newcomers out there who doesn't know what that means and are looking at this, it means Parallax Width =  Map Width multiplied by 32 and Parallax Height = Map Height multiplied by 32. So for example, if you have a 25 tiles by 20 tiles map, you need to create a 800x640 pixels parallax.


Then


Go to scripts find Game_Map


Lines 156 to 179 should be the section handling parallaxes movement and looping.


You just need to change the numbers 16 to 32, more specifically on lines 165 and 177. It's gonna make it so the parallax's move by 32 pixels instead of 16 when it doesn't loop and you move around the map).


Example in spoiler below: In this particular case I set it so that it only applies to parallaxes that don't loop.

Spoiler
  #--------------------------------------------------------------------------
  # * Calculate X Coordinate of Parallax Display Origin
  #--------------------------------------------------------------------------
  def parallax_ox(bitmap)
    if @parallax_loop_x
      @parallax_x * 16
    else
      w1 = [bitmap.width - Graphics.width, 0].max
      w2 = [width * 32 - Graphics.width, 1].max
      @parallax_x * 32 * w1 / w2
    end
  end
  #--------------------------------------------------------------------------
  # * Calculate Y Coordinate of Parallax Display Origin
  #--------------------------------------------------------------------------
  def parallax_oy(bitmap)
    if @parallax_loop_y
      @parallax_y * 16
    else
      h1 = [bitmap.height - Graphics.height, 0].max
      h2 = [height * 32 - Graphics.height, 1].max
      @parallax_y * 32 * h1 / h2
    end
  end



Then you need to go to Spriteset_Map, line 51 to 57 and change line 56, the parallax.z from -100 to be above the map and characters, so something like 200 or 300 should be ok, you could play with this number eventually, it's just a test number I came up with.


Example in spoiler below, with a static number

Spoiler
  #--------------------------------------------------------------------------
  # * Create Parallax
  #--------------------------------------------------------------------------
  def create_parallax
    @parallax = Plane.new(@viewport1)
    @parallax.z = 300
  end



Alternatively you could set it to be handled with a variable by using $game_variables[] with the variable ID in between the []


If you do this, you can use a parallel process event to set that variable to the number you want and then use Erase Event to kill it before the parallax creates itself.


Parallel processes will load before a map appears. You only need to do this when you want the number to change, you don't need it on every map.


Something like this


Control Variables: (Variable name) = 300


Erase Event


Second example when it's handled by a game variable, in this case, the very first variable

Spoiler
  #--------------------------------------------------------------------------
  # * Create Parallax
  #--------------------------------------------------------------------------
  def create_parallax
    @parallax = Plane.new(@viewport1)
    @parallax.z = $game_variables[1]
  end



That should be it, it's a bit of tinkering but works great. All that is remaining is assigning the parallax to the map and you're done.
Thanks for your help Saboera


But it looks like I can only use one parallax at once. I am already using a default parallax looping that


simulate like smoggy abyss at certain position of maps.


And is impossible to tint or opacity effect on a parallax.


+, my night is a timed opacity effect .

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-weather-effects-overall-pictures.55107/