Parallax & Fog Autoscroll in XP
Version: 1.1
Type: Map Add-On
PengenalanScript ini menambahkan auto scroll pada parallax (panorama) sehingga dapat bergeser secara terus menerus seperti di RMVX, dengan cara memanipulasi kelas Spriteset_Map. Namun tidak hanya untuk parallax, tapi juga untuk fog.
- Curhat Mode ON:
Meski sekian lama scripting e Alissa udah karatan, akhirnya Alissa back to scripting, krn takdirnya gitu
btw, saat browsing semua script di forum ini, kayanya lum ada deh yg sejenis ini, yaudah deh Alissa tambahin aja
FAQQ: Apa itu parallax/panorama?
A: Ya background lah
Q: Bisa tolong bikin script autoscroll fog buat RMVX ga?
A: Sori masih lum sempet, maklum udah karatan
Q: Apakah ada kemungkinan bentrok ama script lain?
A: Kayanya ga mungkin deh, soalnya script nya cukup sederhana
Q: Tapi.. gimana dengan
script multiple fog nya littledrago?
A: Nah, buat yg ini kayanya bentrok deh, jadi pikirin sendiri gimana cara nyatuinnya
Q: Saat demonya di-run, ada masalah missing font
A: Demo ini emang pake custom font, yang dibutuhkan font yg namanya "Gabriola". Silahkan instal dulu font nya, atau hilangkan bagian
- Code:
-
Font.default_name = "Gabriola"
Font.default_size = 40
di script bagian Main kalo pengen pake font default nya
Q: Di demonya kok fog nya kayak blizzard?
A: Biz, bingung nih mo pake fog apa buat parallax luar angkasa sih
Screenshot- Spoiler:
https://i.imgur.com/ICfQa.png
DemoLink:
- http://www.media*fire.com/?tqgppv4b3p5ez4z
- http://ifile.it/0nxkhys (mirror, still in older version)
Script - Code:
-
#==============================================================================
# Parallax & Fog Autoscroll in XP
# for RPG Maker XP
# Version 1.1
#==============================================================================
# Information:
# This script makes parallaxes (panoramas) able to Autoscroll, like in RMVX
# and also makes fogs able to Autoscroll.
#
# Autoscroll can be configured in CustomParallax section at this script.
# Note that the array index is map ID for the parallax & fog.
#
# Credit
# Alissa Liu
#
#==============================================================================
#==============================================================================
# ** CustomParallax
#------------------------------------------------------------------------------
# Define parallax (panorama) and fog autoscroll values here.
#==============================================================================
class CustomParallax
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :parallax_scrollx
attr_accessor :parallax_scrolly
attr_accessor :fog_scrollx
attr_accessor :fog_scrolly
def initialize
@parallax_scrollx = [0,3]
@parallax_scrolly = [0,2]
@fog_scrollx = [0,3]
@fog_scrolly = [0,2]
end
def p_chg_scrollx(val)
@parallax_scrollx[$game_map.map_id] = val
end
def p_chg_scrolly(val)
@parallax_scrolly[$game_map.map_id] = val
end
def f_chg_scrollx(val)
@fog_scrollx[$game_map.map_id] = val
end
def f_chg_scrolly(val)
@fog_scrolly[$game_map.map_id] = val
end
end
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
# This class brings together map screen sprites, tilemaps, etc.
# It's used within the Scene_Map class.
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias cp_init initialize
def initialize
$cp = CustomParallax.new
@p_scrollx = 0
@p_scrolly = 0
@f_scrollx = 0
@f_scrolly = 0
cp_init
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias cp_update update
def update
cp_update
# Update panorama plane
if @panorama.bitmap != nil
@p_scrollx = (@p_scrollx+$cp.parallax_scrollx[$game_map.map_id]+@panorama.bitmap.width) % @panorama.bitmap.width
@p_scrolly = (@p_scrolly+$cp.parallax_scrolly[$game_map.map_id]+@panorama.bitmap.height) % @panorama.bitmap.height
@panorama.ox = $game_map.display_x / 8 + @p_scrollx
@panorama.oy = $game_map.display_y / 8 + @p_scrolly
end
# Update fog plane
if @fog.bitmap != nil
@f_scrollx = (@f_scrollx+$cp.fog_scrollx[$game_map.map_id]+@fog.bitmap.width) % @fog.bitmap.width
@f_scrolly = (@f_scrolly+$cp.fog_scrolly[$game_map.map_id]+@fog.bitmap.height) % @fog.bitmap.height
@fog.ox = $game_map.display_x / 4 + $game_map.fog_ox + @f_scrollx*2
@fog.oy = $game_map.display_y / 4 + $game_map.fog_oy + @f_scrolly*2
end
end
end
Credit