~ Intro ~
Anyway, this script will allow you to have fogs in your RPG Maker VX game, just like XP!
Just set everything up in the config module, and you're ready to go!
~ Requirements ~
You need this folder inside your Graphics folder: http://www.mediafire.com/?quf57svc05o4332
~ Screenshots ~

~ Script ~
~ Credits ~
StormCross - Script
~ Commercial Games ~
This script is free for use in commercial games, but credit is required.
Anyway, this script will allow you to have fogs in your RPG Maker VX game, just like XP!
Just set everything up in the config module, and you're ready to go!
~ Requirements ~
You need this folder inside your Graphics folder: http://www.mediafire.com/?quf57svc05o4332
~ Screenshots ~

~ Script ~
Content Hidden
Show
- #===============================================================================
- # * SEE - Fogs * Version 1 *
- # * By StormCross
- # * http://www.planetdev.co.uk
- # * 26/09/2011
- # * If you like my scripts, please show your appreciation by checking out
- # my friendly, helpful Game Development Community, PlanetDev. Link above.
- # ---------------------------------------------------------------------------
- # * Aliased Methods
- # - initialize (Spriteset_Map)
- # - update (Spriteset_Map)
- # - dispose (Spriteset_Map)
- # ---------------------------------------------------------------------------
- # * This script allows you to have fogs, just like in RPG Maker XP!
- #===============================================================================
- $imported = {} if $imported == nil
- $imported["SEE - Fogs"] = true
- #===============================================================================
- # * Main StormCross Engine Evolution Configuration Module
- #===============================================================================
- module SEE
- #==========================================================================
- ===
- # * Fogs Configuration Module
- #==========================================================================
- ===
- module Fogs
- MAPS = []
- #==========================================================================
- =
- # * The number after MAPS[1] corresponds to the ID of the map in RMVX.
- # The values are as follows.
- # -----------------------------------------------------------------------
- # * Name, Opacity, Movement Direction, Horizontal Speed, Vertical Speed
- # -----------------------------------------------------------------------
- # * Name - The filename of the fog graphic in Graphics/Fogs
- # * Opacity - The opacity of the fog. 64 is reccomended.
- # * Movement direction of the fog. There are 9 presets.
- # 0 = Static
- # 1 = Left
- # 2 = Right
- # 3 = Up
- # 4 = Down
- # 5 = Upper Left
- # 6 = Upper Right
- # 7 = Lower Left
- # 8 = Lower Right
- # * Speed of the horizontal movement of the fog. 1 is default.
- # * Speed of the vertical movement of the fog. 1 is default.
- #==========================================================================
- =
- MAPS[1] = ["001-Fog01", 64, 8, 1, 1]
- end # Fogs
- end # SEE
- #===============================================================================
- # * Spriteset_Map edit for fog effects
- #===============================================================================
- class Spriteset_Map
- include SEE::Fogs
- #==========================================================================
- ===
- # * Alias the initialize method and create fogs
- #==========================================================================
- ===
- alias see_fogs_spritesetmap_init initialize
- def initialize
- see_fogs_spritesetmap_init
- if MAPS[$game_map.map_id] != nil
- create_fog
- end
- end # initialize
- #==========================================================================
- ===
- # * Create the fog graphic
- #==========================================================================
- ===
- def create_fog
- @fog_sprite = Plane.new(@viewport1)
- @fog_sprite.bitmap = Cache.fogs(MAPS[$game_map.map_id][0])
- @fog_sprite.opacity = MAPS[$game_map.map_id][1]
- @fog_name = MAPS[$game_map.map_id][0]
- end # create_fog
- #==========================================================================
- ===
- # * Update the fog movement and graphic
- #==========================================================================
- ===
- def update_fog
- if @fog_name != MAPS[$game_map.map_id][0]
- @fog_name = MAPS[$game_map.map_id][0]
- if @fog_sprite.bitmap != nil
- @fog_sprite.bitmap.dispose
- @fog_sprite.bitmap = nil
- end
- if @fog_name != ""
- @fog_sprite.bitmap = Cache.fogs(MAPS[$game_map.map_id][0])
- end
- Graphics.frame_reset
- end
- case MAPS[$game_map.map_id][2]
- when 0 # Static
- @fog_sprite.ox = $game_map.display_x / 8
- @fog_sprite.oy = $game_map.display_y / 8
- when 1 # Left
- @fog_sprite.ox += MAPS[$game_map.map_id][3]
- when 2 # Right
- @fog_sprite.ox -= MAPS[$game_map.map_id][3]
- when 3 # Up
- @fog_sprite.oy += MAPS[$game_map.map_id][4]
- when 4 # Down
- @fog_sprite.oy -= MAPS[$game_map.map_id][4]
- when 5 # Upper Left
- @fog_sprite.ox += MAPS[$game_map.map_id][3]
- @fog_sprite.oy += MAPS[$game_map.map_id][4]
- when 6 # Upper Right
- @fog_sprite.ox -= MAPS[$game_map.map_id][3]
- @fog_sprite.oy += MAPS[$game_map.map_id][4]
- when 7 # Lower Left
- @fog_sprite.ox += MAPS[$game_map.map_id][3]
- @fog_sprite.oy -= MAPS[$game_map.map_id][4]
- when 8 # Lower Right
- @fog_sprite.ox -= MAPS[$game_map.map_id][3]
- @fog_sprite.oy -= MAPS[$game_map.map_id][4]
- end
- end # update_fog
- #==========================================================================
- ===
- # * Alias the update method and update fogs
- #==========================================================================
- ===
- alias see_fogs_spritesetmap_update update
- def update
- if @fog_sprite != nil
- update_fog
- end
- see_fogs_spritesetmap_update
- end # update
- #==========================================================================
- ===
- # * Alias the dispose method and dispose of fogs
- #==========================================================================
- ===
- alias see_fogs_spritesetmap_dispose dispose
- def dispose
- dispose_fogs
- see_fogs_spritesetmap_dispose
- end # dispose
- #==========================================================================
- ===
- # * Dispose the fog graphic
- #==========================================================================
- ===
- def dispose_fogs
- @fog_sprite.dispose
- end # dispose_fogs
- end # Spriteset_Map
- #===============================================================================
- # * Cache edit to support fogs
- #===============================================================================
- module Cache
- #==========================================================================
- ===
- # * Load fog graphic
- #==========================================================================
- ===
- def self.fogs(filename)
- load_bitmap("Graphics/Fogs/", filename)
- end # self.fogs
- end # Cache
Expand to see the code.
~ Credits ~
StormCross - Script
~ Commercial Games ~
This script is free for use in commercial games, but credit is required.