Guest Access
Active Member
Active Member
Active Member
profile
How to set in script call :
Fog must exist in folder Graphics/Fogs
to reset all fog
LiTTleDRAgo
profile
Multiple Fog
Version: 2.0
Author: LiTTleDRAgo
Date: June 16, 2011
Description
Version: 2.0
Author: LiTTleDRAgo
Date: June 16, 2011
Description
Instructions
Paste Above main, below XAS if presentHow to set in script call :
- Code:
set_fog2('Name Fog',ox,oy)
- Code:
set_fog3('Name Fog',ox,oy)
- Code:
set_fog4('Name Fog',ox,oy)
Fog must exist in folder Graphics/Fogs
to reset all fog
- Code:
reset_fog
Script
- Code:
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
# This class brings together map screen sprites, tilemaps, etc.
# It's used within the Scene_Map class.
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def multifog_setup(a,b,c)
@fog2, @fog3, @fog4 = Plane.new(a), Plane.new(b), Plane.new(c)
@fog2.z = -400
@fog3.z = -300
@fog4.z = -200
v = $game_system
v.fog2_name = v.fog3_name = v.fog4_name = ''
v.fog2_zoom = v.fog3_zoom = v.fog4_zoom = 1.00
v.fog2_opacity = v.fog3_opacity = v.fog4_opacity = 255
v.fog2_blend_type = v.fog3_blend_type = v.fog4_blend_type = 0
v.fog2_ox = v.fog3_ox = v.fog4_ox = 0
v.fog2_oy = v.fog3_oy = v.fog4_oy = 0
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
alias dispose_multifog dispose
def dispose
dispose_multifog
[@fog2, @fog3, @fog4].each {|i| i.dispose}
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias update_multifog update
def update
multifog_setup(@viewport1,@viewport2,@viewport3) if
@fog2.nil? or @fog3.nil? or @fog4.nil?
#---------------------------------------------------------------------------
# FOG 2
#---------------------------------------------------------------------------
if @fog2_name != $game_system.fog2_name
@fog2_name = $game_system.fog2_name
if @fog2.bitmap != nil
@fog2.bitmap.dispose
@fog2.bitmap = nil
end
if @fog2_name != ''
@fog2.bitmap = Cache.fog(@fog2_name,0) rescue Cache.panorama(@fog2_name,0)
end
Graphics.frame_reset
end
@fog2.opacity = $game_system.fog2_opacity
@fog2.blend_type = $game_system.fog2_blend_type
@fog2_ox.nil? ? @fog2_ox = 0 : @fog2_ox += $game_system.fog2_ox
@fog2_oy.nil? ? @fog2_oy = 0 : @fog2_oy += $game_system.fog2_oy
@fog2.ox = $game_map.display_x / 3 + ($game_player.screen_x / 3 ) + @fog2_ox
@fog2.oy = $game_map.display_y / 3 + @fog2_oy
#---------------------------------------------------------------------------
# FOG 3
#---------------------------------------------------------------------------
if @fog3_name != $game_system.fog3_name
@fog3_name = $game_system.fog3_name
if @fog3.bitmap != nil
@fog3.bitmap.dispose
@fog3.bitmap = nil
end
if @fog3_name != ''
@fog3.bitmap = Cache.fog(@fog3_name,0) rescue Cache.panorama(@fog3_name,0)
end
Graphics.frame_reset
end
@fog3.opacity = $game_system.fog3_opacity
@fog3_ox.nil? ? @fog3_ox = 0 : @fog3_ox += $game_system.fog3_ox
@fog3_oy.nil? ? @fog3_oy = 0 : @fog3_oy += $game_system.fog3_oy
@fog3.ox = $game_map.display_x / 3 + ($game_player.screen_x / 2 ) + @fog3_ox
@fog3.oy = $game_map.display_y / 4 + @fog3_oy
#---------------------------------------------------------------------------
# FOG 4
#---------------------------------------------------------------------------
if @fog4_name != $game_system.fog4_name
@fog4_name = $game_system.fog4_name
if @fog4.bitmap != nil
@fog4.bitmap.dispose
@fog4.bitmap = nil
end
if @fog4_name != ''
@fog4.bitmap = Cache.fog(@fog4_name,0) rescue Cache.panorama(@fog4_name,0)
end
Graphics.frame_reset
end
@fog4.opacity = $game_system.fog4_opacity
@fog4_ox.nil? ? @fog4_ox = 0 : @fog4_ox += $game_system.fog4_ox
@fog4_oy.nil? ? @fog4_oy = 0 : @fog4_oy += $game_system.fog4_oy
@fog4.ox = $game_map.display_x / 3 + ($game_player.screen_x / 2 ) + @fog4_ox
@fog4.oy = $game_map.display_y / 4 + @fog4_oy
#---------------------------------------------------------------------------
update_multifog
end
end
class Interpreter
def set_fog2(n = '',ox = 0,oy = 0)
$game_system.fog2_name = n
$game_system.fog2_ox = ox
$game_system.fog2_oy = oy
end
def set_fog3(n = '',ox = 0,oy = 0)
$game_system.fog3_name = n
$game_system.fog3_ox = ox
$game_system.fog3_oy = oy
end
def set_fog4(n = '',ox = 0,oy = 0)
$game_system.fog4_name = n
$game_system.fog4_ox = ox
$game_system.fog4_oy = oy
end
def reset_fog
set_fog2('', 0, 0)
set_fog3('', 0, 0)
set_fog4('', 0, 0)
end
end
#===============================================================================
# ■ GAME_SYSTEM
#===============================================================================
class Game_System
attr_accessor :fog2_name, :fog2_zoom, :fog2_opacity, :fog2_blend_type,
:fog2_ox, :fog2_oy,
:fog3_name, :fog3_zoom, :fog3_opacity, :fog3_blend_type,
:fog3_ox, :fog3_oy,
:fog4_name, :fog4_zoom, :fog4_opacity, :fog4_blend_type,
:fog4_ox, :fog4_oy
end
Cache = RPG::Cache
$drago_multifog = true
Known Compatibility Issues
NoneRestrictions
NoneActive Member
Show Signature
Administrator
Administrator
Administrator
profile
G@MeF@Ce
profile
yo Drago - I didn't see this until now! ~ ??
I'm definitely using this in the Getroid project.
Thanks for sharing +
I'm definitely using this in the Getroid project.
Thanks for sharing +
Administrator
Show Signature
ACTIVATED
ACTIVATED
ACTIVATED
profile
jadzxa
profile
Hey! This is really nice!^^ awesome job. I can't seem to figure how to set the blend types though. I got it showing up and such at least heh.
ACTIVATED
Show Signature
ACTIVATED
EVENTALIST
EVENTALIST
EVENTALIST
profile
mr_wiggles
profile
Very nice, i see you did some things i didn't even know about in this script.
Same line accessor, save space in the class using this. Nice find.
- Code:
attr_accessor :fog2_name, :fog2_zoom, :fog2_opacity, :fog2_blend_type,
:fog2_ox, :fog2_oy
Same line accessor, save space in the class using this. Nice find.
EVENTALIST
Show Signature
EVENTALIST