查看: 2261|回复: 2

[已经过期] A站的过场加载无法使用第二次

[复制链接]
梦石
0
星屑
50
在线时间
203 小时
注册时间
2014-8-18
回帖
5
发表于 2014-8-26 21:28:07 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 VIPArcher 于 2014-8-26 21:37 编辑

脚本[pre lang="ruby" line="1"]#===============================================================================
# +++ MOG - Advanced Load Bar (v1.1) +++
#===============================================================================
# By Moghunter
# http://www.atelier-rgss.com  
#===============================================================================
#提出了一个酒吧保存和加载的场景之间加载。
#这个脚本的目的是介绍他的一些作品,而游戏玩家等待搓擦条。
#===============================================================================
#你可以adpatar这个脚本在任何其他场景或激活事件。
#只要使用此代码。
#
# SceneManager.call(Scene_Load_Bar)
#
#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v 1.1 - 提高处置的摄像系统的。
#==============================================================================

module MOG_LOAD_BAR
   # 时间来加载.(Segundos)
   LOAD_DURATION = 3
   # 使系统能够载入游戏.
   ENABLE_LOAD_BAR_FOR_SCENE_LOAD = true   
   # 使系统能够保存游戏.
   ENABLE_LOAD_BAR_FOR_SCENE_SAVE = true      
   # 设置的图像,就可以在背景中.
   LOAD_BACKGROUND_PICTURES = [
   "Background_1",
   "Background_2",
   "Background_3",
   "Background_4",
   #"Background_5",
   #"Background_6"
   #"Background_7",
   #"Background_8",
   #"Background_9",
   #"Background_10",
   # ...
   ]
   # 启用随机或顺序.
   PICTURE_RANDOM_SELECTION = true   
   # HUD的大体位置.
   LOAD_BAR_POSITION = [30,350]
   # 仪表位置.
   LOAD_BAR_METER_POSITION = [11,27]
   # 文本位置.
   LOAD_BAR_TEXT_POSITION = [ 10, -3]
   # 加载文件时的声音.
   LOAD_SE = "Decision2"
   # 动画速度计.
   LOAD_BAR_FLOW_SPEED = 25
  # 设置将通过菜单保存后激活的场景。如果保存由事件作出,现场必应地图.
   RETURN_TO_SCENE = Scene_Menu.new(4)
   # 激活动画磁悬浮文字。.
   ENABLE_FLOAT_TEXT_ANIMATION = true
   # 显示画面字符.
   ENABLE_CHARACTER_SPRITE = true
   # Ativar barras laterais.
   ENABLE_STRIPE_SPRITE = true
   # 侧边栏的速度.
   STRIPE_SPEED = 1
end

#=============================================================================
# ■ Game_Temp
#=============================================================================
class Game_Temp
  attr_accessor :load_bar_pre_index
  attr_accessor :loadbar_type
  attr_accessor :load_pre_bgm
  attr_accessor :load_pre_bgs

#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------              
alias load_bar_initialize initialize
def initialize
     @load_bar_pre_index = -1
     @loadbar_type = 0   
     load_bar_initialize
end
   
end

#=============================================================================
# ■ Game_System
#=============================================================================
class Game_System
  attr_accessor :load_bar_pre_index
  
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------              
alias load_bar_initialize initialize
def initialize
     load_bar_initialize
     @load_bar_pre_index = 0
end

#--------------------------------------------------------------------------
# ● BGS Stop
#--------------------------------------------------------------------------            
def bgs_stop
     Audio.bgs_stop
end
end

#=============================================================================
# ■ Scene Load Bar
#=============================================================================
class Scene_Load_Bar
include MOG_LOAD_BAR
  
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------            
def initialize
     execute_dispose
     @bar_type = $game_temp.loadbar_type
     @load_duration_max = 60 * LOAD_DURATION
     @load_duration_max = 60 if @load_duration_max < 60  
     @load_duration = 0
     @pictures = LOAD_BACKGROUND_PICTURES
     create_background
     create_layout  
     create_load_bar
     create_text
     create_side_strip
end
   
#--------------------------------------------------------------------------
# ● Create Background
#--------------------------------------------------------------------------           
def create_background  
     @background = Sprite.new
     if PICTURE_RANDOM_SELECTION
        $game_system.load_bar_pre_index = rand(@pictures.size)
        no_repeat_picture
     end
     image_name = @pictures[$game_system.load_bar_pre_index]   
     image_name = "" if image_name == nil     
     @background.bitmap = Cache.picture(image_name)
     $game_temp.load_bar_pre_index = $game_system.load_bar_pre_index
     unless PICTURE_RANDOM_SELECTION
        $game_system.load_bar_pre_index += 1
        $game_system.load_bar_pre_index = 0 if $game_system.load_bar_pre_index > @pictures.size - 1
     end   
end
   
#--------------------------------------------------------------------------
# ● No Repeat Picture
#--------------------------------------------------------------------------            
def no_repeat_picture
     if $game_system.load_bar_pre_index == $game_temp.load_bar_pre_index
        $game_system.load_bar_pre_index += 1
        $game_system.load_bar_pre_index = 0 if $game_system.load_bar_pre_index > @pictures.size - 1
     end  
end

#--------------------------------------------------------------------------
# ● Create Layout
#--------------------------------------------------------------------------           
def create_layout  
     @hud = Sprite.new
     @hud.bitmap = Cache.system("Load_Bar_Layout")
     @hud.x = LOAD_BAR_POSITION[0]
     @hud.y = LOAD_BAR_POSITION[1]
     @hud.z = 10
end

#--------------------------------------------------------------------------
# ● Create Side Strip
#--------------------------------------------------------------------------           
def create_side_strip
     @stripe1 = Plane.new
     @stripe2 = Plane.new     
     if @bar_type == 0
        @stripe1.bitmap = Cache.system("Load_Bar_Stripe1_L")
        @stripe2.bitmap = Cache.system("Load_Bar_Stripe2_L")
     else  
        @stripe1.bitmap = Cache.system("Load_Bar_Stripe1_S")
        @stripe2.bitmap = Cache.system("Load_Bar_Stripe2_S")
     end  
     @stripe1.z = 1
     @stripe2.z = 1         
     @stripe1.visible = ENABLE_STRIPE_SPRITE
     @stripe2.visible = ENABLE_STRIPE_SPRITE
end

#--------------------------------------------------------------------------
# ● Create Load Bar
#--------------------------------------------------------------------------            
def create_load_bar
     @bar_flow = 0
     @bar_image = Cache.system("Load_Bar_Meter")
     @bar_bitmap = Bitmap.new(@bar_image.width,@bar_image.height)
     @bar_range = @bar_image.width / 3
     @bar_width = @bar_range  * @load_duration / @load_duration_max
     @bar_height = @bar_image.height
     @bar_width_old = @bar_width
     @bar_src_rect = Rect.new(@bar_flow, 0, @bar_width, @bar_height)
     @bar_bitmap.blt(0,0, @bar_image, @bar_src_rect)
     @bar_sprite = Sprite.new
     @bar_sprite.bitmap = @bar_bitmap
     @bar_sprite.z = 11
     @bar_sprite.x = LOAD_BAR_POSITION[0] + LOAD_BAR_METER_POSITION[0]
     @bar_sprite.y = LOAD_BAR_POSITION[1] + LOAD_BAR_METER_POSITION[1]
     update_bar_flow
end

#--------------------------------------------------------------------------
# ● 创建文本
#--------------------------------------------------------------------------            
def create_text
     @text_float_time = 0
     @text_float_y = 0
     @text_image = Cache.system("Load_Bar_Text")
     @text_bitmap = Bitmap.new(@text_image.width,@text_image.height)
     @text_width = @text_image.width
     @text_height = @text_image.height / 2
     @text_src_rect = Rect.new(0, @text_height * @bar_type, @text_width, @text_height)
     @text_bitmap.blt(0,0, @text_image, @text_src_rect)   
     @text_sprite = Sprite.new
     @text_sprite.bitmap = @text_bitmap   
     @text_fy = LOAD_BAR_POSITION[1] + LOAD_BAR_TEXT_POSITION[1]
     @text_sprite.x = LOAD_BAR_POSITION[0] + LOAD_BAR_TEXT_POSITION[0]
     @text_sprite.y = @text_fy
     @text_sprite.z = 12
end

#--------------------------------------------------------------------------
# ● Main
#--------------------------------------------------------------------------         
def main
     Graphics.transition
     execute_loop
     execute_dispose
end   

#--------------------------------------------------------------------------
# ● Execute Loop
#--------------------------------------------------------------------------           
def execute_loop
     loop do
          update
          Graphics.update         
          if SceneManager.scene != self
              break
          end
     end
end

#--------------------------------------------------------------------------
# ● Execute Dispose
#--------------------------------------------------------------------------            
def execute_dispose
     return if @hud == nil
     @hud.bitmap.dispose
     @hud.dispose
     @stripe1.bitmap.dispose
     @stripe1.dispose     
     @stripe2.bitmap.dispose
     @stripe2.dispose        
     @bar_image.dispose
     @bar_bitmap.dispose
     @bar_sprite.bitmap.dispose
     @bar_sprite.dispose     
     @background.bitmap.dispose
     @background.dispose
     @text_image.dispose
     @text_bitmap.dispose
     @text_sprite.bitmap.dispose
     @text_sprite.dispose
     Graphics.transition
     Graphics.freeze
end  

#--------------------------------------------------------------------------
# ● Update
#--------------------------------------------------------------------------            
def update
     update_bar_flow
     update_bar_duration
     update_float_text
     update_slide_stripe
end

#--------------------------------------------------------------------------
# ● Update Slide Stripe
#--------------------------------------------------------------------------              
def update_slide_stripe
     @stripe1.oy += STRIPE_SPEED
     @stripe2.ox += STRIPE_SPEED
end   
   
#--------------------------------------------------------------------------
# ● update_float_text
#--------------------------------------------------------------------------            
def update_float_text
     return unless ENABLE_FLOAT_TEXT_ANIMATION
     @text_float_time += 1
     case @text_float_time
        when 1..10
           @text_float_y += 1
        when 11..20
           @text_float_y -= 1
        else
          @text_float_y = 0
          @text_float_time = 0
     end
     @text_sprite.y = @text_fy + @text_float_y
end

#--------------------------------------------------------------------------
# ● Update Bar Flow
#--------------------------------------------------------------------------            
def update_bar_flow
     @bar_sprite.bitmap.clear
     @bar_width = @bar_range  * @load_duration / @load_duration_max
     @bar_width = @bar_range if @load_duration > @load_duration_max
     @bar_src_rect = Rect.new(@bar_flow, 0,@bar_width, @bar_height)
     @bar_bitmap.blt(0,0, @bar_image, @bar_src_rect)
     @bar_flow += LOAD_BAR_FLOW_SPEED
     if @bar_flow >= @bar_image.width - @bar_range
        @bar_flow = 0     
     end
end   
   
#--------------------------------------------------------------------------
# ● Update Bar Duration
#--------------------------------------------------------------------------              
def update_bar_duration
     @load_duration += 1
     if @load_duration == @load_duration_max
        Audio.se_play("Audio/SE/" + LOAD_SE,100,100) rescue nil
     elsif @load_duration == @load_duration_max + 10
        if @bar_type == 0
            SceneManager.return
            $game_system.replay_bgm
         else   
            SceneManager.return   
        end  
        $game_temp.loadbar_type = false
     end
end  

end

#=============================================================================
# ■ Scene Save
#=============================================================================
class Scene_Save < Scene_File
  
#--------------------------------------------------------------------------
# ● On Save Sucess
#--------------------------------------------------------------------------               
  alias mog_advloadbar_on_save_success on_save_success
  def on_save_success
      mog_advloadbar_on_save_success
      $game_temp.loadbar_type = 1
      SceneManager.call(Scene_Load_Bar)   
  end
  
end

#=============================================================================
# ■ Scene Load
#=============================================================================
class Scene_Load < Scene_File
  
  #--------------------------------------------------------------------------
  # ● On Load Success
  #--------------------------------------------------------------------------
  alias mog_advloadbar_on_load_success on_load_success
  def on_load_success
      mog_advloadbar_on_load_success
      $game_system.save_bgm      
      RPG::BGM.stop
      $game_temp.loadbar_type = 0
      SceneManager.call(Scene_Load_Bar)              
  end
end

$mog_rgss3_advanced_load_bar = true[/pre]


我是才接触RMVA这样软件的新人,为什么这个脚本使用一次后再呼出的时候就会显示
【脚本“Game_Interpreter"第1411行发生 TypeError。
false can't be coerced into Fixunm “】
我自己摸索了半天 也实在喜欢这个脚本 所以来发帖请教各位大神 帮帮忙看看是不是不能用呀

点评

都会用折叠了,干嘛不用代码框?就是这个<>  发表于 2014-8-26 21:39
梦石
0
星屑
50
在线时间
203 小时
注册时间
2014-8-18
回帖
5
 楼主| 发表于 2014-8-26 21:50:52 | 显示全部楼层
不好意思,第一次发~ - -!
回复

使用道具 举报

梦石
1
星屑
23246
在线时间
9564 小时
注册时间
2012-6-19
回帖
7018

开拓者短篇九导演组冠军

发表于 2014-8-26 22:10:48 | 显示全部楼层
这个脚本不是来自A站的………………

请试试看原版的脚本会不会出现这个错误:

http://www.atelier-rgss.com/RGSS/Menu/ACE_Menu06.html

点评

这不就是A站吗2333  发表于 2014-8-27 06:58
原版范例在读取存档的时候演示了啊  发表于 2014-8-26 23:58
唔……原版范例我下了,它脚本设置里有这个脚本,但工程范例却没有演示这个脚本。大概是不能用吧。谢谢你 ^_^ , 不知道有能用的类似的过场加载否  发表于 2014-8-26 23:22
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部