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.

Battle Panorama - V1.6 (MogHunter)

Battle Panorama - XPVersion: 1.6
By: MogHunter(http://atelier-rgss.com/RGSS/Battle/XP_BAT01.html)


Introduction

Adds a panorama to the battle scene.

Features
  • Adds a moving picture on the battlefield.
  • Efeito Zoom - Zoom Effect
  • Movimentos aleatórios. - Random movements.

Script

Code:
#_______________________________________________________________________________

# MOG_Battle Panorama 1.5          

#_______________________________________________________________________________

# By Moghunter               

# [url=http://www.atelier-rgss.com]http://www.atelier-rgss.com[/url]

#_______________________________________________________________________________

# CARACTERÍSTICAS

# - Adiciona um panorama em movimento no campo de batalha.

# - Zoom.

# - Movimento aleatório.

#

# UTILIZAÇÃO

# - Defina um panorama qualquer no Tilesets.

# - Modifique o valor da variável que corresponderá a velocidade

#   do panorama de fundo.

# - É necessário que o Battleback tenha alguma transparência

#   para que a visualização do panorama seja possível. 

#_______________________________________________________________________________

#

# FEATURES

# - Adds a panorama on the battlefield.

# - Zoom.

# - Random Movement.

#

# USE

# - Set a background in any Tilesets. (from which battle is called.)

# - Modify the value of the variable corresponding to speed

#   Background of the picture.

# - Make the Battleback partly transparent so the panorama will show 

#_______________________________________________________________________________

module MOG

  # Definição da variável que definirá a velocidade na horizontal.  

  # Definition of the variable that define the horizontal velocity.

  BAT_PANO_VARIABLE_ID_X = 4

  # Definição da variável que definirá a velocidade na vertical.  

  # Definition of the variable that define the vertical velocity.

  BAT_PANO_VARIABLE_ID_Y = 5

  # ID da Switch que ativa o movimento aleatório do panorama.

  # ID of the Switch which enables the random motion of the panorama

  BAT_PANO_RAND_SWITCH_ID = 5  

  # Tempo para mudar de direção do panorama.

  # Time to change direction of panorama.

  BAT_PANO_RAND_TIME = 2  #(s)

  # ID da Switch que ativa o zoom no panorama.

  # ID of the Switch that activates the zoom in picture.

  BAT_PANO_ZOOM_SWITCH_ID = 6  

  # Tempo para mudar de zoom (IN para OUT).

  # Time to change zoom (IN to OUT).

  BAT_PANO_ZOOM_TIME = 2  #(s)

  # Poder (Velocidade) do zoom.

  # Power (speed) of the zoom. 

  BAT_PANO_ZOOM_SPEED = 0.007

end  

#_______________________________________________________________________________

$mogscript = {} if $mogscript == nil

$mogscript["Battle_Panorama"] = true

################

# Scene_Battle #

################

class Scene_Battle

  alias mog04_main main

  def main

    @mb = Plane.new

    @mb.bitmap = RPG::Cache.panorama($game_map.panorama_name,0) rescue nil

    @mb.z = -1

    @mbr = 0

    @bat_pano_x = 0

    @bat_pano_y = 0

    @bat_pano_speed_x = 1

    @bat_pano_speed_y = 1

    @bat_pano_zoom_x = 0

    @bat_pano_zoom_y = 0

    @bat_pano_zoom_time_x = 0

    @bat_pano_zoom_time_y = 0

    mog04_main

    @mb.dispose

  end

  alias mog04_update update

  def update  

    if $game_switches[MOG::BAT_PANO_RAND_SWITCH_ID] == true

      @mbr += 1

      if @mbr > 40 * MOG::BAT_PANO_RAND_TIME

        @mbr = 0

        case rand(2)

          when 0

          @bat_pano_x = 0

          when 1

          @bat_pano_x = 1

          end

          case rand(2)

          when 0

          @bat_pano_y = 0

          when 1

          @bat_pano_y = 1

        end

        case rand(2)

          when 0

          @bat_pano_speed_x = 1

          when 1

          @bat_pano_speed_x = 2

          end

          case rand(2)

          when 0

          @bat_pano_speed_y = 1

          when 1

          @bat_pano_speed_y = 2

        end

      end

      if @bat_pano_x == 0

        @mb.ox += $game_variables[MOG::BAT_PANO_VARIABLE_ID_X] * @bat_pano_speed_x 

      else

        @mb.ox -= $game_variables[MOG::BAT_PANO_VARIABLE_ID_X] * @bat_pano_speed_x    

      end

      if @bat_pano_y == 0

        @mb.oy += $game_variables[MOG::BAT_PANO_VARIABLE_ID_Y] * @bat_pano_speed_y 

      else

        @mb.oy -= $game_variables[MOG::BAT_PANO_VARIABLE_ID_Y] * @bat_pano_speed_y

      end

    else

      @mb.ox += $game_variables[MOG::BAT_PANO_VARIABLE_ID_X] 

      @mb.oy += $game_variables[MOG::BAT_PANO_VARIABLE_ID_Y]

    end

    if $game_switches[MOG::BAT_PANO_ZOOM_SWITCH_ID] == true 

      if  @bat_pano_zoom_x > 1

        @bat_pano_zoom_x = 0

      end

      if  @bat_pano_zoom_y > 1

        @bat_pano_zoom_y = 0

      end

      @bat_pano_zoom_time_x += 1

      @bat_pano_zoom_time_y += 1

      if @bat_pano_zoom_time_x > 40 * MOG::BAT_PANO_ZOOM_TIME

        @bat_pano_zoom_time_x = 0  

        @bat_pano_zoom_x += 1

      end

      if @bat_pano_zoom_time_y > 40 * MOG::BAT_PANO_ZOOM_TIME

        @bat_pano_zoom_time_y = 0  

        @bat_pano_zoom_y += 1

      end  

      if @bat_pano_zoom_x == 0

        @mb.zoom_x += MOG::BAT_PANO_ZOOM_SPEED 

      elsif @bat_pano_zoom_x == 1

        @mb.zoom_x -= MOG::BAT_PANO_ZOOM_SPEED

      end

      if @bat_pano_zoom_y == 0

        @mb.zoom_y += MOG::BAT_PANO_ZOOM_SPEED

      elsif  @bat_pano_zoom_y == 1

        @mb.zoom_y -= MOG::BAT_PANO_ZOOM_SPEED

      end

      if @mb.zoom_x > 2.0

        @mb.zoom_x = 2.0  

      elsif @mb.zoom_x < 1.0

        @mb.zoom_x = 1.0  

      end

      if @mb.zoom_y > 2.0

        @mb.zoom_y = 2.0  

      elsif @mb.zoom_y < 1.0

        @mb.zoom_y = 1.0  

      end

    end

    mog04_update

  end

end

Instructions

(In Script) Paste above main

FAQ

NA

Compatibility

NA

Terms and Conditions

1 - You can use the scripts of RGSS (Atelier-Rgss) in commercial projects or not, provided that the credits are mentioned.
2 - The scripts are free of RGSS to be posted on websites or forums, if they are referred to where they were removed.
3 - It is prohibited to direct link the Demos and games projects.
 

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