Woratana multiple Fog's for Ace

Necromus

Veteran
Veteran
Joined
Mar 14, 2012
Messages
490
Reaction score
62
First Language
German
Primarily Uses
Update 09.05.2013

Since a lot of people asked about this, I fixed some issues with parallaxes in the script.

If other scripts are still conflict with this one, make sure to have all other scripts about this one in your script list.

Introduction
Since i saw a lot of people asking for a port from VX to Ace, i thought imma just try and go for it.
After a while trying to understand the scrolling behaviour of Ace i finnally got it running


Features
Let's u set up fog/cloud effects on your maps, just like in RM2K3, VX users will be familiar with the script.

Screenshots


How to Use
Details on how to set it up are inside the script, there is also alot of information around, especially on VX sites, since it's a pretty known script.

Script

Code:
#===============================================================# ● [VX] ◦ Multiple Fogs ◦ □# * Use unlimited layers of fog *#--------------------------------------------------------------# ◦ by Woratana [woratana@hotmail.com]# ◦ Thaiware RPG Maker Community# ◦ Released on: 13/05/2008# ◦ Version: 1.0# ◦ ported to VX Ace by Necromus 17/03/2012#--------------------------------------------------------------#==================================================================# ** HOW TO USE **# * use event command 'Script...' for the any script line below~#-----------------------------------------------------------------##---------------------------------------------------------------# ** SETUP FOG PROPERTIES & SHOW FOG **# * You have to setup fog properties, before show fog~#-------------------------------------------------------------# * There are 3 ways to setup fog properties:# >> Setup Fog [Custom]:# $fog.name = 'image_name' # Image file name, must be in fog image path (setup path below).# $fog.hue = (integer) # Fog's hue. 0 - 360, 0 for no hue.# $fog.tone = [red, green, blue, gray] # Fog's tone color.# $fog.opacity = (integer) # Fog's opacity. 0 - 255, you will not see fog in 0.# $fog.blend = (0, 1, or 2) # Fog's blend type. 0 for Normal, 1 for Add, 2 for Subtract.# $fog.zoom = (integer) # Fog's size (in %). 100 for normal size.# $fog.sx = (+ or - integer) # Fog's horizontal move speed.# $fog.sy = (+ or - integer) # Fog's vertical move speed.## >> Setup Fog [From Preset]:# (You can setup fog presets, in part FOG PRESET SETUP below)# $fog.load_preset(preset_id)## >> Setup Fog [From Fog that showing]:# $fog.load_fog(fog_id)##--------------------------------------------------------------# ** SHOW FOG **#-------------------------------------------------------------# After setup the fog, show fog by call script:# $fog.show(fog_id)## In case you want to show new fog on same ox, oy, tone as old fog. Call Script:# $fog.show(old_fog_id, false)## * fog_id: the ID number you want to put this fog in.# (It can be any positive number or zero)## After you show fog, the fog properties you've set will replace with default setting.# (You can setup default setting, in part FOG DEFAULT SETTING below)##--------------------------------------------------------------# ** DELETE FOG **#-------------------------------------------------------------# You can delete 1 or more fog(s) at a time by call script:# $fog.delete(fog_id, fog_id, fog_id, ...)##---------------------------------------------------------------# ** OLD FOG CONTROL EVENT COMMANDS **#-------------------------------------------------------------# Change Fog Tone:# $game_map.fogtone(fog_id, [red, green, blue, gray], duration)# e.g. $game_map.fogtone(1, [100,200,-100,0], 10)# Change Fog Opacity:# $game_map.fogopac(fog_id, new_opacity, duration)# e.g. $game_map.fogopac(2, 200, 10)##---------------------------------------------------------------# ** ADDITIONAL SETTINGS **#-------------------------------------------------------------# Change Fog Image's Path:# $game_map.fog_path = 'image_path'# e.g. $game_map.fog_path = 'Graphics/Pictures/'# Turn ON/OFF [Automatically clear all fogs when transfer player]:# $game_map.fog_reset = (true / false)##===============================================================#==================================================================# START ** MULTIPLE FOG SETUP **#==================================================================class Game_Mapalias wora_mulfog_gammap_ini initializedef initialize    wora_mulfog_gammap_ini    #==================================================================    # ** MULTIPLE FOG SETUP ** SETTINGS    #--------------------------------------------------------------    @fog_path = 'Graphics/Pictures/'    # Fog image's path    @fog_reset = true # (true or false)    # Automatically clear all multiple fogs when transfer player    #==================================================================    @mulfog_name = []    @mulfog_hue = []    @mulfog_opacity = []    @mulfog_blend_type = []    @mulfog_zoom = []    @mulfog_sx = []    @mulfog_sy = []    @mulfog_ox = []    @mulfog_oy = []    @mulfog_tone = []    @mulfog_tone_target = []    @mulfog_tone_duration = []    @mulfog_opacity_duration = []    @mulfog_opacity_target = []endendclass Wora_Multiple_Fogdef set_default    #==================================================================    # ** MULTIPLE FOG SETUP ** FOG DEFAULT SETTING    #--------------------------------------------------------------    @name = ''    @hue = 0    @opacity = 64    @blend = 0    @zoom = 200    @sx = 0    @sy = 0    @tone = [0,0,0,0]    #==================================================================enddef load_preset(preset_id)    case preset_id#==================================================================# ** MULTIPLE FOG SETUP ** FOG PRESET SETUP#--------------------------------------------------------------    when 1 # Preset ID 1     @name = 'Cloud3'     @hue = 0     @tone = [0,0,20,0]     @opacity = 100     @blend = 0     @zoom = 150     @sx = 3     @sy = 3    when 2 # Preset ID 2     @name = '002-Clouds01'     @hue = 0     @tone = [0,0,0,0]     @opacity = 200     @blend = 1     @zoom = 200     @sx = -2     @sy = -2    #==================================================================endend#==================================================================# END ** MULTIPLE FOG SETUP **# * Don't change anything below unless you know what you're doing.#==================================================================attr_accessor :name, :hue, :opacity, :blend, :zoom, :sx, :sy, :tonedef initialize    set_defaultenddef load_fog(id)    @name = $game_map.mulfog_name[id].sub($game_map.fog_path, '')    @hue = $game_map.mulfog_hue[id]    @opacity = $game_map.mulfog_opacity[id]    @blend = $game_map.mulfog_blend_type[id]    @zoom = $game_map.mulfog_zoom[id]    @sx = $game_map.mulfog_sx[id]    @sy = $game_map.mulfog_sy[id]    tn = $game_map.mulfog_tone[id]    @tone = [tn.red, tn.blue, tn.green, tn.gray]enddef show(id, reset_all = true)    $game_map.mulfog_name[id] = $game_map.fog_path + @name    $game_map.mulfog_hue[id] = @hue    $game_map.mulfog_opacity[id] = @opacity    $game_map.mulfog_blend_type[id] = @blend    $game_map.mulfog_zoom[id] = @zoom    $game_map.mulfog_sx[id] = @sx    $game_map.mulfog_sy[id] = @sy    $game_map.mulfog_tone[id] = Tone.new(@tone[0], @tone[1], @tone[2], @tone[3])    if $game_map.mulfog_ox[id].nil? or reset_all     $game_map.mulfog_ox[id] = 0     $game_map.mulfog_oy[id] = 0     $game_map.mulfog_tone_target[id] = Tone.new(0, 0, 0, 0)     $game_map.mulfog_tone_duration[id] = 0     $game_map.mulfog_opacity_duration[id] = 0     $game_map.mulfog_opacity_target[id] = 0    end    set_defaultenddef delete(*args)    args.each do |id|     $game_map.mulfog_name[id] = ''    endendendclass Game_Interpreteralias wora_mulfog_interpret_com201 command_201#--------------------------------------------------------------------------# * Transfer Player#--------------------------------------------------------------------------def command_201    if $game_map.fog_reset     if @params[0] == 0; id_map = @params[1]     else; id_map = $game_variables[@params[1]]     end     $game_map.clear_mulfog if id_map != @map_id    end    wora_mulfog_interpret_com201endendclass Game_Mapattr_accessor :mulfog_name, :mulfog_hue, :mulfog_opacity, :mulfog_blend_type,:mulfog_zoom, :mulfog_sx, :mulfog_sy, :mulfog_ox, :mulfog_oy, :mulfog_tone,:mulfog_tone_target, :mulfog_tone_duration, :mulfog_opacity_duration,:mulfog_opacity_target, :fog_reset, :fog_pathalias wora_mulfog_gammap_upd updatedef update(main)    wora_mulfog_gammap_upd(main)    @mulfog_name.each_index do |i|     next if @mulfog_name[i].nil? or @mulfog_name[i] == ''     # Manage fog scrolling     @mulfog_ox[i] -= @mulfog_sx[i] / 8.0     @mulfog_oy[i] -= @mulfog_sy[i] / 8.0     # Manage change in fog color tone     if @mulfog_tone_duration[i] >= 1        d = @mulfog_tone_duration[i]        target = @mulfog_tone_target[i]        @mulfog_tone[i].red = (@mulfog_tone[i].red * (d - 1) + target.red) / d        @mulfog_tone[i].green = (@mulfog_tone[i].green * (d - 1) + target.green) / d        @mulfog_tone[i].blue = (@mulfog_tone[i].blue * (d - 1) + target.blue) / d        @mulfog_tone[i].gray = (@mulfog_tone[i].gray * (d - 1) + target.gray) / d        @mulfog_tone_duration[i] -= 1     end     # Manage change in fog opacity level     if @mulfog_opacity_duration[i] >= 1        d = @mulfog_opacity_duration[i]        @mulfog_opacity[i] = (@mulfog_opacity[i] * (d - 1) + @mulfog_opacity_target[i]) / d        @mulfog_opacity_duration[i] -= 1     end    endend#--------------------------------------------------------------------------# * Start Changing Fog Color Tone#--------------------------------------------------------------------------def fogtone(i, tone, duration)    duration = duration * 2    tone = Tone.new(tone[0], tone[1], tone[2], tone[3])    @mulfog_tone_target[i] = tone.clone    @mulfog_tone_duration[i] = duration    if @mulfog_tone_duration[i] == 0     @mulfog_tone[i] = @mulfog_tone_target[i].clone    endend#--------------------------------------------------------------------------# * Start Changing Fog Opacity Level#--------------------------------------------------------------------------def fogopac(i, opacity, duration)    duration = duration * 2    @mulfog_opacity_target[i] = opacity * 1.0    @mulfog_opacity_duration[i] = duration    if @mulfog_opacity_duration[i] == 0     @mulfog_opacity[i] = @mulfog_opacity_target[i]    endenddef clear_mulfog    @mulfog_name.each_index {|i| @mulfog_name[i] = '' }endend$worale = {} if !$worale$worale['MutipleFog'] = true$fog = Wora_Multiple_Fog.newclass Spriteset_Mapalias wora_mulfog_sprmap_crepal create_parallaxalias wora_mulfog_sprmap_updpal update_parallaxalias wora_mulfog_sprmap_dispal dispose_parallaxdef create_parallax    @mulfog = []    @mulfog_name = []    @mulfog_hue = []    wora_mulfog_sprmap_crepalenddef update_parallax     wora_mulfog_sprmap_updpal    $game_map.mulfog_name.each_index do |i|     next if $game_map.mulfog_name[i].nil?     # If fog is different than current fog     if @mulfog_name[i] != $game_map.mulfog_name[i] or @mulfog_hue[i] != $game_map.mulfog_hue[i]        @mulfog_name[i] = $game_map.mulfog_name[i]        @mulfog_hue[i] = $game_map.mulfog_hue[i]        if @mulfog[i].nil?         @mulfog[i] = Plane.new(@viewport3)         @mulfog[i].z = 3000        end        if @mulfog[i].bitmap != nil         @mulfog[i].bitmap.dispose         @mulfog[i].bitmap = nil        end        if @mulfog_name[i] != ''         @mulfog[i].bitmap = Cache.load_bitmap('', @mulfog_name[i], @mulfog_hue[i])        end        Graphics.frame_reset     end     next if @mulfog[i].bitmap.nil?     # Update fog plane     @mulfog[i].zoom_x = ($game_map.mulfog_zoom[i] / 100.0) if @mulfog[i].zoom_x != ($game_map.mulfog_zoom[i] / 100.0)     @mulfog[i].zoom_y = ($game_map.mulfog_zoom[i] / 100.0) if @mulfog[i].zoom_y != ($game_map.mulfog_zoom[i] / 100.0)     @mulfog[i].opacity = $game_map.mulfog_opacity[i] if @mulfog[i].opacity != $game_map.mulfog_opacity[i]     @mulfog[i].blend_type = $game_map.mulfog_blend_type[i] if @mulfog[i].blend_type != $game_map.mulfog_blend_type[i]     @mulfog[i].ox = $game_map.mulfog_ox[i] + $game_map.display_x * 32 if @mulfog[i].ox != $game_map.mulfog_ox[i] + $game_map.display_x * 32     @mulfog[i].oy = $game_map.mulfog_oy[i] + $game_map.display_y * 32 if @mulfog[i].oy != $game_map.mulfog_oy[i] + $game_map.display_y * 32     @mulfog[i].tone = $game_map.mulfog_tone[i] if @mulfog[i].tone != $game_map.mulfog_tone[i]    endenddef dispose_parallax    @mulfog.each_index do |i|     next if @mulfog[i].nil?     @mulfog[i].bitmap.dispose if !@mulfog[i].bitmap.nil?     @mulfog[i].dispose    end    wora_mulfog_sprmap_dispalendend#==================================================================# [END] VX Multiple Fog by Woratana [woratana@hotmail.com]#==================================================================
Credit and Thanks
Woratana for this awesome piece of code

Author's Notes
Have fun

Woratana's blog:
http://boxsuke.exteen.com/
 
Last edited by a moderator:

Zachy

Veteran
Veteran
Joined
Mar 16, 2012
Messages
43
Reaction score
5
First Language
English
Primarily Uses
Thanks very much, i'm making a short ace project and this will be great to put in it :D
 

Necromus

Veteran
Veteran
Joined
Mar 14, 2012
Messages
490
Reaction score
62
First Language
German
Primarily Uses
I saw problems on other forums, cause i changed the names of the fog files used in the scripts, here is the old setup, just like in Woratana's original script.

The names of the files are back to "001-Fog01" and "002-Clouds01".

Code:
#===============================================================
# ● [VX] ◦ Multiple Fogs ◦ □
# * Use unlimited layers of fog *
#--------------------------------------------------------------
# ◦ by Woratana [woratana@hotmail.com]
# ◦ Thaiware RPG Maker Community
# ◦ Released on: 13/05/2008
# ◦ Version: 1.0
# ◦ ported to VX Ace by Necromus 17/03/2012
#--------------------------------------------------------------
#==================================================================
# ** HOW TO USE **
# * use event command 'Script...' for the any script line below~
#-----------------------------------------------------------------
#
#---------------------------------------------------------------
# ** SETUP FOG PROPERTIES & SHOW FOG **
# * You have to setup fog properties, before show fog~
#-------------------------------------------------------------
# * There are 3 ways to setup fog properties:
# >> Setup Fog [Custom]:
# $fog.name = 'image_name' # Image file name, must be in fog image path (setup path below).
# $fog.hue = (integer) # Fog's hue. 0 - 360, 0 for no hue.
# $fog.tone = [red, green, blue, gray] # Fog's tone color.
# $fog.opacity = (integer) # Fog's opacity. 0 - 255, you will not see fog in 0.
# $fog.blend = (0, 1, or 2) # Fog's blend type. 0 for Normal, 1 for Add, 2 for Subtract.
# $fog.zoom = (integer) # Fog's size (in %). 100 for normal size.
# $fog.sx = (+ or - integer) # Fog's horizontal move speed.
# $fog.sy = (+ or - integer) # Fog's vertical move speed.
#
# >> Setup Fog [From Preset]:
# (You can setup fog presets, in part FOG PRESET SETUP below)
# $fog.load_preset(preset_id)
#
# >> Setup Fog [From Fog that showing]:
# $fog.load_fog(fog_id)
#
#--------------------------------------------------------------
# ** SHOW FOG **
#-------------------------------------------------------------
# After setup the fog, show fog by call script:
# $fog.show(fog_id)
#
# In case you want to show new fog on same ox, oy, tone as old fog. Call Script:
# $fog.show(old_fog_id, false)
#
# * fog_id: the ID number you want to put this fog in.
# (It can be any positive number or zero)
#
# After you show fog, the fog properties you've set will replace with default setting.
# (You can setup default setting, in part FOG DEFAULT SETTING below)
#
#--------------------------------------------------------------
# ** DELETE FOG **
#-------------------------------------------------------------
# You can delete 1 or more fog(s) at a time by call script:
# $fog.delete(fog_id, fog_id, fog_id, ...)
#
#---------------------------------------------------------------
# ** OLD FOG CONTROL EVENT COMMANDS **
#-------------------------------------------------------------
# Change Fog Tone:
# $game_map.fogtone(fog_id, [red, green, blue, gray], duration)
# e.g. $game_map.fogtone(1, [100,200,-100,0], 10)
# Change Fog Opacity:
# $game_map.fogopac(fog_id, new_opacity, duration)
# e.g. $game_map.fogopac(2, 200, 10)
#
#---------------------------------------------------------------
# ** ADDITIONAL SETTINGS **
#-------------------------------------------------------------
# Change Fog Image's Path:
# $game_map.fog_path = 'image_path'
# e.g. $game_map.fog_path = 'Graphics/Pictures/'
# Turn ON/OFF [Automatically clear all fogs when transfer player]:
# $game_map.fog_reset = (true / false)
#
#===============================================================
#==================================================================
# START ** MULTIPLE FOG SETUP **
#==================================================================
class Game_Map
  alias wora_mulfog_gammap_ini initialize
  def initialize
	wora_mulfog_gammap_ini

	#==================================================================
	# ** MULTIPLE FOG SETUP ** SETTINGS
	#--------------------------------------------------------------
	@fog_path = 'Graphics/Pictures/'
	# Fog image's path
	@fog_reset = true # (true or false)
	# Automatically clear all multiple fogs when transfer player
	#==================================================================

	@mulfog_name = []
	@mulfog_hue = []
	@mulfog_opacity = []
	@mulfog_blend_type = []
	@mulfog_zoom = []
	@mulfog_sx = []
	@mulfog_sy = []
	@mulfog_ox = []
	@mulfog_oy = []
	@mulfog_tone = []
	@mulfog_tone_target = []
	@mulfog_tone_duration = []
	@mulfog_opacity_duration = []
	@mulfog_opacity_target = []
  end
end
class Wora_Multiple_Fog
  def set_default
	#==================================================================
	# ** MULTIPLE FOG SETUP ** FOG DEFAULT SETTING
	#--------------------------------------------------------------
	@name = ''
	@hue = 0
	@opacity = 64
	@blend = 0
	@zoom = 200
	@sx = 0
	@sy = 0
	@tone = [0,0,0,0]
	#==================================================================
  end

  def load_preset(preset_id)
	case preset_id
#==================================================================
# ** MULTIPLE FOG SETUP ** FOG PRESET SETUP
#--------------------------------------------------------------
	when 1 # Preset ID 1
	  @name = '001-Fog01'
	  @hue = 0
	  @tone = [100,-255,20,0]
	  @opacity = 60
	  @blend = 0
	  @zoom = 200
	  @sx = 10
	  @sy = 0
	when 2 # Preset ID 2
	  @name = '002-Clouds01'
	  @hue = 0
	  @tone = [0,0,0,0]
	  @opacity = 200
	  @blend = 1
	  @zoom = 200
	  @sx = -2
	  @sy = -2
	#==================================================================
  end
end
#==================================================================
# END ** MULTIPLE FOG SETUP **
# * Don't change anything below unless you know what you're doing.
#==================================================================
  attr_accessor :name, :hue, :opacity, :blend, :zoom, :sx, :sy, :tone
  def initialize
	set_default
  end

  def load_fog(id)
	@name = $game_map.mulfog_name[id].sub($game_map.fog_path, '')
	@hue = $game_map.mulfog_hue[id]
	@opacity = $game_map.mulfog_opacity[id]
	@blend = $game_map.mulfog_blend_type[id]
	@zoom = $game_map.mulfog_zoom[id]
	@sx = $game_map.mulfog_sx[id]
	@sy = $game_map.mulfog_sy[id]
	tn = $game_map.mulfog_tone[id]
	@tone = [tn.red, tn.blue, tn.green, tn.gray]
  end
  def show(id, reset_all = true)
	$game_map.mulfog_name[id] = $game_map.fog_path + @name
	$game_map.mulfog_hue[id] = @hue
	$game_map.mulfog_opacity[id] = @opacity
	$game_map.mulfog_blend_type[id] = @blend
	$game_map.mulfog_zoom[id] = @zoom
	$game_map.mulfog_sx[id] = @sx
	$game_map.mulfog_sy[id] = @sy
	$game_map.mulfog_tone[id] = Tone.new(@tone[0], @tone[1], @tone[2], @tone[3])
	if $game_map.mulfog_ox[id].nil? or reset_all
	  $game_map.mulfog_ox[id] = 0
	  $game_map.mulfog_oy[id] = 0
	  $game_map.mulfog_tone_target[id] = Tone.new(0, 0, 0, 0)
	  $game_map.mulfog_tone_duration[id] = 0
	  $game_map.mulfog_opacity_duration[id] = 0
	  $game_map.mulfog_opacity_target[id] = 0
	end
	set_default
  end

  def delete(*args)
	args.each do |id|
	  $game_map.mulfog_name[id] = ''
	end
  end
end
class Game_Interpreter
  alias wora_mulfog_interpret_com201 command_201
  #--------------------------------------------------------------------------
  # * Transfer Player
  #--------------------------------------------------------------------------
  def command_201
	if $game_map.fog_reset
	  if @params[0] == 0; id_map = @params[1]
	  else; id_map = $game_variables[@params[1]]
	  end
	  $game_map.clear_mulfog if id_map != @map_id
	end
	wora_mulfog_interpret_com201
  end
end
class Game_Map
  attr_accessor :mulfog_name, :mulfog_hue, :mulfog_opacity, :mulfog_blend_type,
  :mulfog_zoom, :mulfog_sx, :mulfog_sy, :mulfog_ox, :mulfog_oy, :mulfog_tone,
  :mulfog_tone_target, :mulfog_tone_duration, :mulfog_opacity_duration,
  :mulfog_opacity_target, :fog_reset, :fog_path
  alias wora_mulfog_gammap_upd update
  def update(main)  
	wora_mulfog_gammap_upd(main)
	@mulfog_name.each_index do |i|
	  next if @mulfog_name[i].nil? or @mulfog_name[i] == ''
	  # Manage fog scrolling
	  @mulfog_ox[i] -= @mulfog_sx[i] / 8.0
	  @mulfog_oy[i] -= @mulfog_sy[i] / 8.0
	  # Manage change in fog color tone
	  if @mulfog_tone_duration[i] >= 1
		d = @mulfog_tone_duration[i]
		target = @mulfog_tone_target[i]
		@mulfog_tone[i].red = (@mulfog_tone[i].red * (d - 1) + target.red) / d
		@mulfog_tone[i].green = (@mulfog_tone[i].green * (d - 1) + target.green) / d
		@mulfog_tone[i].blue = (@mulfog_tone[i].blue * (d - 1) + target.blue) / d
		@mulfog_tone[i].gray = (@mulfog_tone[i].gray * (d - 1) + target.gray) / d
		@mulfog_tone_duration[i] -= 1
	  end
	  # Manage change in fog opacity level
	  if @mulfog_opacity_duration[i] >= 1
		d = @mulfog_opacity_duration[i]
		@mulfog_opacity[i] = (@mulfog_opacity[i] * (d - 1) + @mulfog_opacity_target[i]) / d
		@mulfog_opacity_duration[i] -= 1
	  end
	end
  end
  #--------------------------------------------------------------------------
  # * Start Changing Fog Color Tone
  #--------------------------------------------------------------------------
  def fogtone(i, tone, duration)
	duration = duration * 2
	tone = Tone.new(tone[0], tone[1], tone[2], tone[3])
	@mulfog_tone_target[i] = tone.clone
	@mulfog_tone_duration[i] = duration
	if @mulfog_tone_duration[i] == 0
	  @mulfog_tone[i] = @mulfog_tone_target[i].clone
	end
  end
  #--------------------------------------------------------------------------
  # * Start Changing Fog Opacity Level
  #--------------------------------------------------------------------------
  def fogopac(i, opacity, duration)
	duration = duration * 2
	@mulfog_opacity_target[i] = opacity * 1.0
	@mulfog_opacity_duration[i] = duration
	if @mulfog_opacity_duration[i] == 0
	  @mulfog_opacity[i] = @mulfog_opacity_target[i]
	end
  end

  def clear_mulfog
	@mulfog_name.each_index {|i| @mulfog_name[i] = '' }
  end
end
$worale = {} if !$worale
$worale['MutipleFog'] = true
$fog = Wora_Multiple_Fog.new
class Spriteset_Map
  alias wora_mulfog_sprmap_crepal create_parallax
  alias wora_mulfog_sprmap_updpal update_parallax
  alias wora_mulfog_sprmap_dispal dispose_parallax

  def create_parallax
	@mulfog = []
	@mulfog_name = []
	@mulfog_hue = []
	wora_mulfog_sprmap_crepal
  end

  def update_parallax
#~	 wora_mulfog_sprmap_updpal
	$game_map.mulfog_name.each_index do |i|
	  next if $game_map.mulfog_name[i].nil?
	  # If fog is different than current fog
	  if @mulfog_name[i] != $game_map.mulfog_name[i] or @mulfog_hue[i] != $game_map.mulfog_hue[i]
		@mulfog_name[i] = $game_map.mulfog_name[i]
		@mulfog_hue[i] = $game_map.mulfog_hue[i]
		if @mulfog[i].nil?
		  @mulfog[i] = Plane.new(@viewport3)
		  @mulfog[i].z = 3000
		end
		if @mulfog[i].bitmap != nil
		  @mulfog[i].bitmap.dispose
		  @mulfog[i].bitmap = nil
		end
		if @mulfog_name[i] != ''
		  @mulfog[i].bitmap = Cache.load_bitmap('', @mulfog_name[i], @mulfog_hue[i])
		end
		Graphics.frame_reset
	  end
	  next if @mulfog[i].bitmap.nil?
	  # Update fog plane
	  @mulfog[i].zoom_x = ($game_map.mulfog_zoom[i] / 100.0) if @mulfog[i].zoom_x != ($game_map.mulfog_zoom[i] / 100.0)
	  @mulfog[i].zoom_y = ($game_map.mulfog_zoom[i] / 100.0) if @mulfog[i].zoom_y != ($game_map.mulfog_zoom[i] / 100.0)
	  @mulfog[i].opacity = $game_map.mulfog_opacity[i] if @mulfog[i].opacity != $game_map.mulfog_opacity[i]
	  @mulfog[i].blend_type = $game_map.mulfog_blend_type[i] if @mulfog[i].blend_type != $game_map.mulfog_blend_type[i]
	  @mulfog[i].ox = $game_map.mulfog_ox[i] + $game_map.display_x  * 32 if @mulfog[i].ox != $game_map.mulfog_ox[i] + $game_map.display_x  * 32  
	  @mulfog[i].oy = $game_map.mulfog_oy[i] + $game_map.display_y  * 32 if @mulfog[i].oy != $game_map.mulfog_oy[i] + $game_map.display_y  * 32
	  @mulfog[i].tone = $game_map.mulfog_tone[i] if @mulfog[i].tone != $game_map.mulfog_tone[i]
	end
  end

  def dispose_parallax
	@mulfog.each_index do |i|
	  next if @mulfog[i].nil?
	  @mulfog[i].bitmap.dispose if !@mulfog[i].bitmap.nil?
	  @mulfog[i].dispose
	end
	wora_mulfog_sprmap_dispal
  end
end
#==================================================================
# [END] VX Multiple Fog by Woratana [woratana@hotmail.com]
#==================================================================
 
Last edited by a moderator:

Kav

Villager
Member
Joined
Mar 15, 2012
Messages
17
Reaction score
4
Primarily Uses
Did you get Woratana's permission to post this? I'm an old friend of his and don't want people distributing his stuff without his permission.
 

Necromus

Veteran
Veteran
Joined
Mar 14, 2012
Messages
490
Reaction score
62
First Language
German
Primarily Uses
Did you get Woratana's permission to post this? I'm an old friend of his and don't want people distributing his stuff without his permission.
I have a "staff ok" to post it here, i tried to email Wora, but it seems his email is inactive.

If u can contact him, then just ask him, if he doesn't want to, then i'll take it down, but i don't think that's gonna be a problem.
 

Mr. Bubble

Makes stuff.
Member
Joined
Mar 1, 2012
Messages
853
Reaction score
163
You might to include wora's website if people need another way to contact him: http://boxsuke.exteen.com/

The only other thing I want to add is changing the head in the script to indicate that it's for VX Ace, not VX.
 

Necromus

Veteran
Veteran
Joined
Mar 14, 2012
Messages
490
Reaction score
62
First Language
German
Primarily Uses
You might to include wora's website if people need another way to contact him: http://boxsuke.exteen.com/

The only other thing I want to add is changing the head in the script to indicate that it's for VX Ace, not VX.
Sure thing, just the last time i checked that site, pretty much after i noticed his email doesn't work, all i found was stuff i can't understand and no trace of any kind of way to contact anyone there lol
 

Icenick

Veteran
Veteran
Joined
Mar 28, 2012
Messages
410
Reaction score
61
First Language
English
Primarily Uses
How do you use this????
 

CRBeam

Villager
Member
Joined
Mar 14, 2012
Messages
27
Reaction score
5
First Language
English
Primarily Uses
After I added this script Parallaxes stoped showing up in-game. Could you look into fixing this?

If it's great if you can, but it's not a big deal if you can't.
 
Last edited by a moderator:

Private81

Villager
Member
Joined
Feb 4, 2013
Messages
5
Reaction score
0
Primarily Uses
After I added this script Parallaxes stoped showing up in-game. Could you look into fixing this?

If it's great if you can, but it's not a big deal if you can't.
Hello, is this issue already solved? I also can't use Parallaxes together with the multiple fog's script in vx ace.
 

Troncatt

Warper
Member
Joined
Jul 31, 2013
Messages
1
Reaction score
0
First Language
English
Primarily Uses
How do you use this I really need this for my RPG.
 

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
Hello, is this issue already solved? I also can't use Parallaxes together with the multiple fog's script in vx ace.
No it's not solved I have the same problem. Not being able to use parallax layers... Is not good :p . But I fear that this script is no longer updated? Woratana seems inactive and this bug is known for about 1.5 years now :( .

EDIT:

He updated it :) . It now no longer bugs the parallax. Thanks.
 
Last edited by a moderator:

Necromus

Veteran
Veteran
Joined
Mar 14, 2012
Messages
490
Reaction score
62
First Language
German
Primarily Uses
Updated the OP, issues should be gone now.
 

Chaneque

Prince of Strange Things
Veteran
Joined
Mar 17, 2012
Messages
687
Reaction score
45
First Language
English
Primarily Uses
N/A
The fog won't move for me, even though I've set it up to move. I'm using the first preset.
 

icmz

Warper
Member
Joined
Oct 10, 2013
Messages
2
Reaction score
0
First Language
English
Primarily Uses
I'm new to script but I tried to follow the instructions and its not working for me. I have the images placed and name correctly still does not show up.
 

Fallun

Villager
Member
Joined
May 24, 2014
Messages
26
Reaction score
1
First Language
Danish
Primarily Uses
When i transfer to another map i get this error:

Script 'Woratana - Multiple Fogs' line 310: RGSSError occured.

Dispose plane.

Please can anyone help me, my scripting knowledge is very low
 

Necromus

Veteran
Veteran
Joined
Mar 14, 2012
Messages
490
Reaction score
62
First Language
German
Primarily Uses
It's been like 2 years since I last touched that script, but if I recall right, that was one of the things that I had to change, to get working with ace.

The update method above does have arguments, because the original one in the default ace script also has (main).

If it wouldn't, it would never run correctly at all.

Mabye I just don't remember it correctly, but I never had any issues, other than the parallax thing, which I should have fixed.

There were never any errors when changing maps, or anything like that, it works fine for me.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,812
Reaction score
14,021
First Language
English
Primarily Uses
RMMV
Oh, thanks. I completely misread that. Because it doesn't look just like the Ace one (with the default value) I didn't think it had an argument at all. Maybe reading scripts while being sick is not such a good thing to do ...


Sorry about that. I don't even know if this IS the script he's using - he just said Woratana's Fog Script but he didn't have a link, and this was the first one that came up when I searched
 

Fallun

Villager
Member
Joined
May 24, 2014
Messages
26
Reaction score
1
First Language
Danish
Primarily Uses
Sorry Shaz i had a big break/lost motivation to RPGmaker and i just got back again. So i forgot all about this post, but yes i was using that script though. But that was long time ago so not sure if i still got that error since i made a new project.

And also i was wondering if this script  can be used in commecial games or do we need license for it?
 
Last edited by a moderator:

Latest Threads

Latest Posts

Latest Profile Posts

Stream will be live shortly! I will be beginning a play-through of Resident Evil 4! Feel free to drop by!

1st iteration on castle interior in Tiled.
I've started up Pillars of Eternity. It's interesting how the game does a "select choice" cutscene using still image art for dramatic flair. I wonder if that might work for my RPGMaker project.
The self-righteous indignation of family when you expect them to pay back money you've leant to them never ceases to amaze me.
Gamedev for relaxing? yes or no?

Forum statistics

Threads
107,737
Messages
1,031,754
Members
139,874
Latest member
anonymous_game_dev
Top