Rei Loading System memungkinkan kamu memunculkan loading scene sebelum memasuki suatu scene! (Butuh scripting knowledge tingkat rendah), seperti di bootingnya windows!
Script ini kompatibel dengan RPG Maker XP ataupun VX.
Screenshoot
Scripts
#===============================================================================
# † [VX/XP] † Rei Loading System † †
# † Membuat sebuah loading sebelum menuju sebuah scene †
#-------------------------------------------------------------------------------
# † by reijubv [aruyasoft@comic.com]
# † RMID (Rpgmakerid.forumotion.com)
# † Dipublikasikan pada : 23/09/2009
# † Versi: 1.0 (23 September 2009)
#-------------------------------------------------------------------------------
# > Changelog:
# V.1.0 (23-09-09) = Skrip selesai, di publikasikan.
#-------------------------------------------------------------------------------
# Dengan script ini, kamu bisa memunculkan sebuah loading seperti saat booting
# windows, sebelum membuka suatu scene, misalnya sebelum menu, sebelum title
# screen, atau apapun juga . . .
# Untuk menggunakan script ini, saat akan memanggil scene, dari yg biasanya
# $scene = Scene_Map.new
# Kamu ubah jadi
# $scene = Loading.new(Scene_Map.new)
# Untuk menggunakan settingan yang berbeda untuk tiap loading, gunakan ini :
# $scene = Loading.new(Scene_Map.new, template_ID)
#-------------------------------------------------------------------------------
'██████████████████████████████████████████████████████████████████████████████'
'███████████████████████ KOMPATIBEL DENGAN RPGMAKER XP ████████████████████████'
'██████████████████████████████████████████████████████████████████████████████'
'██████████████████████████████████████████████████████████████████████████████'
'███████████████████ TIDAK KOMPATIBEL DENGAN TRANSITION PACK ██████████████████'
'██████████████████████████████████████████████████████████████████████████████'
#-------------------------------------------------------------------------------
# Untuk menghilangkan efek loading yang agak "tersendat-sendat", silakan edit
# baris 172 & 174, kalau misalnya kamu mau loading yang "smooth" . . .
#-------------------------------------------------------------------------------
# Credits:
# reijubv
#-------------------------------------------------------------------------------
# ? Pemasangan:
# Taroh diatas Main, edit Rei module dibawah...
#==============================================================================
$imported = {} if $imported == nil
$imported["Rei_"+"LoadingScene"] = true
#---------------------------------------------------------------------------
# ** Rei Module
#---------------------------------------------------------------------------
module Rei
module LoadingScene
# =================
# SETTINGAN DEFAULT
# =================
# Gambar background dari loadingnya
IMG_BACKGROUND = 'Dota_Chibi'
# Gambar loading bar-nya
IMG_LOADING_BAR = 'Boot_Loadingbar'
# Gambar border loadingnya
IMG_LOADING_BRD = 'Boot_Loadingborder'
# Setting loading bar-nya di bawah
# [koordinat_x,koordinat_y,panjang_border,tinggi_border]
LOADINGBAR_STP = [198,361,240,30]
# Berapa lama loading akan muncul?
DURATION = 240
# Gambar transition yang akan dipakai saat loading muncul (di folder
# Graphics/Transition
TRANS_OPEN = '003-Blind03'
# Durasi transition diatas
TRANS_OPEN_DUR = 30
# Gambar transition yang akan dipakai saat loading selesai
TRANS_CLOSE = '004-Blind04'
# Durasi transition diatas
TRANS_CLOSE_DUR = 30
# Kecepatan geraknya bar
# Script akan merandom lagi kecepatan bar supaya terlihat lebih nyata
SPEED = 5
# ==================
# SETTINGAN TEMPLATE
# ==================
TEMPLATE = {} # JANGAN HAPUS INI
TEMPLATE = { # JANGAN HAPUS INI
# id => {type => data,
# jangan lupa akhiri dengan tanda '}' lalu koma ','
# bila ada yang ga disetting di sini, akan menggunakan default yg ada diatas
0 => {
'back' => 'Dota_Chibi',
'bar' => 'Boot_Loadingbar',
'border' => 'Boot_Loadingborder',
'setup' => [198,361,240,30],
'dur' => 240,
'trans1' => '003-Blind03',
'trans1dur' => 30,
'trans2' => '004-Blind04',
'trans2dur' => 30,
'speed' => 5
},
} # JANGAN HAPUS INI
end
end
#===============================================================================
# LOADING . . .
#===============================================================================
class Loading
include Rei::LoadingScene
def initialize(scene = Scene_Map.new, id = nil)
if id.nil?
@back = IMG_BACKGROUND
@bar = IMG_LOADING_BAR
@bor = IMG_LOADING_BRD
@setup = LOADINGBAR_STP
@dur = DURATION
@trans1 = TRANS_OPEN
@trans1dur = TRANS_OPEN_DUR
@trans2 = TRANS_CLOSE
@trans2dur = TRANS_CLOSE_DUR
@speed = SPEED
else
@back=TEMPLATE[id]['back'].nil? ? IMG_BACKGROUND : TEMPLATE[id]['back']
@bar=TEMPLATE[id]['bar'].nil? ? IMG_LOADING_BAR : TEMPLATE[id]['bar']
@bor=TEMPLATE[id]['border'].nil? ? IMG_LOADING_BRD : TEMPLATE[id]['border']
@setup=TEMPLATE[id]['setup'].nil? ? LOADINGBAR_STP : TEMPLATE[id]['setup']
@dur=TEMPLATE[id]['dur'].nil? ? DURATION : TEMPLATE[id]['dur']
@trans1=TEMPLATE[id]['trans1'].nil? ? TRANS_OPEN : TEMPLATE[id]['trans1']
@trans1dur=TEMPLATE[id]['trans1dur'].nil? ? TRANS_OPEN_DUR : TEMPLATE[id]['trans1dur']
@trans2=TEMPLATE[id]['trans2'].nil? ? TRANS_CLOSE : TEMPLATE[id]['trans2']
@trans2dur=TEMPLATE[id]['trans2dur'].nil? ? TRANS_CLOSE_DUR : TEMPLATE[id]['trans2dur']
@speed=TEMPLATE[id]['speed'].nil? ? SPEED : TEMPLATE[id]['speed']
end
@scene = scene
end
def main
start
Input.update
loop do
Graphics.update
Input.update
update_phase
break if @phase == 1
end
Graphics.update
Graphics.freeze
terminate
end
def start
@view = Viewport.new(@setup[0],@setup[1],@setup[2],@setup[3])
@view.z = 1000
@tp = "Graphics/Transition/"
Graphics.transition(@trans1dur,@tp+@trans1)
@sprite_loading_bar = Plane.new(@view)
@sprite_loading_border = Sprite.new
@sprite_loading_back = Sprite.new
@sprite_loading_bar.bitmap = Cache.picture(@bar)
@sprite_loading_border.bitmap = Cache.picture(@bor)
@sprite_loading_back.bitmap = Cache.picture(@back)
@sprite_loading_bar.ox = @sprite_loading_bar.bitmap.width / 2
@sprite_loading_back.z = 1
@sprite_loading_border.z = 2
@sprite_loading_bar.z = 3
@phase = 0
@wait = 0
end
def terminate
@sprite_loading_bar.bitmap.dispose
@sprite_loading_border.bitmap.dispose
@sprite_loading_back.bitmap.dispose
@sprite_loading_bar.dispose
@sprite_loading_border.dispose
@sprite_loading_back.dispose
Graphics.transition(@trans2dur,@tp+@trans2)
$scene = @scene
end
def update_phase
@wait += 1
if rand(4) == 0
@sprite_loading_bar.ox -= (@speed-rand(2)) + rand(@speed-rand(2))
elsif rand(4) == 1
@sprite_loading_bar.ox -= (@speed-rand(2)) + rand(@speed+rand(2))
end
@phase = 1 if @wait >= @dur
end
end
#===============================================================================
# END LOADING . . .
#===============================================================================
# † [VX/XP] † Rei Loading System † †
# † Membuat sebuah loading sebelum menuju sebuah scene †
#-------------------------------------------------------------------------------
# † by reijubv [aruyasoft@comic.com]
# † RMID (Rpgmakerid.forumotion.com)
# † Dipublikasikan pada : 23/09/2009
# † Versi: 1.0 (23 September 2009)
#-------------------------------------------------------------------------------
# > Changelog:
# V.1.0 (23-09-09) = Skrip selesai, di publikasikan.
#-------------------------------------------------------------------------------
# Dengan script ini, kamu bisa memunculkan sebuah loading seperti saat booting
# windows, sebelum membuka suatu scene, misalnya sebelum menu, sebelum title
# screen, atau apapun juga . . .
# Untuk menggunakan script ini, saat akan memanggil scene, dari yg biasanya
# $scene = Scene_Map.new
# Kamu ubah jadi
# $scene = Loading.new(Scene_Map.new)
# Untuk menggunakan settingan yang berbeda untuk tiap loading, gunakan ini :
# $scene = Loading.new(Scene_Map.new, template_ID)
#-------------------------------------------------------------------------------
'██████████████████████████████████████████████████████████████████████████████'
'███████████████████████ KOMPATIBEL DENGAN RPGMAKER XP ████████████████████████'
'██████████████████████████████████████████████████████████████████████████████'
'██████████████████████████████████████████████████████████████████████████████'
'███████████████████ TIDAK KOMPATIBEL DENGAN TRANSITION PACK ██████████████████'
'██████████████████████████████████████████████████████████████████████████████'
#-------------------------------------------------------------------------------
# Untuk menghilangkan efek loading yang agak "tersendat-sendat", silakan edit
# baris 172 & 174, kalau misalnya kamu mau loading yang "smooth" . . .
#-------------------------------------------------------------------------------
# Credits:
# reijubv
#-------------------------------------------------------------------------------
# ? Pemasangan:
# Taroh diatas Main, edit Rei module dibawah...
#==============================================================================
$imported = {} if $imported == nil
$imported["Rei_"+"LoadingScene"] = true
#---------------------------------------------------------------------------
# ** Rei Module
#---------------------------------------------------------------------------
module Rei
module LoadingScene
# =================
# SETTINGAN DEFAULT
# =================
# Gambar background dari loadingnya
IMG_BACKGROUND = 'Dota_Chibi'
# Gambar loading bar-nya
IMG_LOADING_BAR = 'Boot_Loadingbar'
# Gambar border loadingnya
IMG_LOADING_BRD = 'Boot_Loadingborder'
# Setting loading bar-nya di bawah
# [koordinat_x,koordinat_y,panjang_border,tinggi_border]
LOADINGBAR_STP = [198,361,240,30]
# Berapa lama loading akan muncul?
DURATION = 240
# Gambar transition yang akan dipakai saat loading muncul (di folder
# Graphics/Transition
TRANS_OPEN = '003-Blind03'
# Durasi transition diatas
TRANS_OPEN_DUR = 30
# Gambar transition yang akan dipakai saat loading selesai
TRANS_CLOSE = '004-Blind04'
# Durasi transition diatas
TRANS_CLOSE_DUR = 30
# Kecepatan geraknya bar
# Script akan merandom lagi kecepatan bar supaya terlihat lebih nyata
SPEED = 5
# ==================
# SETTINGAN TEMPLATE
# ==================
TEMPLATE = {} # JANGAN HAPUS INI
TEMPLATE = { # JANGAN HAPUS INI
# id => {type => data,
# jangan lupa akhiri dengan tanda '}' lalu koma ','
# bila ada yang ga disetting di sini, akan menggunakan default yg ada diatas
0 => {
'back' => 'Dota_Chibi',
'bar' => 'Boot_Loadingbar',
'border' => 'Boot_Loadingborder',
'setup' => [198,361,240,30],
'dur' => 240,
'trans1' => '003-Blind03',
'trans1dur' => 30,
'trans2' => '004-Blind04',
'trans2dur' => 30,
'speed' => 5
},
} # JANGAN HAPUS INI
end
end
#===============================================================================
# LOADING . . .
#===============================================================================
class Loading
include Rei::LoadingScene
def initialize(scene = Scene_Map.new, id = nil)
if id.nil?
@back = IMG_BACKGROUND
@bar = IMG_LOADING_BAR
@bor = IMG_LOADING_BRD
@setup = LOADINGBAR_STP
@dur = DURATION
@trans1 = TRANS_OPEN
@trans1dur = TRANS_OPEN_DUR
@trans2 = TRANS_CLOSE
@trans2dur = TRANS_CLOSE_DUR
@speed = SPEED
else
@back=TEMPLATE[id]['back'].nil? ? IMG_BACKGROUND : TEMPLATE[id]['back']
@bar=TEMPLATE[id]['bar'].nil? ? IMG_LOADING_BAR : TEMPLATE[id]['bar']
@bor=TEMPLATE[id]['border'].nil? ? IMG_LOADING_BRD : TEMPLATE[id]['border']
@setup=TEMPLATE[id]['setup'].nil? ? LOADINGBAR_STP : TEMPLATE[id]['setup']
@dur=TEMPLATE[id]['dur'].nil? ? DURATION : TEMPLATE[id]['dur']
@trans1=TEMPLATE[id]['trans1'].nil? ? TRANS_OPEN : TEMPLATE[id]['trans1']
@trans1dur=TEMPLATE[id]['trans1dur'].nil? ? TRANS_OPEN_DUR : TEMPLATE[id]['trans1dur']
@trans2=TEMPLATE[id]['trans2'].nil? ? TRANS_CLOSE : TEMPLATE[id]['trans2']
@trans2dur=TEMPLATE[id]['trans2dur'].nil? ? TRANS_CLOSE_DUR : TEMPLATE[id]['trans2dur']
@speed=TEMPLATE[id]['speed'].nil? ? SPEED : TEMPLATE[id]['speed']
end
@scene = scene
end
def main
start
Input.update
loop do
Graphics.update
Input.update
update_phase
break if @phase == 1
end
Graphics.update
Graphics.freeze
terminate
end
def start
@view = Viewport.new(@setup[0],@setup[1],@setup[2],@setup[3])
@view.z = 1000
@tp = "Graphics/Transition/"
Graphics.transition(@trans1dur,@tp+@trans1)
@sprite_loading_bar = Plane.new(@view)
@sprite_loading_border = Sprite.new
@sprite_loading_back = Sprite.new
@sprite_loading_bar.bitmap = Cache.picture(@bar)
@sprite_loading_border.bitmap = Cache.picture(@bor)
@sprite_loading_back.bitmap = Cache.picture(@back)
@sprite_loading_bar.ox = @sprite_loading_bar.bitmap.width / 2
@sprite_loading_back.z = 1
@sprite_loading_border.z = 2
@sprite_loading_bar.z = 3
@phase = 0
@wait = 0
end
def terminate
@sprite_loading_bar.bitmap.dispose
@sprite_loading_border.bitmap.dispose
@sprite_loading_back.bitmap.dispose
@sprite_loading_bar.dispose
@sprite_loading_border.dispose
@sprite_loading_back.dispose
Graphics.transition(@trans2dur,@tp+@trans2)
$scene = @scene
end
def update_phase
@wait += 1
if rand(4) == 0
@sprite_loading_bar.ox -= (@speed-rand(2)) + rand(@speed-rand(2))
elsif rand(4) == 1
@sprite_loading_bar.ox -= (@speed-rand(2)) + rand(@speed+rand(2))
end
@phase = 1 if @wait >= @dur
end
end
#===============================================================================
# END LOADING . . .
#===============================================================================
Demo
Untuk demo scriptnya dapat di download disini
0 komentar:
Posting Komentar