I could use some help with this script now.
#==============================================================================
# +++ MOG - Wallpaper EX (V1.1) +++
#==============================================================================
# By Moghunter
# http://www.atelier-rgss.com
#==============================================================================
# - Add a wallpaper and add some animated effects.
#==============================================================================
# To change the wallpaper in the middle of the game just use the code below.
#
# $game_system.wallpaper = "FILE_NAME"
#
#==============================================================================
# And to change the scroll speed use the code below.
#
# $game_system.wallpaper_scroll = [ SPEED_X, SPEED_Y]
#
#==============================================================================
# You will need the following files in the GRAPHICS/SYSTEM.
#
# Menu_Particles.png
# wallpaper
#
#==============================================================================
# ? Histórico (Version History)
#==============================================================================
# v 1.1 - Melhoria no sistema de dispose de imagens.
#==============================================================================
module MOG_WALLPAPER_EX
#Enable Animated Particles.
PARTICLES = false
#Number of particles.
NUMBER_OF_PARTICLES = 10
#Slide the background image.
BACKGROUND_SCROLL_SPEED = [0,0]
#Set the opacity of the windows
WINDOW_OPACITY = 32
end
#==============================================================================
# ? Game_System
#==============================================================================
class Game_System
attr_accessor :wallpaper
attr_accessor :wallpaper_scroll
#--------------------------------------------------------------------------
# ? Initialize
#--------------------------------------------------------------------------
alias mog_wallpaper_initialize initialize
def initialize
mog_wallpaper_initialize
@wallpaper = "nebula"
@wallpaper_scroll = MOG_WALLPAPER_EX::BACKGROUND_SCROLL_SPEED
end
end
#==============================================================================
# ? Menu Particles
#==============================================================================
class Menu_Particles < Sprite
#--------------------------------------------------------------------------
# ? Initialize
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
self.bitmap = Cache.system("Menu_Particles")
reset_setting(true)
end
#--------------------------------------------------------------------------
# ? Reset Setting
#--------------------------------------------------------------------------
def reset_setting(start)
zoom = (50 + rand(100)) / 100.1
self.zoom_x = zoom
self.zoom_y = zoom
self.x = rand(544)
if start
self.y = rand(416 + self.bitmap.height)
else
self.y = 416 + rand(32 + self.bitmap.height)
end
self.opacity = 0
self.blend_type = 1
@speed_x = 0
@speed_y = [[rand(3), 3].min, 1].max
@speed_a = 0#rand(3)
end
#--------------------------------------------------------------------------
# ? Dispose
#--------------------------------------------------------------------------
def dispose
super
self.bitmap.dispose
end
#--------------------------------------------------------------------------
# ? Update
#--------------------------------------------------------------------------
def update
super
self.x += @speed_x
self.y -= @speed_y
self.angle += @speed_a
self.opacity += 5
reset_setting(false) if self.y < 0
end
end
#==============================================================================
# ? LAYOUT_EX
#==============================================================================
module WALLPAPER_EX
include MOG_WALLPAPER_EX
#--------------------------------------------------------------------------
# ? Start
#--------------------------------------------------------------------------
def start
super
create_particles
end
#--------------------------------------------------------------------------
# ? Set Window OPACITY
#--------------------------------------------------------------------------
def set_window_opacity
instance_variables.each do |varname|
ivar = instance_variable_get(varname)
if ivar.is_a?(Window)
ivar.opacity = WINDOW_OPACITY
end
end
end
#--------------------------------------------------------------------------
# ? Create Particles
#--------------------------------------------------------------------------
def create_particles
return unless PARTICLES
dispose_menu_particles
@particle_viewport = Viewport.new(-32, -32, 576, 448)
@particle_bitmap =[]
for i in 0...NUMBER_OF_PARTICLES
@particle_bitmap.push(Menu_Particles.new(@particle_viewport))
end
end
#--------------------------------------------------------------------------
# ? Create Background
#--------------------------------------------------------------------------
def create_background
@background_sprite = Plane.new
@background_sprite.bitmap = Cache.system($game_system.wallpaper) rescue nil
@background_sprite.bitmap = SceneManager.background_bitmap if @background_sprite.bitmap == nil
end
#--------------------------------------------------------------------------
# ? Dispose Light
#--------------------------------------------------------------------------
def dispose_menu_particles
return unless PARTICLES
if @particle_bitmap != nil
@particle_bitmap.each {|sprite| sprite.dispose}
@particle_viewport.dispose
@particle_bitmap = nil
end
end
#--------------------------------------------------------------------------
# ? Dispose Background
#--------------------------------------------------------------------------
def dispose_background
return if @background_sprite == nil
@background_sprite.bitmap.dispose
@background_sprite.dispose
@background_sprite = nil
end
#--------------------------------------------------------------------------
# ? Terminate
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_particles
end
#--------------------------------------------------------------------------
# ? Update
#--------------------------------------------------------------------------
def update
super
update_background
update_particle
end
#--------------------------------------------------------------------------
# ? Update Background
#--------------------------------------------------------------------------
def update_background
@background_sprite.ox += $game_system.wallpaper_scroll[0]
@background_sprite.oy += $game_system.wallpaper_scroll[1]
end
#--------------------------------------------------------------------------
# ? Update Particle
#--------------------------------------------------------------------------
def update_particle
return unless PARTICLES
@particle_bitmap.each {|sprite| sprite.update }
end
end
#==============================================================================
# ? Scene Menu
#==============================================================================
class Scene_Menu < Scene_MenuBase
include WALLPAPER_EX
#--------------------------------------------------------------------------
# ? Start
#--------------------------------------------------------------------------
alias mog_layout_ex_start start
def start
mog_layout_ex_start
set_window_opacity
end
end
#==============================================================================
# ? Scene Item
#==============================================================================
class Scene_Item < Scene_ItemBase
include WALLPAPER_EX
#--------------------------------------------------------------------------
# ? Start
#--------------------------------------------------------------------------
alias mog_layout_ex_start start
def start
mog_layout_ex_start
set_window_opacity
end
end
#==============================================================================
# ? Scene Skill
#==============================================================================
class Scene_Skill < Scene_ItemBase
include WALLPAPER_EX
#--------------------------------------------------------------------------
# ? Start
#--------------------------------------------------------------------------
alias mog_layout_ex_start start
def start
mog_layout_ex_start
set_window_opacity
end
end
#==============================================================================
# ? Scene Equip
#==============================================================================
class Scene_Equip < Scene_MenuBase
include WALLPAPER_EX
#--------------------------------------------------------------------------
# ? Start
#--------------------------------------------------------------------------
alias mog_layout_ex_start start
def start
mog_layout_ex_start
set_window_opacity
end
end
#==============================================================================
# ? Scene Status
#==============================================================================
class Scene_Status < Scene_MenuBase
include WALLPAPER_EX
#--------------------------------------------------------------------------
# ? Start
#--------------------------------------------------------------------------
alias mog_layout_ex_start start
def start
mog_layout_ex_start
set_window_opacity
end
end
#==============================================================================
# ? Scene File
#==============================================================================
class Scene_File < Scene_MenuBase
include WALLPAPER_EX
#--------------------------------------------------------------------------
# ? Start
#--------------------------------------------------------------------------
alias mog_layout_ex_start start
def start
mog_layout_ex_start
set_window_opacity
end
end
#==============================================================================
# ? Scene End
#==============================================================================
class Scene_End < Scene_MenuBase
include WALLPAPER_EX
#--------------------------------------------------------------------------
# ? Start
#--------------------------------------------------------------------------
alias mog_layout_ex_start start
def start
mog_layout_ex_start
set_window_opacity
end
end
#==============================================================================
# ? Window SaveFile
#==============================================================================
class Window_SaveFile < Window_Base
#--------------------------------------------------------------------------
# ? Initialize
#--------------------------------------------------------------------------
alias mog_wallpaper_initialize initialize
def initialize(height, index)
mog_wallpaper_initialize(height, index)
self.opacity = WALLPAPER_EX::WINDOW_OPACITY if can_opacity_window?
end
#--------------------------------------------------------------------------
# ? Can Opacity Window
#--------------------------------------------------------------------------
def can_opacity_window?
return true
end
end
$mog_rgss3_wallpaper_ex = true
Now what I am having trouble with is the very bottom part of the code.
The part that says : $mog_rgss3_wallpaper_ex = true
It doesn't work.
If I put false the wallpaper is still on.
I had assumed this was some sort of on/off code for the wallpaper.
If it is, it doesn't work right.
I used it as a script call in the game putting false instead of true.
The wallpaper was still on in game.
How do I get this to work properly now?
I need to get it working properly so I can give players the choice to turn the wallpaper on or off at will.
Please help me with this code now.
Anyone?
You may should download the new version of the script here:
http://www.atelier-rgss.com/RGSS/Menu/ACE_Menu12.html
The version say's 2.1 from the demo I've downloaded, so your 1.1 is pretty outdated, but it would be allways good to list all the scripts you use, that might would help other, for helping you. ;) (\s/)