Project1
标题:
请帮忙看看这个脚本
[打印本页]
作者:
icogogogo
时间:
2008-7-2 23:58
标题:
请帮忙看看这个脚本
这是一个调用战斗背景的脚本
不知道这个脚本可不可以用当前地图作为战斗背景呢?
不要VX自带的眩晕效果
module MOG_VX02
#Definição da switch que ativa o efeito Wave.
BB_WAVE_SWITCH = 0
#Definição da switch que ativa a versão VX.
BB_VXEDITION_SWITCH = 0
end
#-------------------------------------------------
$mogscript = {} if $mogscript == nil
$mogscript["battleback_xp"] = true
#-------------------------------------------------
###############
# Game_System #
###############
class Game_System
attr_accessor :bb
alias mog_vx02_initialize initialize
def initialize
mog_vx02_initialize
@bb = ""
end
end
###############
# Module Cache #
###############
module Cache
def self.battleback(filename)
load_bitmap("Graphics/battlebacks/", filename)
end
end
#################
# Spriteset_Battle #
#################
class Spriteset_Battle
include MOG_VX02
def create_battleback
@battleback_sprite = Sprite.new(@viewport1)
source = Cache.battleback($game_system.bb.to_s) rescue empty
if $game_switches[BB_WAVE_SWITCH] == true
bitmap = Bitmap.new(640, 480)
else
bitmap = Bitmap.new(544, 288)
end
bitmap.stretch_blt(bitmap.rect, source, source.rect)
bitmap.radial_blur(90, 12) if $game_switches[BB_VXEDITION_SWITCH] == true
@battleback_sprite.bitmap = bitmap
wave_on if $game_switches[BB_WAVE_SWITCH] == true
end
def wave_on
@battleback_sprite.ox = 320
@battleback_sprite.oy = 240
@battleback_sprite.x = 272
@battleback_sprite.y = 176
@battleback_sprite.wave_amp = 8
@battleback_sprite.wave_length = 240
@battleback_sprite.wave_speed = 120
end
def empty
@battleback_sprite.bitmap = $game_temp.background_bitmap
end
def create_battlefloor
if $game_switches[BB_VXEDITION_SWITCH] == true
@battlefloor_sprite = Sprite.new(@viewport1)
@battlefloor_sprite.bitmap = Cache.system("BattleFloor")
@battlefloor_sprite.x = 0
@battlefloor_sprite.y = 192
@battlefloor_sprite.z = 1
@battlefloor_sprite.opacity = 128
else
@battlefloor_sprite = Sprite.new(@viewport1)
end
end
end
复制代码
[LINE]1,#dddddd[/LINE]
版务信息:本贴由楼主自主结贴~
作者:
八云紫
时间:
2008-7-3 00:00
那么,还是用这个脚本好了。{/hx}
#==============================================================================
# ■ VX-RGSS2 改变战斗背景 [版本.1.0.0] by Claimh
#------------------------------------------------------------------------------
# 英语翻译 By: Elemental Crisis [http://www.rpgcrisis.net]
# 中文翻译 By: zero2 [http://rpg.blue/web]
#------------------------------------------------------------------------------
# 改变战斗的背景图.
#==============================================================================
module BattleBack
# 选择战斗背景
# 0:当前地图的战斗背景,为战斗背景(默认VX的样式)
# 1:目前使用的地图作为战斗背景
# 2:使用自己的图片,为战斗背景
BB_TYPE = 1 # 在这里输入上面提到的编号
# 显示战斗地面
BT_FLOOR = false
# 使用的图片(如果你选择的编号为2)
M_B_BACK = {
# 地图编号 => "(Graphics/System/图片名)"
71 => "Sea",
72 => "Sea of clouds"
}
end
#==============================================================================
# ■ Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ● Creating Battle Back Sprite
#--------------------------------------------------------------------------
def create_battleback
case BattleBack::BB_TYPE
when 0
source = $game_temp.background_bitmap
bitmap = Bitmap.new(640, 480)
bitmap.stretch_blt(bitmap.rect, source, source.rect)
bitmap.radial_blur(90, 12)
@battleback_sprite = Sprite.new(@viewport1)
@battleback_sprite.bitmap = bitmap
@battleback_sprite.ox = 320
@battleback_sprite.oy = 240
@battleback_sprite.x = 272
@battleback_sprite.y = 176
@battleback_sprite.wave_amp = 8
@battleback_sprite.wave_length = 240
@battleback_sprite.wave_speed = 120
when 1
source = $game_temp.background_bitmap
bitmap = Bitmap.new(640, 480)
bitmap.stretch_blt(bitmap.rect, source, source.rect)
@battleback_sprite = Sprite.new(@viewport1)
@battleback_sprite.bitmap = bitmap
@battleback_sprite.ox = 320
@battleback_sprite.oy = 240
@battleback_sprite.x = 272
@battleback_sprite.y = 176
when 2
@battleback_sprite = BattleBackSprite.new(@viewport1)
end
end
#--------------------------------------------------------------------------
# ● Creating Battle Floor Sprite
#--------------------------------------------------------------------------
alias create_battlefloor_mbb create_battlefloor
def create_battlefloor
create_battlefloor_mbb if BattleBack::BT_FLOOR
end
#--------------------------------------------------------------------------
# ● Delete Battle Floor Sprite
#--------------------------------------------------------------------------
alias dispose_battlefloor_mbb dispose_battlefloor
def dispose_battlefloor
dispose_battlefloor_mbb if BattleBack::BT_FLOOR
end
#--------------------------------------------------------------------------
# ● Update Battle Floor Sprite
#--------------------------------------------------------------------------
alias update_battlefloor_mbb update_battlefloor
def update_battlefloor
update_battlefloor_mbb if BattleBack::BT_FLOOR
end
end
#==============================================================================
# ■ BattleBackSprite
#==============================================================================
class BattleBackSprite < Sprite
# Background Screen Size
WIDTH = 544.00
HEIGHT = 288.00
#--------------------------------------------------------------------------
# ● Object Initialization
# viewport : viewport
#--------------------------------------------------------------------------
def initialize(viewport = nil)
super(viewport)
self.bitmap = Cache.system(BattleBack::M_B_BACK[$game_map.map_id])
# Zoom is carried out according to picture size.
@x_zoom = WIDTH / self.bitmap.width
@y_zoom = HEIGHT / self.bitmap.height
@zoom = @x_zoom > @y_zoom ? @x_zoom : @y_zoom
# Zoom is carried out.
self.zoom_x = @zoom
self.zoom_y = @zoom
# Made into central display.
self.ox = self.bitmap.width / 2
self.oy = self.bitmap.height / 2
self.x = (self.bitmap.width / 2) * @zoom
self.y = (self.bitmap.height / 2) * @zoom
end
end
复制代码
[LINE]1,#dddddd[/LINE]
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者:
icogogogo
时间:
2008-7-3 00:09
那么如果我想在游戏中
改自己的战斗背景图片为使用地图作战斗背景
应该怎么做呢?
作者:
八云紫
时间:
2008-7-3 00:11
参考这个:
# 选择战斗背景
# 0:当前地图的战斗背景,为战斗背景(默认VX的样式)
# 1:目前使用的地图作为战斗背景
# 2:使用自己的图片,为战斗背景
BB_TYPE = 1 # 在这里输入上面提到的编号
复制代码
然后指定 地图ID => 图片名字
# 使用的图片(如果你选择的编号为2)
M_B_BACK = {
# 地图编号 => "(Graphics/System/图片名)"
71 => "Sea",
72 => "Sea of clouds"
}
复制代码
作者:
icogogogo
时间:
2008-7-3 00:25
{/pz}不好意思,我太白了,看不懂啊~
是不是这个意思?
那个71是地图“海”的编号,只要在海上行走的话,战斗背景就是图片“Sea”是吗?
作者:
八云紫
时间:
2008-7-3 00:42
那个 71 是地图ID号,意思是,在71号地图上遇敌,战斗背景就是使用 Sea 这张图片。
作者:
icogogogo
时间:
2008-7-3 18:08
那也不行啊,总不能一整张地图全是海洋吧~
那这样可不可以,特定战斗用XP的战斗背景,一般杂兵用当前地图或者眩晕效果做战斗背景呢?
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1