Jump to content
Sign in to follow this  
Necromus

Woratana multiple Fog's for Ace

Recommended Posts

So after trying to understand the scrolling behaviour of Ace, i finally got it running.

 

For the script to actually do something u need to have the appropriate files inside your project's Graphic's folder.

If u don't already have a Picture folder in there, create one and put those files in there:

 

post-5771-0-67790300-1332105286_thumb.png

post-5771-0-97811800-1332105313_thumb.png

 

Further instructions are inside the script.

 

 

#===============================================================
# â— [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 = 'Fog'
  @hue = 0
  @tone = [100,-255,20,0]
  @opacity = 60
  @blend = 0
  @zoom = 200
  @sx = 10
  @sy = 0
when 2 # Preset ID 2
  @name = 'Cloud2'
  @hue = 0
  @tone = [0,0,0,0]
  @opacity = 60
  @blend = 0
  @zoom = 200
  @sx = 10
  @sy = 0
  when 3 # Preset ID 3
  @name = 'Cloud3'
  @hue = 0
  @tone = [0,0,0,-100]
  @opacity = 150
  @blend = 0
  @zoom = 140
  @sx = 2
  @sy = 1
#==================================================================
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]
#==================================================================

 

 

Edited by Necromus

Share this post


Link to post
Share on other sites

It says unable to find file: Fog01

 

Even though I've put the fog file into Graphics/Pictures, and set up everything correctly, it still shows that error. Here is the script that I set up:

 

 

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

# â— [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 = ['Fog01']

@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 = 'Fog'

@hue = 0

@tone = [100,-255,20,0]

@opacity = 60

@blend = 0

@zoom = 200

@sx = 10

@sy = 0

when 2 # Preset ID 2

@name = 'Cloud2'

@hue = 0

@tone = [0,0,0,0]

@opacity = 60

@blend = 0

@zoom = 200

@sx = 10

@sy = 0

when 3 # Preset ID 3

@name = 'Cloud3'

@hue = 0

@tone = [0,0,0,-100]

@opacity = 150

@blend = 0

@zoom = 140

@sx = 2

@sy = 1

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

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.nil? or @mulfog_name == ''

# Manage fog scrolling

@mulfog_ox -= @mulfog_sx / 8.0

@mulfog_oy -= @mulfog_sy / 8.0

# Manage change in fog color tone

if @mulfog_tone_duration >= 1

d = @mulfog_tone_duration

target = @mulfog_tone_target

@mulfog_tone.red = (@mulfog_tone.red * (d - 1) + target.red) / d

@mulfog_tone.green = (@mulfog_tone.green * (d - 1) + target.green) / d

@mulfog_tone.blue = (@mulfog_tone.blue * (d - 1) + target.blue) / d

@mulfog_tone.gray = (@mulfog_tone.gray * (d - 1) + target.gray) / d

@mulfog_tone_duration -= 1

end

# Manage change in fog opacity level

if @mulfog_opacity_duration >= 1

d = @mulfog_opacity_duration

@mulfog_opacity = (@mulfog_opacity * (d - 1) + @mulfog_opacity_target) / d

@mulfog_opacity_duration -= 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 = tone.clone

@mulfog_tone_duration = duration

if @mulfog_tone_duration == 0

@mulfog_tone = @mulfog_tone_target.clone

end

end

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

# * Start Changing Fog Opacity Level

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

def fogopac(i, opacity, duration)

duration = duration * 2

@mulfog_opacity_target = opacity * 1.0

@mulfog_opacity_duration = duration

if @mulfog_opacity_duration == 0

@mulfog_opacity = @mulfog_opacity_target

end

end

 

def clear_mulfog

@mulfog_name.each_index {|i| @mulfog_name = '' }

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.nil?

# If fog is different than current fog

if @mulfog_name != $game_map.mulfog_name or @mulfog_hue != $game_map.mulfog_hue

@mulfog_name = $game_map.mulfog_name

@mulfog_hue = $game_map.mulfog_hue

if @mulfog.nil?

@mulfog = Plane.new(@viewport3)

@mulfog.z = 3000

end

if @mulfog.bitmap != nil

@mulfog.bitmap.dispose

@mulfog.bitmap = nil

end

if @mulfog_name != ''

@mulfog.bitmap = Cache.load_bitmap('', @mulfog_name, @mulfog_hue)

end

Graphics.frame_reset

end

next if @mulfog.bitmap.nil?

# Update fog plane

@mulfog.zoom_x = ($game_map.mulfog_zoom / 100.0) if @mulfog.zoom_x != ($game_map.mulfog_zoom / 100.0)

@mulfog.zoom_y = ($game_map.mulfog_zoom / 100.0) if @mulfog.zoom_y != ($game_map.mulfog_zoom / 100.0)

@mulfog.opacity = $game_map.mulfog_opacity if @mulfog.opacity != $game_map.mulfog_opacity

@mulfog.blend_type = $game_map.mulfog_blend_type if @mulfog.blend_type != $game_map.mulfog_blend_type

@mulfog.ox = $game_map.mulfog_ox + $game_map.display_x * 32 if @mulfog.ox != $game_map.mulfog_ox + $game_map.display_x * 32

@mulfog.oy = $game_map.mulfog_oy + $game_map.display_y * 32 if @mulfog.oy != $game_map.mulfog_oy + $game_map.display_y * 32

@mulfog.tone = $game_map.mulfog_tone if @mulfog.tone != $game_map.mulfog_tone

end

end

 

def dispose_parallax

@mulfog.each_index do |i|

next if @mulfog.nil?

@mulfog.bitmap.dispose if !@mulfog.bitmap.nil?

@mulfog.dispose

end

wora_mulfog_sprmap_dispal

end

end

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

# [END] VX Multiple Fog by Woratana [woratana@hotmail.com]

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

 

Share this post


Link to post
Share on other sites

Woah, my bad ^^'

I edited things to fit my liking and that goes for the names of those fogs too.

That one here has the settings like they were in the original, so the names are back to "001-Fog01" and "002-Clouds01", just like Woratana's pictures were called.

 

 

 

#===============================================================
# â— [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]
#==================================================================

 

 

Share this post


Link to post
Share on other sites

Actually, I get an error: Script 'Game_Interpreter' line 1409: NameError occurred.

uninitialized constant Game_Interpreter::Fog01

 

Whatever I try to do it still says that it can't find the fog picture. What's up with that??

Share this post


Link to post
Share on other sites

I don't really know, it works for me.

The pictures u want to use need to be named 001-Fog01 and 002-Clouds01, then there should be no issue with actually finding the pictures.

When exactly do u get the error?

I know what that error means, just there isn't really anything the code would do to make that happen.

 

Edit:

 

On second thought, u did place the scripts in the correct order right?

Like the fog script below materials in the script editor?

Edited by Necromus

Share this post


Link to post
Share on other sites

Ah now i see what u did wrong.

U changed line 100, the name of your file needs to go into 138 tho.

But yea, if Victor's script works better for you, just use that :)

Share this post


Link to post
Share on other sites

its says for me,

Unable to find file:

Graphics/Pictures/

 

Sounds like you don't have the files u need, I edited the OP, u can find them and the where to put them there now.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×