Danh hiệu : The King Tổng số bài gửi : 1229 MGV Xu : 2677 Danh tiếng : 45 Ngày tham gia : 10/12/2010 Đến từ : Quảng Ninh
Tiêu đề: Battle back 15/12/2010, 21:19
Script thay thế battleback mặc định của VX bằng hình ảnh.
Script:
Code:
#============================================================================== # ** Battlebacks VX #------------------------------------------------------------------------------ # by DerVVulfman # version 1.2 # 03-29-2008 # RGSS2 #------------------------------------------------------------------------------ # # INTRODUCTION: # # This system reintroduces the use of 'Battleback' graphics into your pro- # jects, something that was sadly lacking in tbe RPGMaker VX system. # #------------------------------------------------------------------------------ # # SCRIPT CALLS: # # There's only one script call that you need to know. # # --Changing Battlebacks-- # Given that this system allows you to use 'Battlebacks, you may find a need # to 'change' the battleback in-game. Unfortunately, this can't be done with # a pre-rendered map event, so I had to make a script call: # # $game_system.battleback = "filename" # # The filename is whatever is stored within the folder that you have speci- # fied in the configuration section (in the BATTLEBACK_DIR value). # #------------------------------------------------------------------------------ # # THANKS: # # To Fantasy at RPG RPG Revolution for noticing a bug when using the 'Battle # Test' feature. # #------------------------------------------------------------------------------ # TERMS AND CONDITIONS: # # Free to use, even in commercial projects. Just note that I need some form # of due credit... even a mere mention in some end titles. # #==============================================================================
#======================================================================== # ** C O N F I G U R A T I O N S Y S T E M ** # #========================================================================
# Name of directory (used in cache) BATTLEBACK_DIR = "Graphics/Battlebacks/"
} # The name of the battleback used # when using the Battle Test feature. BATTLEBACK_TEST = "BG004"
#============================================================================== # ** Cache #------------------------------------------------------------------------------ # This module loads each of graphics, creates a Bitmap object, and retains it. # To speed up load times and conserve memory, this module holds the created # Bitmap object in the internal hash, allowing the program to return # preexisting objects when the same bitmap is requested again. #==============================================================================
module Cache #-------------------------------------------------------------------------- # * Get Battleback Graphic # filename : Filename #-------------------------------------------------------------------------- def self.battleback(filename) load_bitmap(BATTLEBACK_DIR, filename) end end
#============================================================================== # ** Game_System #------------------------------------------------------------------------------ # This class handles system-related data. Also manages vehicles and BGM, etc. # The instance of this class is referenced by $game_system. #==============================================================================
class Game_System #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :battleback # filename of battleback #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- alias bback_initialize initialize def initialize bback_initialize @battleback = nil end end
#============================================================================== # ** Spriteset_Battle #------------------------------------------------------------------------------ # This class brings together battle screen sprites. It's used within the # Scene_Battle class. #==============================================================================
class Spriteset_Battle #-------------------------------------------------------------------------- # * Create Battleback Sprite #-------------------------------------------------------------------------- alias bback_create_battleback create_battleback def create_battleback # Perform and exit for battletests if $BTEST if BATTLEBACK_TEST != nil # Create Battleback sprite @battleback_sprite = Sprite.new(@viewport1) # Load image from cache @battleback_sprite.bitmap = Cache.battleback(BATTLEBACK_TEST) return else bback_create_battleback return end end # If map used 'called' battleback. if $game_system.battleback != nil # Create Battleback sprite @battleback_sprite = Sprite.new(@viewport1) # Load image from cache @battleback_sprite.bitmap = Cache.battleback($game_system.battleback) # If map has assigned battleback elsif BATTLEBACK_LIST.key?($game_map.map_id) # Create Battleback sprite @battleback_sprite = Sprite.new(@viewport1) # Load image from cache @battleback_sprite.bitmap = Cache.battleback(BATTLEBACK_LIST[$game_map.map_id]) # Otherwise, as normal else # Perform the original call bback_create_battleback end end #-------------------------------------------------------------------------- # * Create Battlefloor Sprite #-------------------------------------------------------------------------- alias bback_create_battlefloor create_battlefloor def create_battlefloor # Disable battlefloor for existing battleback maps if BATTLEBACK_LIST.key?($game_map.map_id) or $game_system.battleback != nil @battlefloor_sprite = Sprite.new(@viewport1) return end # Disable for battletests with set battleback if $BTEST if BATTLEBACK_TEST != nil @battlefloor_sprite = Sprite.new(@viewport1) return end end # Perform the original call bback_create_battlefloor end end
Hướng dẫn: Hình để trong thư mục: Graphics/Battlebacks/
Kích thước ảnh: 544x416
Mỗi map một battleback, chỉnh trong script, ta thấy: BATTLEBACK_LIST = { 1 => "BG7", Nghĩa là map ID = 1 có battleback là file hình có tên BG7.png
Còn dòng: BATTLEBACK_TEST = "BG004" Nghĩa là khi test dùng file hình này
Muốn thay đổi battleback trong game thì gọi script sau (Event Command -> Script): $game_system.battleback = "filename" "filename" là tên hình, nhớ là có dấu nháy "
skriptank Level 1
Tổng số bài gửi : 34 MGV Xu : 90 Danh tiếng : 8 Ngày tham gia : 15/12/2010 Đến từ : http://anhhungthieunien.22web.net/
Tiêu đề: Re: Battle back 15/12/2010, 21:20
cho cấy S coi cho đỡ
duongtiep Level 15
Danh hiệu : The King Tổng số bài gửi : 1229 MGV Xu : 2677 Danh tiếng : 45 Ngày tham gia : 10/12/2010 Đến từ : Quảng Ninh
Tiêu đề: Re: Battle back 15/12/2010, 21:22
không có khổ thế đấy để mai up vậy
L.V Level 4
Tổng số bài gửi : 197 MGV Xu : 341 Danh tiếng : 9 Ngày tham gia : 13/12/2010 Tuổi : 29 Đến từ : Cầu Xe Hội
Tiêu đề: Re: Battle back 16/12/2010, 10:01
Không có cái này Battle của VX xấu ẹt ! Nhất là battle taiken hay gì gì đó !