Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Weather Effects on Panorama Layer

OS

Sponsor

Hello! I am trying to get weather effects to show up on the panorama layer, but with no luck.

I am using this little method:
Code:
  def panorama_effects
    if @panorama == true
      RPG::Weather.sprites.each {|s| s.z = -999}
    else
      RPG::Weather.sprites.each {|s| s.z = 1000}
    end
    return
  end

When @panorama is true, the effects should move to the panorama layer, but it doesn't work. I don't get any errors at all, it just refuses to change z values!

I already added an attribute reader for sprite to RPG::Weather, so it should be reading it. If I am making some silly mistake, then I'm sorry. Maybe it has something to do with the way I am trying to use each? idk...
 

Anonymous

Guest

just change weather effects in the event editor.

after changing map settings to panorama, double click underneath and change weather effects to whatever you want and make sure you put parallel process as trigger, does this help?

so it looks a bit like this

[list of event commands]
@> change map settings:panorama(which ever panorama you chose)
@> set weather effects:(whatever weather effect you chose)
and then where it says trigger chose parallel process

you can do it by modding a script but that means weather will appear on all your panorama's
unless you use the call script method
 

Anonymous

Guest

oh sorry with saying you wanted it to show up on the panorama layer, I thought you wanted it on top.

I get what you men now.

where have you added the part of code you wrote?
 

OS

Sponsor

It is a plug-in in my RandWeather Script, more specifically Game_Weather. It is supposed to change the z value of the sprites used to make the effect, but it just won't do anything.
 

Anonymous

Guest

hmm, can't get it to work?

will keep trying though to get it to work, I created multiple windows with rain lines in different places then imported it and made a move event repeating it for this effect, but it's time consuming and should be possible using scripts.

sorry again if I figure it out will let you know unless you or someone else figure it out first.
 

OS

Sponsor

Alright. Thanks.

The event idea I have seen before, but it is time consuming, and would require a different charset for every weather effect.

I hope we can get this figured out though. I want to do this with out editing Spriteset_Map, which is what Prexus said I could do. The way I would have to edit it, I couldn't just alias some methods and have it work right, unless I created or found a spriteset_map class that has its methods split into more methods (which I've seen in some scripts in the SDK, but I don't want to use the SDK). So, I hope to do thise with a small bit of code like above. It really should be as easy as changing a z value...
 

Anonymous

Guest

non sdk and without editing spriteset_map, not a problem Ive just finished a script this very second so I have all the time in the world to figure this out.

do you want it to be within your random weather script or a separate one?

just noticed you have two weather scripts which version are you currently using 3.0 or 7.0?

I got 3.0 before.
 

OS

Sponsor

I'm using 7.0. Before testing the script, use the Replace function of the editor to replace all 'include' with 'include?'

I kinda forgot to take care of that before release.

Also, I am doing this inside a Plug-In. I'll post the entire thing:

Code:
class Game_Weather
  alias os_initialize initialize
  alias os_call_plugins call_plugins
  def initialize
    os_initialize
    @panorama = false
  end
  
  def call_plugins
    panorama_effects
    os_call_plugins
  end
  
  def alter_weather
    if OS::W_InnerMaps.include?(@map_id)
      @panorama = true
    else
      @panorama = false
    end
    @count += 1
    if @count > rand(19) + 1
      @count = 0
      if @type == 0
        randomize
        return
      else
        if rand(9) + 1 > 5
          upgrade
          return
        elsif rand(9) + 1 > 5
          downgrade
          return
        else
          return
        end
      end
      return
    end
  end
  
  def panorama_effects
    if @panorama == true
      #RPG::Weather.sprites.each {|s| s.z = -999}
      for i in RPG::Weather.sprites.size - 1
        RPG::Weather.sprites[i].z = -999
      end
    else
      #RPG::Weather.sprites.each {|s| s.z = 1000}
      for i in RPG::Weather.sprites.size - 1
        RPG::Weather.sprites[i].z = 1000
      end
    end
    return
  end
end

module RPG
  class Weather
    attr_reader :type
    attr_reader :max
    attr_reader :ox
    attr_reader :oy
    attr_reader :sprites
  end
end

As you can see, this script aliases the Game_Weather script. That is how my Plug-Ins work. I really appreciate your help, and it seems that the first official Plug-In of the OS RandWeather Script will be an Arbiter/OS joint plug-in. Sweet.

Peace!
 

OS

Sponsor

Did you follow the instructions in my Weather 7.0 thread? That first post has the rest of Game_Weather, Game_Time, Game_World, and Module OS, all of which are required to make the script work, and the instructions to setup and make the script run.
 

OS

Sponsor

So what exactly is the problem? If you aren't seeing any weather changes, I can't explain that. It happens in my tests as well.

To change the weather directly, just use the regular weather change event command. I will update the script later to allow turning off the generator.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top