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.

Event 'call script' to change the panorama.

what i'm trying to do is make a simple day/night effect, but i need to change between several panoramas for the different times of day (i dont want to tint the screen). however, there is no basic way to do this via eventing. i planned to make an event process to change the panorama of each map (theres only like 8 of them) in intervals (with a timer), but i wouldn't know the rgss to perform this action!

so what i'm asking for is an rgss code i could use to change the panorama image of a map.

thanks in advance to anyone who can help me here :}
 
Why can't you do it with events? Page 2 > Change Map Settings > Panorama Graphics?

Anyway, this is found in Interpreter 5 (along with most events)
Code:
  #--------------------------------------------------------------------------
  # * Change Map Settings
  #--------------------------------------------------------------------------
  def command_204
    case @parameters[0]
    when 0  # panorama
      $game_map.panorama_name = @parameters[1]
      $game_map.panorama_hue = @parameters[2]
    when 1  # fog
      $game_map.fog_name = @parameters[1]
      $game_map.fog_hue = @parameters[2]
      $game_map.fog_opacity = @parameters[3]
      $game_map.fog_blend_type = @parameters[4]
      $game_map.fog_zoom = @parameters[5]
      $game_map.fog_sx = @parameters[6]
      $game_map.fog_sy = @parameters[7]
    when 2  # battleback
      $game_map.battleback_name = @parameters[1]
      $game_temp.battleback_name = @parameters[1]
    end
    # Continue
    return true
  end

So I'd guess (haven't tried) all you need is call script -> $game_map.panorama_name = typeyourgraphicnamehere

If you have sets of panorama (mountains but different tints, for instance), the best would be to name it like Mountains_X (x = 1 to 8) then create a method above main

Code:
class Interpreter
    def change_pano(number)
        $game_map.panorama_name = "Mountains_" + number.to_s
    end
end

And you call it via call script "change_pano(x)" so the filename loaded is the "ID Number" of the current time of the day (saves you from doing conditionals).
 
It's called parallax in VX right? It's pretty much the same thing, I think, as there's an "  attr_reader  :parallax_name" in Game_Map. So probably (if RGSS2 isn't that different from RGSS) you would call it the same way :
Code:
$game_map.parallax_name = something
 

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