设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2125|回复: 4
打印 上一主题 下一主题

[已经解决] 关于加强版对话框脚本头像不能显示的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
162 小时
注册时间
2010-7-19
帖子
205
跳转到指定楼层
1
发表于 2010-8-12 20:07:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 蓝泪红霜 于 2010-8-12 23:19 编辑

不知道怎么回事,我用了AVG华丽版1.6的脚本后头像即使放在picuters/Face里面也显示不出来,而且总是显示269行的$face.dispose错误。
如果哪位知道原因请告诉我!
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================


  4. #——说明

  5. #默认为一个字一个字的方式,如果需要不跳
  6. #请在游戏中使用脚本:$game_system.typing = false
  7.      
  8. #默认对话字没有声音,如果需要声音,
  9. #请在游戏中使用脚本:$game_system.soundname_on_speak = "这里输入文件名"
  10. #我唯一一个见过“胡乱配音”的游戏是天使帝国2代,该游戏说话的时候每个字符随机发一个外星语音

  11. # 其他在对话中可以使用的功能:

  12. # \n[1]:显示1号角色的姓名

  13. # \name[李逍遥]:显示一个“李逍遥”方框,表示说话人姓名

  14. # \p[1]:对话框出现在1号事件的上方
  15. # \p[0]:主人公上方出现对话框
  16. #——————————————————使用\p功能后可以自动调整对话框大小

  17. # \\:显示"\"这个符号

  18. # \c[1-8]:更改颜色

  19. # \g:显示金钱窗口

  20. # \a[SE文件名]:对话的时候播放SE

  21. # \s[1-19]:更改弹字的速度

  22. # \.   :停顿一刹那(1、2帧)
  23. # \|   :停顿片刻(20帧)

  24. # \>   :文字不用打字方式
  25. # \<   :文字使用打字方式

  26. # \!   :等待玩家按回车再继续
  27. # \~   :文字直接消失

  28. # \I   :下一行从这个位置开始

  29. # \o[123]:文字透明度改为123,模拟将死之人(汗)

  30. # \h[12]:改用12号字

  31. # \b[50]:空50象素

  32. # \K[今天天气不错]:在出现“今天天气不错”这几个字的时候播放$game_system.soundname_on_speak设置的音效

  33. # \L[001]:在左边显示图片“Graphics/battlers/66rpg_001_h.png”
  34. # \R[001]:在右边显示图片“Graphics/battlers/66rpg_001_h.png”

  35. # \Lk:清除左边的图像
  36. # \Rk:清除右边的图像
  37. # \M[60]:等待60帧文字直接消失

  38. #脚本冲突可能:
  39. #不用说了。因为改了分辨率所有原有窗口需要自己定义,基本上可以算是和所有脚本冲突。

  40. #============================
  41. class Game_System
  42. attr_accessor :typing
  43. attr_accessor :soundname_on_speak
  44. alias carol3_ini initialize
  45. def initialize
  46.    carol3_ini
  47.    @typing = true
  48.    @soundname_on_speak = nil
  49. end
  50. end
  51. #=================================
  52. #==============================================================================
  53. # ■ Window_Message
  54. #------------------------------------------------------------------------------
  55. class Window_Message < Window_Selectable
  56.   $color0 = 255
  57.   $color1 = 255
  58.   $color2 = 255
  59. #--------------------------------------------------------------------------
  60. # ● 初始化状态
  61. #--------------------------------------------------------------------------
  62. def initialize

  63.    super(80, 304, 480, 160)
  64.    self.contents = Bitmap.new(width - 32, height - 32)
  65.    self.visible = false
  66.    self.z = 9998
  67.    @fade_in = false
  68.    @fade_out = false
  69.    @contents_showing = false
  70.    @cursor_width = 0
  71.    @autoclosetime = -1
  72.    self.active = false
  73.    self.index = -1
  74.    if $game_system.soundname_on_speak == nil then
  75.      $game_system.soundname_on_speak = ""
  76.    end
  77.    @opacity_text_buf = Bitmap.new(32, 32)
  78.    #AVG对话框图片背景
  79.     $Mbg = Sprite.new
  80.     $Mbg.bitmap = Bitmap.new("Graphics/Pictures/对话框")
  81.     $Mbg.opacity = 0
  82.     $Mbg.visible = true
  83.     $Mbg.x = 0
  84.     $Mbg.y = 320
  85.     $Mbg.z = 1000
  86.     #小对话框
  87.     $SMbg = Sprite.new
  88.     $SMbg.bitmap = Bitmap.new("Graphics/Pictures/小对话框")
  89.     $SMbg.opacity = 0
  90.     $SMbg.visible = true
  91.     $SMbg.x = 180
  92.     $SMbg.y = 150
  93.     $SMbg.z = 1000
  94.    
  95. end
  96. #--------------------------------------------------------------------------
  97. # ● 释放
  98. #--------------------------------------------------------------------------
  99. def dispose
  100.    terminate_message
  101.    $game_temp.message_window_showing = false
  102.    if @input_number_window != nil
  103.      @input_number_window.dispose
  104.    end
  105.    super
  106. end
  107. #--------------------------------------------------------------------------
  108. # ● 处理信息结束
  109. #--------------------------------------------------------------------------
  110. def terminate_message
  111.    self.active = false
  112.    self.pause = false
  113.    self.index = -1
  114.    self.contents.clear
  115.    #对话完毕小对话框清除
  116.    $SMbg.opacity = 0
  117.    
  118.    # 清除显示中标志
  119.    @contents_showing = false
  120.    # 呼叫信息调用
  121.    if $game_temp.message_proc != nil
  122.      $game_temp.message_proc.call
  123.    end
  124.    # 清除文章、选择项、输入数值的相关变量
  125.    $game_temp.message_text = nil
  126.    $game_temp.message_proc = nil
  127.    $game_temp.choice_start = 99
  128.    $game_temp.choice_max = 0
  129.    $game_temp.choice_cancel_type = 0
  130.    $game_temp.choice_proc = nil
  131.    $game_temp.num_input_start = 99
  132.    $game_temp.num_input_variable_id = 0
  133.    $game_temp.num_input_digits_max = 0
  134.    # 开放金钱窗口
  135.    if @gold_window != nil
  136.      @gold_window.dispose
  137.      @gold_window = nil
  138.    end
  139.    if @name_window_frame != nil
  140.      @name_window_frame.dispose
  141.      @name_window_frame = nil
  142.    end
  143.    if @name_window_text != nil
  144.      @name_window_text.dispose
  145.      @name_window_text = nil
  146.    end
  147.    if @right_picture != nil and @right_keep == true
  148.      @right_picture.dispose
  149.    end   
  150.    if @left_picture != nil and @left_keep == true
  151.      @left_picture.dispose
  152.    end
  153.    
  154. end
  155. def refresh
  156.    # 初期化
  157.    $game_system.typing = true
  158.    unless $game_switches[23] == true#AVG看结局时
  159.    if Input.press?(Input::CTRL)
  160.        $game_system.typing = false
  161.      else
  162.          $game_system.typing = true
  163.       
  164.        end
  165.     end

  166.    self.contents.clear
  167.    self.contents.font.color = normal_color
  168.    self.contents.font.size = Font.default_size
  169.    @x = @y = @max_x = @max_y = @indent = @lines = 0
  170.    @left_keep = @right_keep = false
  171.    @face_indent = 0
  172.    @opacity = 255
  173.    @cursor_width = 0
  174.    @autoclosetime = -1
  175.    #AVG弹字速度调节
  176.    @write_speed = $game_variables[44]
  177.    #@write_speed = 2
  178.    #========================
  179.    @write_wait = 0
  180.    @mid_stop = false
  181.    @popchar = -2
  182.    if $face != nil
  183.      $face.dispose if $face_file == nil
  184.      $face = nil if $face_file == nil
  185.    end
  186.    if $game_temp.choice_start == 0
  187.      @x = 8
  188.    end
  189.    if $game_temp.message_text != nil
  190.       @now_text = $game_temp.message_text
  191.       backlog = @now_text.clone
  192.       temp = backlog.split(/\n/)
  193.       temp.delete("")
  194.       backlog = ""
  195.       for i in 0...temp.size
  196.         backlog += temp[i]
  197.         backlog += "\n"
  198.       end
  199.       $backlog_line = temp.size
  200.       $game_system.backlog_line += backlog.split(/\n/).size
  201.       $game_system.backlog.push(backlog)
  202.       #AVG24开关为禁示对话框图片
  203.       if $game_switches[24] == true
  204.         $Mbg.opacity = 0
  205.         if $game_switches[3] == true#小对话框
  206.           $SMbg.opacity = 200
  207.           end
  208.         else
  209.           $SMbg.opacity = 0
  210.       $Mbg.opacity = 200
  211.       $Mbg.visible = true if $Mbg.visible == false
  212.     end
  213.     @facename = $game_temp.message_text.split(":")[0] if $game_temp.message_text.split(":")[1] != nil
  214.      #——头像设置
  215.      #AVG20左,21右开关为头像开关
  216.      if  $game_switches[20] == true
  217.      begin
  218.          
  219.           if @facename != ""
  220.           if $face_file == nil
  221.             #AVG设了头像号码~不为零就用编号的头像
  222.             if $facen != nil
  223.               @face_file = @facename + "_左" + "#{$facen}"
  224.               else
  225.           @face_file = @facename + "_左"  
  226.           end
  227.           $face = Sprite.new
  228.          $face.bitmap = Bitmap.new("Graphics/Pictures/Face/#{@face_file}")
  229.          $face.opacity = 255
  230.          $face.visible = true
  231.          $face.x = 20
  232.          $face.y = 470 - $face.bitmap.height
  233.           $face.z = 2000
  234.           $face_file = true
  235.           #图正常清NIL
  236.           @facename = nil
  237.           end
  238.          else
  239.           if $face != nil
  240.          $facen = nil
  241.         $face_file = nil
  242.         $face = nil
  243.          $face.dispose
  244.          end
  245.       end
  246.     rescue
  247.       begin
  248.         if $face_file == nil
  249.       if $facen != nil
  250.               @face_file = @facename + "#{$facen}"
  251.               else
  252.           @face_file = @facename
  253.           end
  254.           $face = Sprite.new
  255.          $face.bitmap = Bitmap.new("Graphics/Pictures/Face/#{@face_file}")
  256.          $face.opacity = 255
  257.          $face.visible = true
  258.          $face.x = 20
  259.          $face.y = 470 - $face.bitmap.height
  260.           $face.z = 2000
  261.           $face_file = true
  262.             #图正常清NIL
  263.           @facename = nil
  264.           end
  265.         rescue
  266.            if $face != nil
  267.          $facen = nil
  268.         $face_file = nil
  269.         $face = nil
  270.          $face.dispose
  271.          end
  272.         end
  273.         end
  274.       end

  275.          if  $game_switches[21] == true
  276.      begin
  277.         @facename = $game_temp.message_text.split(":")[0] if $game_temp.message_text.split(":")[1] != nil
  278.         if @facename != ""
  279.           if $face_file == nil
  280.           if $facen != nil
  281.               @face_file = @facename + "_右" + "#{$facen}"
  282.               else
  283.           @face_file = @facename + "_右"  
  284.           end
  285.           $face = Sprite.new
  286.          $face.bitmap = Bitmap.new("Graphics/Pictures/Face/#{@face_file}")
  287.          $face.opacity = 255
  288.          $face.x = 630 - $face.bitmap.width
  289.          $face.y = 470 - $face.bitmap.height
  290.           $face.z = 2000
  291.           $face_file = true
  292.             #图正常清NIL
  293.           @facename = nil
  294.           end
  295.           else
  296.           if $face != nil
  297.          $facen = nil
  298.         $face_file = nil
  299.         $face = nil
  300.          $face.dispose
  301.          end
  302.       end
  303.     rescue
  304.       begin
  305.         if $face_file == nil
  306.        if $facen != nil
  307.               @face_file = @facename + "#{$facen}"
  308.               else
  309.           @face_file = @facename
  310.           end
  311.           $face = Sprite.new
  312.          $face.bitmap = Bitmap.new("Graphics/Pictures/Face/#{@face_file}")
  313.          $face.opacity = 255
  314.          $face.x = 630 - $face.bitmap.width
  315.          $face.y = 470 - $face.bitmap.height
  316.           $face.z = 2000
  317.           $face_file = true
  318.          
  319.            #图正常清NIL
  320.           @facename = nil
  321.           end
  322.         rescue
  323.            if $face != nil
  324.          $facen = nil
  325.         $face_file = nil
  326.         $face = nil
  327.          $face.dispose
  328.          end
  329.         
  330.           end
  331.         end
  332.       end
  333.     if  $game_switches[20] == false and $game_switches[21] == false
  334.         #如果开关没开?头像关掉
  335.         if $face != nil
  336.          $facen = nil
  337.         $face_file = nil
  338.         $face.dispose
  339.         $face = nil
  340.         end
  341.     end
  342.      #——左半身像设置
  343.      if (/\\[Ll]\[(.+?)\]/.match(@now_text))!=nil then
  344.        @face = "66rpg_" + $1 + "_h.png"
  345.        if $加密 == true
  346.          if @left_picture != nil
  347.            @left_picture.dispose
  348.          end
  349.          @left_picture = Sprite.new
  350.          @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  351.          @left_picture.y = 480-@left_picture.bitmap.height
  352.          @left_picture.x = 0
  353.          @left_picture.mirror = true
  354.          @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  355.        else         
  356.          if FileTest.exist?("Graphics/battlers/#{@face}")
  357.            if @left_picture != nil
  358.              @left_picture.dispose
  359.            end
  360.            @left_picture = Sprite.new
  361.            @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  362.            @left_picture.y = 480-@left_picture.bitmap.height
  363.            @left_picture.x = 0
  364.            @left_picture.mirror = true
  365.            @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  366.          end
  367.        end        
  368.      end
  369.      #——右半身像设置
  370.      if (/\\[Rr]\[(.+?)\]/.match(@now_text))!=nil then
  371.        @face = "66rpg_" + $1 + "_h.png"
  372.        if $加密 == true
  373.          if @right_picture != nil
  374.            @right_picture.dispose
  375.          end
  376.          @right_picture = Sprite.new
  377.          @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  378.          @right_picture.y = 480-@right_picture.bitmap.height
  379.          @right_picture.x = 640-@right_picture.bitmap.width
  380.          @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  381.        else
  382.          if FileTest.exist?("Graphics/battlers/#{@face}")
  383.            if @right_picture != nil
  384.              @right_picture.dispose
  385.            end
  386.            @right_picture = Sprite.new
  387.            @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  388.            @right_picture.y = 480-@right_picture.bitmap.height
  389.            @right_picture.x = 640-@right_picture.bitmap.width
  390.            @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  391.          end
  392.        end
  393.      end
  394.      if (/\\[Rr]k/.match(@now_text)) != nil
  395.        @right_keep = true
  396.        @now_text.sub!(/\\[Rr]k/) { "" }
  397.      end
  398.      if (/\\[Ll]k/.match(@now_text)) != nil
  399.        @left_keep = true
  400.        @now_text.sub!(/\\[Ll]k/) { "" }
  401.      end
  402.      # 显示人物姓名
  403.      name_window_set = false
  404.      if (/\\[Nn]ame\[(.+?)\]/.match(@now_text)) != nil
  405.        name_window_set = true
  406.        name_text = $1
  407.        @now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
  408.      end
  409.      
  410.      # 文字位置的判定
  411.      if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then
  412.        @popchar = $1.to_i
  413.        if @popchar == -1
  414.          @x = @indent = 48
  415.          @y = 4
  416.        end
  417.        @now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }
  418.      end
  419.      
  420.      # 开始
  421.      begin
  422.        last_text = @now_text.clone
  423.        @now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
  424.     @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) { "#{$game_actors[$1.to_i].name.to_s}" }

  425.        end  
  426.    
  427.    @now_text.gsub!(/\\\\/) { "\000" }
  428.    @now_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  429.    @now_text.gsub!(/\\[Gg]/) { "\002" }
  430.    @now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" }
  431.    @now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" }
  432.    @now_text.gsub!(/\\[.]/) { "\005" }
  433.    @now_text.gsub!(/\\[|]/) { "\006" }
  434.    @now_text.gsub!(/\\[Mm]\[([0-9]+)\]/) { "\050[#{$1}]" }
  435.    
  436.    @now_text.gsub!(/\\[>]/) { "\016" }
  437.    @now_text.gsub!(/\\[<]/) { "\017" }
  438.    @now_text.gsub!(/\\[!]/) { "\020" }
  439.    @now_text.gsub!(/\\[~]/) { "\021" }
  440.    
  441.    @now_text.gsub!(/\\[Ii]/) { "\023" }
  442.    @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
  443.    @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
  444.    @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
  445.    @now_text.gsub!(/\\[Kk]\[(.*?)\]/) { "\027[#{$1}]" }
  446.    if @popchar >= 0
  447.      @text_save = @now_text.clone
  448.      @max_x = 0
  449.      @max_y = 4
  450.      for i in 0..3
  451.        line = @now_text.split(/\n/)[3-i]
  452.        @max_y -= 1 if line == nil and @max_y <= 4-i
  453.        next if line == nil
  454.        cx = contents.text_size(line).width
  455.        @max_x = cx if cx > @max_x
  456.      end
  457.      self.width = @max_x + 48 + @face_indent
  458.      self.height = (@max_y - 1) * 32 + 64
  459.    else
  460.      @max_x = self.width - 32 - @face_indent
  461.    end
  462.    reset_window
  463.      if name_window_set
  464.        off_x = 0
  465.        off_y = -40
  466.        space = 2
  467.        x = self.x + off_x - space / 2
  468.        y = self.y + off_y - space / 2
  469.        w = self.contents.text_size(name_text).width + 26 + space
  470.        h = 40 + space
  471.        @name_window_frame = Window_Frame.new(x, y, w, h)
  472.        @name_window_frame.z = self.z + 1
  473.        x = self.x + off_x + 4
  474.        y = self.y + off_y
  475.        @name_window_text = Air_Text.new(x+4, y+6, name_text)
  476.        @name_window_text.z = self.z + 2
  477.      end
  478.    end
  479.    reset_window
  480.    if $game_temp.choice_max > 0
  481.      @item_max = $game_temp.choice_max
  482.      self.active = true
  483.      self.index = 0
  484.    end
  485.    if $game_temp.num_input_variable_id > 0
  486.      digits_max = $game_temp.num_input_digits_max
  487.      number = $game_variables[$game_temp.num_input_variable_id]
  488.      @input_number_window = Window_InputNumber.new(digits_max)
  489.      @input_number_window.number = number
  490.      @input_number_window.x = self.x + 8
  491.      @input_number_window.y = self.y + $game_temp.num_input_start * 32
  492.    end
  493. end
  494. #--------------------------------------------------------------------------
  495. # ● 更新
  496. #--------------------------------------------------------------------------
  497. def update
  498.    super
  499.    self.contents.font.color = Color.new($color0, $color1, $color2)
  500.    if @autoclosetime == 0
  501.      @autoclosetime = -1
  502.      terminate_message
  503.   end
  504.    if @autoclosetime >= 1
  505.      @autoclosetime -= 1
  506.    end
  507.    if @fade_in
  508.      self.contents_opacity += 24
  509.      if @input_number_window != nil
  510.        @input_number_window.contents_opacity += 24
  511.      end
  512.      if self.contents_opacity == 255
  513.        @fade_in = false
  514.      end
  515.      return
  516.    end
  517.    @now_text = nil if @now_text == ""
  518.    
  519.    if @now_text != nil and @mid_stop == false
  520.      if @write_wait > 0
  521.        @write_wait -= 1
  522.        return
  523.      end
  524.      text_not_skip = $game_system.typing
  525.      while true
  526.        @max_x = @x if @max_x < @x
  527.        @max_y = @y if @max_y < @y
  528.        if (c = @now_text.slice!(/./m)) != nil
  529.          
  530.          if c == "\000"
  531.            c = "\\"
  532.          end
  533.          if c == "\001"
  534.            @now_text.sub!(/\[([0-9]+)\]/, "")
  535.            color = $1.to_i
  536.            if color >= 0 and color <= 7
  537.              self.contents.font.color = text_color(color)
  538.            end
  539.            c = ""
  540.          end
  541.          if c == "\002"
  542.            if @gold_window == nil and @popchar <= 0
  543.              @gold_window = Window_Gold.new
  544.              @gold_window.x = 560 - @gold_window.width
  545.              if $game_temp.in_battle
  546.                @gold_window.y = 192
  547.              else
  548.                @gold_window.y = self.y >= 128 ? 32 : 384
  549.              end
  550.              @gold_window.opacity = self.opacity
  551.              @gold_window.back_opacity = self.back_opacity
  552.            end
  553.            c = ""
  554.          end
  555.          if c == "\003"
  556.            @now_text.sub!(/\[([0-9]+)\]/, "")
  557.            speed = $1.to_i
  558.            if speed >= 0 and speed <= 19
  559.              @write_speed = speed
  560.            end
  561.            c = ""
  562.          end
  563.          if c == "\004"
  564.            @now_text.sub!(/\[(.*?)\]/, "")
  565.            buftxt = $1.dup.to_s
  566.            if buftxt.match(/\//) == nil and buftxt != "" then
  567.              $game_system.soundname_on_speak = "Audio/SE/" + buftxt
  568.            else
  569.              $game_system.soundname_on_speak = buftxt.dup
  570.            end
  571.            c = ""
  572.          elsif c == "\004"
  573.            c = ""
  574.          end
  575.          if c == "\005"
  576.            @write_wait += 5
  577.            c = ""
  578.          end
  579.          if c == "\006"
  580.            @write_wait += 20
  581.            c = ""
  582.          end
  583.          if c == "\016"
  584.            text_not_skip = false
  585.            c = ""
  586.          end
  587.          if c == "\017"
  588.            text_not_skip = true
  589.            c = ""
  590.          end
  591.          if c == "\020"
  592.            @mid_stop = true
  593.            c = ""
  594.          end
  595.          if c == "\021"
  596.            terminate_message
  597.            return
  598.          end
  599.          if c == "\023"
  600.            @indent = @x
  601.            c = ""
  602.          end
  603.          if c == "\024"
  604.            @now_text.sub!(/\[([0-9]+)\]/, "")
  605.            @opacity = $1.to_i
  606.            c = ""
  607.          end
  608.          if c == "\025"
  609.            @now_text.sub!(/\[([0-9]+)\]/, "")
  610.            self.contents.font.size = [[$1.to_i, 6].max, 32].min
  611.            c = ""
  612.          end
  613.          if c == "\026"
  614.            @now_text.sub!(/\[([0-9]+)\]/, "")
  615.            @x += $1.to_i
  616.            c = ""
  617.          end
  618.          if c == "\027"
  619.            @now_text.sub!(/\[(.*?)\]/, "")
  620.            @x += ruby_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), $1, @opacity)
  621.            if $game_system.soundname_on_speak != ""
  622.              Audio.se_play($game_system.soundname_on_speak)
  623.            end
  624.            c = ""
  625.          end
  626.          if c == "\030"
  627.            @now_text.sub!(/\[(.*?)\]/, "")
  628.            self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
  629.           if $game_system.soundname_on_speak != ""
  630.              Audio.se_play($game_system.soundname_on_speak)
  631.            end
  632.            @x += 24
  633.            c = ""
  634.          end
  635.          if c == "\050"

  636.          @now_text.sub!(/\[([0-9]+)\]/, "")

  637.          @autoclosetime = $1.to_i

  638.          next

  639.        end
  640.          if c == "\n"
  641.            if @lines >= $game_temp.choice_start
  642.              @cursor_width = [@cursor_width, @max_x - @face_indent].max
  643.            end
  644.            @lines += 1
  645.            @y += 1
  646.            @x = 0 + @indent + @face_indent
  647.            if @lines >= $game_temp.choice_start
  648.              @x = 8 + @indent + @face_indent
  649.            end
  650.            c = ""
  651.          end
  652.          if c != ""
  653.            # 文字描画
  654.            @x += opacity_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), c, @opacity)
  655.            if $game_system.soundname_on_speak != "" then
  656.            Audio.se_play($game_system.soundname_on_speak)
  657.            end
  658.          end
  659.          if Input.press?(Input::B)
  660.            text_not_skip = false
  661.          end
  662.        else
  663.          text_not_skip = true
  664.          break
  665.        end
  666.        # 終了判定
  667.        if text_not_skip
  668.          break
  669.        end
  670.      end
  671.      if @write_speed != $game_variables[44]
  672.        @write_speed = $game_variables[44]
  673.        end
  674.      @write_wait += @write_speed
  675.      return
  676.    end
  677.    if @input_number_window != nil
  678.      @input_number_window.update
  679.      # 決定
  680.      if Input.trigger?(Input::C)
  681.        $game_system.se_play($data_system.decision_se)
  682.        $game_variables[$game_temp.num_input_variable_id] =
  683.        @input_number_window.number
  684.        $game_map.need_refresh = true
  685.        @input_number_window.dispose
  686.        @input_number_window = nil
  687.        terminate_message
  688.      end
  689.      return
  690.    end
  691.    if @contents_showing
  692.      if $game_temp.choice_max == 0
  693.        self.pause = true
  694.      end
  695.      # 按下CTRL可跳过对话
  696.      unless $game_switches[23] == true#AVG看结局时不能跳
  697.    if  @input_number_window == nil and $game_temp.choice_max == 0
  698.      if Input.press?(Input::CTRL)
  699.        $game_system.typing = false
  700.      terminate_message
  701.      return
  702.      end
  703.    end
  704.    end
  705.      # 取消
  706.      if Input.trigger?(Input::B)
  707.        if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  708.          $game_system.se_play($data_system.cancel_se)
  709.          $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  710.          terminate_message
  711.        end
  712.      end
  713.      # 決定
  714.      if Input.trigger?(Input::C)
  715.        if $game_temp.choice_max > 0
  716.          $game_system.se_play($data_system.decision_se)
  717.          $game_temp.choice_proc.call(self.index)
  718.        end
  719.        if @mid_stop
  720.          @mid_stop = false
  721.          return
  722.        else
  723.          terminate_message
  724.        end
  725.      end
  726.      return
  727.    end
  728.    if @fade_out == false and $game_temp.message_text != nil
  729.      @contents_showing = true
  730.      $game_temp.message_window_showing = true
  731.      refresh
  732.      Graphics.frame_reset
  733.      self.visible = true
  734.      self.contents_opacity = 0
  735.    if @input_number_window != nil
  736.      @input_number_window.contents_opacity = 0
  737.    end
  738.      @fade_in = true
  739.      return
  740.    end
  741.    if self.visible
  742.      @fade_out = true
  743.      self.opacity -= 48
  744.      if self.opacity == 0
  745.        self.visible = false
  746.        @fade_out = false
  747.        $game_temp.message_window_showing = false
  748.      end
  749.      return
  750.    end
  751. end
  752. #--------------------------------------------------------------------------
  753. # ● 获得字符
  754. #--------------------------------------------------------------------------
  755. def get_character(parameter)
  756.    case parameter
  757.    when 0
  758.      return $game_player
  759.    else
  760.      events = $game_map.events
  761.      return events == nil ? nil : events[parameter]
  762.    end
  763. end
  764. #--------------------------------------------------------------------------
  765. # ● ウィンドウの位置と不透明度の設定
  766. #--------------------------------------------------------------------------
  767. def reset_window
  768.    # 判定
  769.    if @popchar >= 0
  770.      events = $game_map.events
  771.      if events != nil
  772.        character = get_character(@popchar)
  773.        x = [[character.screen_x - 0 - self.width / 2, 4].max, 636 - self.width].min
  774.        y = [[character.screen_y - 48 - self.height, 4].max, 476 - self.height].min
  775.        self.x = x
  776.        self.y = y
  777.      end
  778.    elsif @popchar == -1
  779.      self.x = -4
  780.      self.y = -4
  781.      self.width = 648
  782.      self.height = 488
  783.    else
  784.      if $game_temp.in_battle
  785.        self.y = 16
  786.      else
  787.        case $game_system.message_position
  788.        when 0 # 上
  789.          self.y = 16
  790.        when 1 # 中
  791.          self.y = 160
  792.        when 2 # 下
  793.          self.y = 330
  794.        end
  795.        #self.x = 80
  796.        #if $face_file == nil
  797.         # self.width = 480
  798.        #else
  799.          #self.width = 600
  800.          #self.x -= 60
  801.        #end
  802.        #AVG
  803.        self.width = 470

  804.        if $game_switches[3] == true#小对话框
  805.           self.width = 230
  806.           end
  807.       self.x = 100
  808.        self.height = 160

  809.      #AVG
  810.      if  $game_switches[20] == true
  811.        if $face != nil
  812.          begin
  813.        self.x = $face.bitmap.width + 20
  814.         rescue
  815.           end
  816.        end
  817.      end
  818.      if $game_variables[80] != 0
  819.       self.x = $game_variables[80]
  820.     end
  821.     if $game_variables[81] != 0
  822.       self.y = $game_variables[81]
  823.     end
  824.     end
  825.    end
  826.    self.contents = Bitmap.new(self.width - 32, self.height - 32)
  827.    
  828.    if @popchar == -1
  829.      self.opacity = 255
  830.      self.back_opacity = 0
  831.    elsif $game_system.message_frame == 0
  832.      self.opacity = 255
  833.      self.back_opacity = 100
  834.    else
  835.      self.opacity = 0
  836.      self.back_opacity = 100
  837.    end
  838.    
  839. end
  840. #--------------------------------------------------------------------------
  841. # ● line_height
  842. #--------------------------------------------------------------------------
  843. # 返回値:行高
  844. #--------------------------------------------------------------------------
  845. def line_height
  846.    return 28
  847.    if self.contents.font.size >= 20 and self.contents.font.size <= 24
  848.      return 28
  849.    else
  850.      return self.contents.font.size * 15 / 10
  851.    end
  852. end
  853. #--------------------------------------------------------------------------
  854. # ● 透過文字描画
  855. #--------------------------------------------------------------------------
  856. # target :描画対象。Bitmapクラスを指定。
  857. # x :x座標
  858. # y :y座標
  859. # str  :描画文字列
  860. # opacity:透過率(0~255)
  861. # 返回値 :文字幅(@x増加値)。
  862. #--------------------------------------------------------------------------
  863. def opacity_draw_text(target, x, y, str,opacity)
  864.    height = target.font.size
  865.    width = target.text_size(str).width
  866.    opacity = [[opacity, 0].max, 255].min
  867.    if opacity == 255
  868.      target.draw_text(x, y, width, height, str)
  869.      return width
  870.    else
  871.      if @opacity_text_buf.width < width or @opacity_text_buf.height < height
  872.        @opacity_text_buf.dispose
  873.        @opacity_text_buf = Bitmap.new(width, height)
  874.      else
  875.        @opacity_text_buf.clear
  876.      end
  877.      @opacity_text_buf.font.size = target.font.size
  878.      @opacity_text_buf.draw_text(0, 0, width, height, str)
  879.      target.blt(x, y, @opacity_text_buf, Rect.new(0, 0, width, height), opacity)
  880.    return width
  881.    end
  882. end
  883. def ruby_draw_text(target, x, y, str,opacity)
  884.    sizeback = target.font.size
  885.    target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2
  886.    rubysize = [rubysize, 6].max
  887.    
  888.    opacity = [[opacity, 0].max, 255].min
  889.    split_s = str.split(/,/)
  890.    
  891.    split_s[0] == nil ? split_s[0] = "" : nil
  892.    split_s[1] == nil ? split_s[1] = "" : nil
  893.    
  894.    height = sizeback + rubysize
  895.    width = target.text_size(split_s[0]).width
  896.    
  897.    target.font.size = rubysize
  898.    ruby_width = target.text_size(split_s[1]).width
  899.    target.font.size = sizeback
  900.    
  901.    buf_width = [target.text_size(split_s[0]).width, ruby_width].max
  902.    
  903.    width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0
  904.    
  905.    if opacity == 255
  906.      target.font.size = rubysize
  907.      target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1])
  908.      target.font.size = sizeback
  909.      target.draw_text(x, y, width, target.font.size, split_s[0])
  910.      return width
  911.    else
  912.      if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height
  913.        @opacity_text_buf.dispose
  914.        @opacity_text_buf = Bitmap.new(buf_width, height)
  915.      else
  916.        @opacity_text_buf.clear
  917.      end
  918.      @opacity_text_buf.font.size = rubysize
  919.      @opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1)
  920.      @opacity_text_buf.font.size = sizeback
  921.      @opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1)
  922.      if sub_x >= 0
  923.        target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  924.      else
  925.        target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  926.      end
  927.      return width
  928.    end
  929. end
  930. #--------------------------------------------------------------------------
  931. # ● \V 变换
  932. #--------------------------------------------------------------------------
  933. def convart_value(option, index)
  934.    option == nil ? option = "" : nil
  935.    option.downcase!
  936.    case option
  937.      when "i"
  938.        unless $data_items[index].name == nil
  939.          r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
  940.        end
  941.      when "w"
  942.        unless $data_weapons[index].name == nil
  943.          r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
  944.        end
  945.      when "a"
  946.        unless $data_armors[index].name == nil
  947.          r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
  948.        end
  949.      when "s"
  950.        unless $data_skills[index].name == nil
  951.          r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
  952.        end
  953.      else
  954.      r = $game_variables[index]
  955.    end
  956.    r == nil ? r = "" : nil
  957.    return r
  958. end
  959. #--------------------------------------------------------------------------
  960. # ● 解放
  961. #--------------------------------------------------------------------------
  962. def dispose
  963.    terminate_message
  964.    if @gaiji_cache != nil
  965.      unless @gaiji_cache.disposed?
  966.        @gaiji_cache.dispose
  967.      end
  968.    end
  969.    unless @opacity_text_buf.disposed?
  970.      @opacity_text_buf.dispose
  971.    end
  972.    $game_temp.message_window_showing = false
  973.    if @input_number_window != nil
  974.      @input_number_window.dispose
  975.    end
  976.    super
  977. end
  978. #--------------------------------------------------------------------------
  979. # ● 矩形更新
  980. #--------------------------------------------------------------------------
  981. def update_cursor_rect
  982.    if @index >= 0
  983.      n = $game_temp.choice_start + @index
  984.      self.cursor_rect.set(4 + @indent + @face_indent, n * 28 + 4, @cursor_width, 28)
  985.    else
  986.      self.cursor_rect.empty
  987.    end
  988. end
  989. end
  990. #==============================================================================
  991. # ■ Window_Frame (枠だけで中身の無いウィンドウ)
  992. #==============================================================================
  993. class Window_Frame < Window_Base
  994. #--------------------------------------------------------------------------
  995. # ● オブジェクト初期化
  996. #--------------------------------------------------------------------------
  997. def initialize(x, y, width, height)
  998.    super(x, y, width, height)
  999.    self.contents = nil
  1000.    self.back_opacity = 100
  1001. end
  1002. #--------------------------------------------------------------------------
  1003. # ● 解放
  1004. #--------------------------------------------------------------------------
  1005. def dispose
  1006.    super
  1007.    end
  1008. end
  1009. #==============================================================================
  1010. # ■ Air_Text (何も無いところに文字描写 = 枠の無い瞬間表示メッセージウィンドウ)
  1011. #==============================================================================
  1012. class Air_Text < Window_Base
  1013. #--------------------------------------------------------------------------
  1014. # ● オブジェクト初期化
  1015. #--------------------------------------------------------------------------
  1016. def initialize(x, y, designate_text)
  1017.    super(x-16, y-16, 32 + designate_text.size * 12, 56)
  1018.    self.opacity = 0
  1019.    self.back_opacity = 0
  1020.    self.contents = Bitmap.new(self.width - 32, self.height - 32)
  1021.    w = self.contents.width
  1022.    h = self.contents.height
  1023.    self.contents.draw_text(0, 0, w, h, designate_text)
  1024. end
  1025. #--------------------------------------------------------------------------
  1026. # ● 解放
  1027. #--------------------------------------------------------------------------
  1028. def dispose
  1029.    self.contents.clear
  1030.    super
  1031. end
  1032. end



  1033. #==============================================================================
  1034. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  1035. #==============================================================================
复制代码
纤尘镜大整改,全游戏重置中

Lv1.梦旅人

梦石
0
星屑
50
在线时间
29 小时
注册时间
2010-7-5
帖子
483
2
发表于 2010-8-12 20:49:11 | 只看该作者
那你就把AVG华丽丽放一边先呗。。。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
162 小时
注册时间
2010-7-19
帖子
205
3
 楼主| 发表于 2010-8-12 20:55:14 | 只看该作者
可是游戏已经做了一半了,部分的脚本设置不能变动,只是不知道有没有办法恢复头像的使用……
纤尘镜大整改,全游戏重置中
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
73 小时
注册时间
2010-6-26
帖子
279
4
发表于 2010-8-12 22:54:02 | 只看该作者
我用的不是这个脚本~~~你要的话可以加我Q849797000我发给你
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
162 小时
注册时间
2010-7-19
帖子
205
5
 楼主| 发表于 2010-8-12 23:19:32 | 只看该作者
感谢你们的帮忙 虽然没找到问题的所在,但是终于能显示头像了……
纤尘镜大整改,全游戏重置中
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-1 21:33

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表