(ACE) Multifog Script from VX to Ace?

Evanjoss

Warper
Member
Joined
Jul 25, 2012
Messages
2
Reaction score
0
First Language
español
Primarily Uses
Can someone help me out and convert Woratana's Multifog Script from VX to Ace? I hope it isn't too complicated, please help-

Woratana's Multifog Script:

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

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

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

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

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

[B]def delete(*args)[/B]
[B]args.each do |id|[/B]
[B]	 $game_map.mulfog_name[id] = ''[/B]
[B]end[/B]
[B]end[/B]
[B]end[/B][B][/b][/B]
[B][b][/B][B]class Game_Interpreter[/B]
[B]alias wora_mulfog_interpret_com201 command_201[/B]
[B]#--------------------------------------------------------------------------[/B]
[B]# * Transfer Player[/B]
[B]#--------------------------------------------------------------------------[/B]
[B]def command_201[/B]
[B]if $game_map.fog_reset[/B]
[B]	 if @params[0] == 0; id_map = @params[1][/B]
[B]	 else; id_map = $game_variables[@params[1]][/B]
[B]	 end[/B]
[B]	 $game_map.clear_mulfog if id_map != @map_id[/B]
[B]end[/B]
[B]wora_mulfog_interpret_com201[/B]
[B]end[/B]
[B]end[/B][B][/b][/B]
[B][b][/B][B]class Game_Map[/B]
[B]attr_accessor :mulfog_name, :mulfog_hue, :mulfog_opacity, :mulfog_blend_type,[/B]
[B]:mulfog_zoom, :mulfog_sx, :mulfog_sy, :mulfog_ox, :mulfog_oy, :mulfog_tone,[/B]
[B]:mulfog_tone_target, :mulfog_tone_duration, :mulfog_opacity_duration,[/B]
[B]:mulfog_opacity_target, :fog_reset, :fog_path[/B]

[B]alias wora_mulfog_gammap_upd update[/B]
[B]def update[/B]
[B]wora_mulfog_gammap_upd[/B]
[B]@mulfog_name.each_index do |i|[/B]
[B]	 next if @mulfog_name[/B][B][i][/B][B].nil? or @mulfog_name[/B][B][i][/B][B] == ''[/B]
[B]	 # Manage fog scrolling[/B]
[B]	 @mulfog_ox[/B][B][i][/B][B] -= @mulfog_sx[/B][B][i][/B][B] / 8.0[/B]
[B]	 @mulfog_oy[/B][B][i][/B][B] -= @mulfog_sy[/B][B][i][/B][B] / 8.0[/B]
[B]	 # Manage change in fog color tone[/B]
[B]	 if @mulfog_tone_duration[/B][B][i][/B][B] >= 1[/B]
[B]	 d = @mulfog_tone_duration[/B][B][i][/B]
[B]	 target = @mulfog_tone_target[/B][B][i][/B]
[B]	 @mulfog_tone[/B][B][i][/B][B].red = (@mulfog_tone[/B][B][i][/B][B].red * (d - 1) + target.red) / d[/B]
[B]	 @mulfog_tone[/B][B][i][/B][B].green = (@mulfog_tone[/B][B][i][/B][B].green * (d - 1) + target.green) / d[/B]
[B]	 @mulfog_tone[/B][B][i][/B][B].blue = (@mulfog_tone[/B][B][i][/B][B].blue * (d - 1) + target.blue) / d[/B]
[B]	 @mulfog_tone[/B][B][i][/B][B].gray = (@mulfog_tone[/B][B][i][/B][B].gray * (d - 1) + target.gray) / d[/B]
[B]	 @mulfog_tone_duration[/B][B][i][/B][B] -= 1[/B]
[B]	 end[/B]
[B]	 # Manage change in fog opacity level[/B]
[B]	 if @mulfog_opacity_duration[/B][B][i][/B][B] >= 1[/B]
[B]	 d = @mulfog_opacity_duration[/B][B][i][/B]
[B]	 @mulfog_opacity[/B][B][i][/B][B] = (@mulfog_opacity[/B][B][i][/B][B] * (d - 1) + @mulfog_opacity_target[/B][B][i][/B][B]) / d[/B]
[B]	 @mulfog_opacity_duration[/B][B][i][/B][B] -= 1[/B]
[B]	 end[/B]
[B]end[/B]
[B]end[/B]
[B]#--------------------------------------------------------------------------[/B]
[B]# * Start Changing Fog Color Tone[/B]
[B]#--------------------------------------------------------------------------[/B]
[B]def fogtone(i, tone, duration)[/B]
[B]duration = duration * 2[/B]
[B]tone = Tone.new(tone[0], tone[1], tone[2], tone[3])[/B]
[B]@mulfog_tone_target[/B][B][i][/B][B] = tone.clone[/B]
[B]@mulfog_tone_duration[/B][B][i][/B][B] = duration[/B]
[B]if @mulfog_tone_duration[/B][B][i][/B][B] == 0[/B]
[B]	 @mulfog_tone[/B][B][i][/B][B] = @mulfog_tone_target[/B][B][i][/B][B].clone[/B]
[B]end[/B]
[B]end[/B]
[B]#--------------------------------------------------------------------------[/B]
[B]# * Start Changing Fog Opacity Level[/B]
[B]#--------------------------------------------------------------------------[/B]
[B]def fogopac(i, opacity, duration)[/B]
[B]duration = duration * 2[/B]
[B]@mulfog_opacity_target[/B][B][i][/B][B] = opacity * 1.0[/B]
[B]@mulfog_opacity_duration[/B][B][i][/B][B] = duration[/B]
[B]if @mulfog_opacity_duration[/B][B][i][/B][B] == 0[/B]
[B]	 @mulfog_opacity[/B][B][i][/B][B] = @mulfog_opacity_target[/B][B][i][/B]
[B]end[/B]
[B]end[/B]

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

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

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

[B]def dispose_parallax[/B]
[B]@mulfog.each_index do |i|[/B]
[B]	 next if @mulfog[/B][B][i][/B][B].nil?[/B]
[B]	 @mulfog[/B][B][i][/B][B].bitmap.dispose if !@mulfog[/B][B][i][/B][B].bitmap.nil?[/B]
[B]	 @mulfog[/B][B][i][/B][B].dispose[/B]
[B]end[/B]
[B]wora_mulfog_sprmap_dispal[/B]
[B]end[/B]
[B]end[/B]
[B]#==================================================================[/B]
[B]# [END] VX Multiple Fog by Woratana [woratana@hotmail.com][/B]
[B]#==================================================================[/B]
please help me iI am Ecuador , I speak spanish

Thanks
 
Last edited by a moderator:

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,452
First Language
Portuguese
Primarily Uses
There's at last 3 fog scripts for ace, and if i'm not mistaken one is exactly this one, why convert another? Just search a bit.
 

Evanjoss

Warper
Member
Joined
Jul 25, 2012
Messages
2
Reaction score
0
First Language
español
Primarily Uses
There's at last 3 fog scripts for ace, and if i'm not mistaken one is exactly this one, why convert another? Just search a bit.
but a friend I tried using the other and not get what this script could do with the maps would help me please I am studying the Custom Language recently only the basics but I am looking at a map sample of my work in vx


 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,854
Messages
1,016,998
Members
137,562
Latest member
tamedeathman
Top