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.

Script Fog effects on map! RMVX V1.0

Fog Effect 1.0 Falcao Script

Introduction:

Are you tire of those monotone maps? here i bring you the solution!!
This script allow you show Fog Effects on map,

Features

- Fog effects graphics on map
- Fog zoom
- Fog Scrool X or Y
- Others features

Instructions

Copy and paste the script to your project, and then inport the fog graphics to the folder Pictures


Call the script using the following command

$game_map.fog("Fog Name", Opacity, Zoom , Scroll_x, Scroll_y)

Example: using standar configuration
$game_map.fog("sombra2",50,2,1,1)

Fog Graphics must be in folder Pictures


Script:

Code:
 

#====================================================================#

#  #*****************#           Fog effect V1.0 Falcao script       # 

#  #*** By Falcao ***#           Allow fog effects graphics on map   # 

#  #*****************#                                               #

#         RMVX                   Instalation: Copy and paste the     #   

# makerpalace.onlinegoo.com      script to your porject              #  

#====================================================================#

 

#--------------------------------------------------------------------

# * How to use

#

# Call the script using the following command

#

# $game_map.fog("Fog Name", Opacity, Zoom , Scroll_x, Scroll_y)

#

# Example: using standar configuration

# $game_map.fog("sombra2",50,2,1,1)

# 

# Fog Graphics must be in folder Pictures

#

# Author notes:

# This script can be used in comercial or non-comercial games

# Credits to Falcao

# 

#---------------------------------------------------------------------

 

module Falcao

 

# Scrool fog graphics whith the screen change (true or false)  

DinamicScroll = true

 

end

 

class Game_Map

  attr_accessor :fog_name                

  attr_accessor :fog_opacity              

  attr_accessor :fog_zoom                 

  attr_accessor :fog_sx                   

  attr_accessor :fog_sy                   

  attr_reader   :fog_ox                  

  attr_reader   :fog_oy 

  alias falcaofogSini initialize 

  def initialize

    @fog_start = true

    falcaofogSini

  end

  alias falcao_setup setup

  def setup(map_id)

    falcao_setup(map_id)

    setup_fog

  end

  def setup_fog

    if @fog_start

      @fog_name = ""

      @fog_opacity = 0

      @fog_zoom = 0

      @fog_sx = 0

      @fog_sy = 0

      @fog_ox = 0

      @fog_oy = 0

      @fog_start = false

    end

  end

  alias falcaofog_update update

  def update

    falcaofog_update

    update_fog

  end

  def update_fog

    @fog_ox -= @fog_sx / 8.0

    @fog_oy -= @fog_sy / 8.0

  end

  def fog(name,opacity,zoom,scroll_x,scroll_y)

    @fog_name = name

    @fog_opacity = opacity

    @fog_zoom = zoom

    @fog_sx = scroll_x

    @fog_sy = scroll_y

  end

end

 

class Spriteset_Map

  alias falcaofogini initialize

  def initialize

    create_fog

    falcaofogini

  end

  def create_fog

    @fog = Plane.new(@viewport1)

    @fog.z = 3000

  end

  alias falcaofog_dispose dispose

  def dispose

    falcaofog_dispose

    dispose_fog

  end

  def dispose_fog

    @fog.dispose

  end

  alias falcaofogSupdate update

  def update

    falcaofogSupdate

    update_fog

  end

  def update_fog

    if @fog_name != $game_map.fog_name 

      @fog_name = $game_map.fog_name

      if @fog.bitmap != nil

        @fog.bitmap.dispose

        @fog.bitmap = nil

      end

      if @fog_name != ""

        @fog.bitmap = Cache.picture(@fog_name)

      end

      Graphics.frame_reset

    end

    @fog.zoom_x = $game_map.fog_zoom 

    @fog.zoom_y = $game_map.fog_zoom 

    @fog.opacity = $game_map.fog_opacity

    if Falcao::DinamicScroll == true

      @fog.ox = $game_map.display_x / 4 + $game_map.fog_ox

      @fog.oy = $game_map.display_y / 4 + $game_map.fog_oy

    else

      @fog.ox =  4 + $game_map.fog_ox

      @fog.oy =  4 + $game_map.fog_oy

    end

  end

end

 

 


Here a example Fog graphic ready to use

Import to Picture Folder

Sombra2.png


Demo

Demo include Fog Pack!!

http://www.mediafire.com/download.php?jazxmndknyl


Credits

By FaLcao

This script can be used in comercial or non-comercial games


Screens

Fog1.png


Fog2.png
 

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