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:

  1.  
  2. #====================================================================#
  3. #  #*****************#           Fog effect V1.0 Falcao script       #
  4. #  #*** By Falcao ***#           Allow fog effects graphics on map   #
  5. #  #*****************#                                               #
  6. #         RMVX                   Instalation: Copy and paste the     #  
  7. # makerpalace.onlinegoo.com      script to your porject              #  
  8. #====================================================================#
  9.  
  10. #--------------------------------------------------------------------
  11. # * How to use
  12. #
  13. # Call the script using the following command
  14. #
  15. # $game_map.fog("Fog Name", Opacity, Zoom , Scroll_x, Scroll_y)
  16. #
  17. # Example: using standar configuration
  18. # $game_map.fog("sombra2",50,2,1,1)
  19. #
  20. # Fog Graphics must be in folder Pictures
  21. #
  22. # Author notes:
  23. # This script can be used in comercial or non-comercial games
  24. # Credits to Falcao
  25. #
  26. #---------------------------------------------------------------------
  27.  
  28. module Falcao
  29.  
  30. # Scrool fog graphics whith the screen change (true or false)  
  31. DinamicScroll = true
  32.  
  33. end
  34.  
  35. class Game_Map
  36.   attr_accessor :fog_name                
  37.   attr_accessor :fog_opacity              
  38.   attr_accessor :fog_zoom                
  39.   attr_accessor :fog_sx                  
  40.   attr_accessor :fog_sy                  
  41.   attr_reader   :fog_ox                  
  42.   attr_reader   :fog_oy
  43.   alias falcaofogSini initialize
  44.   def initialize
  45.     @fog_start = true
  46.     falcaofogSini
  47.   end
  48.   alias falcao_setup setup
  49.   def setup(map_id)
  50.     falcao_setup(map_id)
  51.     setup_fog
  52.   end
  53.   def setup_fog
  54.     if @fog_start
  55.       @fog_name = ""
  56.       @fog_opacity = 0
  57.       @fog_zoom = 0
  58.       @fog_sx = 0
  59.       @fog_sy = 0
  60.       @fog_ox = 0
  61.       @fog_oy = 0
  62.       @fog_start = false
  63.     end
  64.   end
  65.   alias falcaofog_update update
  66.   def update
  67.     falcaofog_update
  68.     update_fog
  69.   end
  70.   def update_fog
  71.     @fog_ox -= @fog_sx / 8.0
  72.     @fog_oy -= @fog_sy / 8.0
  73.   end
  74.   def fog(name,opacity,zoom,scroll_x,scroll_y)
  75.     @fog_name = name
  76.     @fog_opacity = opacity
  77.     @fog_zoom = zoom
  78.     @fog_sx = scroll_x
  79.     @fog_sy = scroll_y
  80.   end
  81. end
  82.  
  83. class Spriteset_Map
  84.   alias falcaofogini initialize
  85.   def initialize
  86.     create_fog
  87.     falcaofogini
  88.   end
  89.   def create_fog
  90.     @fog = Plane.new(@viewport1)
  91.     @fog.z = 3000
  92.   end
  93.   alias falcaofog_dispose dispose
  94.   def dispose
  95.     falcaofog_dispose
  96.     dispose_fog
  97.   end
  98.   def dispose_fog
  99.     @fog.dispose
  100.   end
  101.   alias falcaofogSupdate update
  102.   def update
  103.     falcaofogSupdate
  104.     update_fog
  105.   end
  106.   def update_fog
  107.     if @fog_name != $game_map.fog_name
  108.       @fog_name = $game_map.fog_name
  109.       if @fog.bitmap != nil
  110.         @fog.bitmap.dispose
  111.         @fog.bitmap = nil
  112.       end
  113.       if @fog_name != ""
  114.         @fog.bitmap = Cache.picture(@fog_name)
  115.       end
  116.       Graphics.frame_reset
  117.     end
  118.     @fog.zoom_x = $game_map.fog_zoom
  119.     @fog.zoom_y = $game_map.fog_zoom
  120.     @fog.opacity = $game_map.fog_opacity
  121.     if Falcao::DinamicScroll == true
  122.       @fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
  123.       @fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
  124.     else
  125.       @fog.ox =  4 + $game_map.fog_ox
  126.       @fog.oy =  4 + $game_map.fog_oy
  127.     end
  128.   end
  129. end
  130.  
  131.  
Expand to see the code.



Here a example Fog graphic ready to use

Import to Picture Folder

Content Hidden Spoiler
Image



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

Content Hidden Spoiler
Image



Content Hidden Spoiler
Image

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=67381