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

Project1

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

[已经解决] 66加强对话跟随人物的修改

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
54
在线时间
36 小时
注册时间
2006-6-13
帖子
237
跳转到指定楼层
1
发表于 2009-8-19 17:29:16 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 cfancy 于 2009-9-8 22:30 编辑

关于66加强与FUKI整合+附送的脚本
在FUKI中对话内容可以跟随人物移动,可是66加强却是固定的,麻烦懂脚本的帮我修改一下,让66加强对话也可以跟随人物移动~~~
话说前几天看到类似的帖子,无奈找了半天也找不到~~~先谢谢了
那啥~~~是不是代码太长帖不出来?!



问题解决
请看http://rpg.blue/viewthread.php?tid=132748&extra=page%3D1
目前任务:学习
目前进度:没有
最新说明:MUD嘛~~自由度~

原来泥巴更容易挖坑

Lv1.梦旅人

梦石
0
星屑
54
在线时间
36 小时
注册时间
2006-6-13
帖子
237
2
 楼主| 发表于 2009-8-21 00:47:52 | 只看该作者
本帖最后由 cfancy 于 2009-8-22 11:51 编辑

上面整合的对话脚本可能太乱了(应该是这个问题所以没人回答吧= =b)~~~
下面这个真对话的脚本我已经改了一半了,对话内容已经可以跟随人物移动了,
但名字框还不会改,~~~高手帮帮忙!
[localimg=180,121]3[/localimg]
我想要实现的效果就是:
对人物事件设置\name[李逍遥]\p[1]今天天气真好。
在他说这句话的同时人物向左走动。同时对话内容和名字框也显示在人物上面同时向左移动。
脚本中用到的两张图片[localimg=32,32]1[/localimg][localimg=32,32]2[/localimg]
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. #——说明

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

  11. # 其他在对话中可以使用的功能:
  12.   
  13. # \n[1]:显示1号角色的姓名

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

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

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

  19. # \v[1] :显示变量1

  20. # \v[a1] :显示防具1

  21. # \v[w1] :显示武器1

  22. # \v[i1] :显示物品1

  23. # \v[s1] :显示特技1

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

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

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

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

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

  30. # \>   :文字不用打字方式
  31. # \<   :文字使用打字方式

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

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

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

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

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

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

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

  41. # \Lk:清除左边的图像
  42. # \Rk:清除右边的图像

  43. #==============================================================================
  44. # ■ Game_System
  45. #------------------------------------------------------------------------------
  46. #  处理系统附属数据的类。也可执行诸如 BGM 管理之类的功能。本类的实例请参考
  47. # $game_system 。
  48. #==============================================================================

  49. class Game_System
  50.   attr_accessor :typing
  51.   attr_accessor :soundname_on_speak
  52.   alias carol3_ini initialize
  53.   def initialize
  54.     carol3_ini
  55.     @typing = true
  56.     @soundname_on_speak = nil
  57.   end
  58. end
  59. $加密 = true
  60. #==============================================================================
  61. # ■ Window_Message
  62. #------------------------------------------------------------------------------
  63. class Window_Message < Window_Selectable
  64.   #--------------------------------------------------------------------------
  65.   # ● 初始化状态
  66.   #--------------------------------------------------------------------------
  67.   def initialize
  68.     super(80, 304, 480, 160)
  69.     self.contents = Bitmap.new(width - 32, height - 32)
  70.     self.visible = false
  71.     self.z = 9998
  72.     @fade_in = false
  73.     @fade_out = false
  74.     @contents_showing = false
  75.     @cursor_width = 0
  76.     self.active = false
  77.     self.index = -1
  78.     if $game_system.soundname_on_speak == nil then
  79.       $game_system.soundname_on_speak = ""
  80.     end
  81.     @opacity_text_buf = Bitmap.new(32, 32)
  82.   end
  83.   #--------------------------------------------------------------------------
  84.   # ● 释放
  85.   #--------------------------------------------------------------------------
  86.   def dispose
  87.     terminate_message
  88.     $game_temp.message_window_showing = false
  89.     if @input_number_window != nil
  90.       @input_number_window.dispose
  91.     end
  92.     super
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # ● 处理信息结束
  96.   #--------------------------------------------------------------------------
  97.   def terminate_message
  98.     self.active = false
  99.     self.pause = false
  100.     self.index = -1
  101.     self.contents.clear
  102.     # 清除显示中标志
  103.     @contents_showing = false
  104.     # 呼叫信息调用
  105.     if $game_temp.message_proc != nil
  106.       $game_temp.message_proc.call
  107.     end
  108.     # 清除文章、选择项、输入数值的相关变量
  109.     $game_temp.message_text = nil
  110.     $game_temp.message_proc = nil
  111.     $game_temp.choice_start = 99
  112.     $game_temp.choice_max = 0
  113.     $game_temp.choice_cancel_type = 0
  114.     $game_temp.choice_proc = nil
  115.     $game_temp.num_input_start = 99
  116.     $game_temp.num_input_variable_id = 0
  117.     $game_temp.num_input_digits_max = 0
  118.     # 开放金钱窗口
  119.     if @gold_window != nil
  120.       @gold_window.dispose
  121.       @gold_window = nil
  122.     end
  123.     if @name_window_frame != nil
  124.       @name_window_frame.dispose
  125.       @name_window_frame = nil
  126.     end
  127.     if @name_window_text != nil
  128.       @name_window_text.dispose
  129.       @name_window_text = nil
  130.     end
  131.     if @right_picture != nil and @right_keep == true
  132.       @right_picture.dispose
  133.     end   
  134.     if @left_picture != nil and @left_keep == true
  135.       @left_picture.dispose
  136.     end
  137.   end
  138.   def refresh
  139.     # 初期化
  140.     self.contents.clear
  141.     self.contents.font.color = normal_color
  142.     self.contents.font.size = Font.default_size
  143.     @x = @y = @max_x = @max_y = @indent = @lines = 0
  144.     @left_keep = @right_keep = false
  145.     @face_indent = 0
  146.     @opacity = 255
  147.     @cursor_width = 0
  148.     @write_speed = 0
  149.     @write_wait = 0
  150.     @mid_stop = false
  151.     @face_file = nil
  152.     @popchar = -2
  153.     if $game_temp.choice_start == 0
  154.       @x = 8
  155.     end
  156.     if $game_temp.message_text != nil
  157.       @now_text = $game_temp.message_text
  158.       #——头像设置
  159.       if (/\\[Ff]\[(.+?)\]/.match(@now_text))!=nil then
  160.         @face_file = $1 + ".png"
  161.         @x = @face_indent = 128
  162.         if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
  163.           self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
  164.         end
  165.         @now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" }
  166.       end
  167.       #——左半身像设置
  168.       if (/\\[Ll]\[(.+?)\]/.match(@now_text))!=nil then
  169.         @face = "66rpg_" + $1 + "_h.png"
  170.         if $加密 == true
  171.           if @left_picture != nil
  172.             @left_picture.dispose
  173.           end
  174.           @left_picture = Sprite.new
  175.           @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  176.           @left_picture.y = 480-@left_picture.bitmap.height
  177.           @left_picture.x = 0
  178.           @left_picture.mirror = true
  179.           @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  180.         else         
  181.           if FileTest.exist?("Graphics/battlers/#{@face}")
  182.             if @left_picture != nil
  183.               @left_picture.dispose
  184.             end
  185.             @left_picture = Sprite.new
  186.             @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  187.             @left_picture.y = 480-@left_picture.bitmap.height
  188.             @left_picture.x = 0
  189.             @left_picture.mirror = true
  190.             @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  191.           end
  192.         end        
  193.       end
  194.       #——右半身像设置
  195.       if (/\\[Rr]\[(.+?)\]/.match(@now_text))!=nil then
  196.         @face = "66rpg_" + $1 + "_h.png"
  197.         if $加密 == true
  198.           if @right_picture != nil
  199.             @right_picture.dispose
  200.           end
  201.           @right_picture = Sprite.new
  202.           @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  203.           @right_picture.y = 480-@right_picture.bitmap.height
  204.           @right_picture.x = 640-@right_picture.bitmap.width
  205.           @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  206.         else
  207.           if FileTest.exist?("Graphics/battlers/#{@face}")
  208.             if @right_picture != nil
  209.               @right_picture.dispose
  210.             end
  211.             @right_picture = Sprite.new
  212.             @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  213.             @right_picture.y = 480-@right_picture.bitmap.height
  214.             @right_picture.x = 640-@right_picture.bitmap.width
  215.             @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  216.           end
  217.         end
  218.       end
  219.       if (/\\[Rr]k/.match(@now_text)) != nil
  220.         @right_keep = true
  221.         @now_text.sub!(/\\[Rr]k/) { "" }
  222.       end
  223.       if (/\\[Ll]k/.match(@now_text)) != nil
  224.         @left_keep = true
  225.         @now_text.sub!(/\\[Ll]k/) { "" }
  226.       end
  227.       # 显示人物姓名
  228.       name_window_set = false
  229.       if (/\\[Nn]ame\[(.+?)\]/.match(@now_text)) != nil
  230.         name_window_set = true
  231.         name_text = $1
  232.         @now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }
  233.       end
  234.       
  235.       # 文字位置的判定
  236.       if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then
  237.         @popchar = $1.to_i
  238.         if @popchar == -1
  239.           @x = @indent = 48
  240.           @y = 4
  241.         end
  242.         @now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }
  243.       end
  244.       
  245.       # 开始
  246.       begin
  247.         last_text = @now_text.clone
  248.         @now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
  249.       end until @now_text == last_text
  250.       @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  251.       $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  252.     end
  253.     @now_text.gsub!(/\\\\/) { "\000" }
  254.     @now_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  255.     @now_text.gsub!(/\\[Gg]/) { "\002" }
  256.     @now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" }
  257.     @now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" }
  258.     @now_text.gsub!(/\\[.]/) { "\005" }
  259.     @now_text.gsub!(/\\[|]/) { "\006" }

  260.     @now_text.gsub!(/\\[>]/) { "\016" }
  261.     @now_text.gsub!(/\\[<]/) { "\017" }
  262.     @now_text.gsub!(/\\[!]/) { "\020" }
  263.     @now_text.gsub!(/\\[~]/) { "\021" }
  264.    
  265.     @now_text.gsub!(/\\[Ii]/) { "\023" }
  266.     @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
  267.     @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
  268.     @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
  269.     @now_text.gsub!(/\\[Kk]\[(.*?)\]/) { "\027[#{$1}]" }
  270.     if @popchar >= 0
  271.       @text_save = @now_text.clone
  272.       @max_x = 0
  273.       @max_y = 4
  274.       for i in 0..3
  275.         line = @now_text.split(/\n/)[3-i]
  276.         @max_y -= 1 if line == nil and @max_y <= 4-i
  277.         next if line == nil
  278.         cx = contents.text_size(line).width
  279.         @max_x = cx if cx > @max_x
  280.       end
  281.       self.width = @max_x + 48 + @face_indent
  282.       self.height = (@max_y - 1) * 32 + 64
  283.     else
  284.       @max_x = self.width - 32 - @face_indent
  285.     end
  286.     reset_window
  287.       if name_window_set
  288.         off_x = 0
  289.         off_y = -40
  290.         space = 2
  291.         x = self.x + off_x - space / 2
  292.         y = self.y + off_y - space / 2
  293.         w = self.contents.text_size(name_text).width + 26 + space
  294.         h = 40 + space
  295.         @name_window_frame = Window_Frame.new(x, y, w, h)
  296.         @name_window_frame.z = self.z + 1
  297.         x = self.x + off_x + 4
  298.         y = self.y + off_y
  299.         @name_window_text = Air_Text.new(x+4, y+6, name_text)
  300.         @name_window_text.z = self.z + 2
  301.       end
  302.     end
  303.     reset_window
  304.     if $game_temp.choice_max > 0
  305.       @item_max = $game_temp.choice_max
  306.       self.active = true
  307.       self.index = 0
  308.     end
  309.     if $game_temp.num_input_variable_id > 0
  310.       digits_max = $game_temp.num_input_digits_max
  311.       number = $game_variables[$game_temp.num_input_variable_id]
  312.       @input_number_window = Window_InputNumber.new(digits_max)
  313.       @input_number_window.number = number
  314.       @input_number_window.x = self.x + 8
  315.       @input_number_window.y = self.y + $game_temp.num_input_start * 32
  316.     end
  317.   end
  318.   #--------------------------------------------------------------------------
  319.   # ● 更新
  320.   #--------------------------------------------------------------------------
  321.   def update
  322.     super
  323.     ###############################kk############################
  324.       if @k_tale != nil
  325.         
  326.         character = get_character(@popchar)
  327.         x = [[character.screen_x - 0 - self.width / 2, 4].max, 636 - self.width].min
  328.         y = [[character.screen_y - 80 + self.height, 4].max, 476 - self.height].min
  329.         y = [[character.screen_y - 48 - self.height, 4].max, 476 - self.height].min if $game_system.message_position == 0
  330.         self.x = x
  331.         self.y = y
  332.        #kk
  333.         @k_tale.x = ( character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  334.         @k_tale.y = self.y + self.height - 16
  335.         if @left_picture != nil and !@left_picture.disposed?
  336.           @left_picture.x = x+8
  337.           @left_picture.y = y - @left_picture.bitmap.height + self.height - 8
  338.         end
  339.         if @right_picture != nil and !@right_picture.disposed?
  340.           @right_picture.x = x+self.width-@right_picture.bitmap.width-8
  341.           @right_picture.y = y - @right_picture.bitmap.height + self.height - 8
  342.         end
  343.         if $game_system.message_position == 0
  344.           @k_tale.opacity = 255
  345.           @k2_tale.opacity = 0
  346.         else
  347.           @k_tale.opacity = 0
  348.           @k2_tale.opacity = 255
  349.           @k2_tale.x = ( character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  350.           @k2_tale.y = self.y - 16
  351.         end
  352. #       @name_window_text.x = self.x + @face_indent -4
  353. #       @name_window_text.y = self.y
  354. #       @bar.x = self.x
  355. #       @bar.y = self.y
  356.     end
  357.     #################################kk###########################
  358.     if @fade_in
  359.       self.contents_opacity += 24
  360.       if @input_number_window != nil
  361.         @input_number_window.contents_opacity += 24
  362.       end
  363.       if self.contents_opacity == 255
  364.         @fade_in = false
  365.       end
  366.       return
  367.     end
  368.     @now_text = nil if @now_text == ""
  369.    
  370.     if @now_text != nil and @mid_stop == false
  371.       if @write_wait > 0
  372.         @write_wait -= 1
  373.         return
  374.       end
  375.       text_not_skip = $game_system.typing
  376.       while true
  377.         @max_x = @x if @max_x < @x
  378.         @max_y = @y if @max_y < @y
  379.         if (c = @now_text.slice!(/./m)) != nil
  380.           if c == "\000"
  381.             c = "\\"
  382.           end
  383.           if c == "\001"
  384.             @now_text.sub!(/\[([0-9]+)\]/, "")
  385.             color = $1.to_i
  386.             if color >= 0 and color <= 7
  387.               self.contents.font.color = text_color(color)
  388.             end
  389.             c = ""
  390.           end
  391.           if c == "\002"
  392.             if @gold_window == nil and @popchar <= 0
  393.               @gold_window = Window_Gold.new
  394.               @gold_window.x = 560 - @gold_window.width
  395.               if $game_temp.in_battle
  396.                 @gold_window.y = 192
  397.               else
  398.                 @gold_window.y = self.y >= 128 ? 32 : 384
  399.               end
  400.               @gold_window.opacity = self.opacity
  401.               @gold_window.back_opacity = self.back_opacity
  402.             end
  403.             c = ""
  404.           end
  405.           if c == "\003"
  406.             @now_text.sub!(/\[([0-9]+)\]/, "")
  407.             speed = $1.to_i
  408.             if speed >= 0 and speed <= 19
  409.               @write_speed = speed
  410.             end
  411.             c = ""
  412.           end
  413.           if c == "\004"
  414.             @now_text.sub!(/\[(.*?)\]/, "")
  415.             buftxt = $1.dup.to_s
  416.             if buftxt.match(/\//) == nil and buftxt != "" then
  417.               $game_system.soundname_on_speak = "Audio/SE/" + buftxt
  418.             else
  419.               $game_system.soundname_on_speak = buftxt.dup
  420.             end
  421.             c = ""
  422.           elsif c == "\004"
  423.             c = ""
  424.           end
  425.           if c == "\005"
  426.             @write_wait += 5
  427.             c = ""
  428.           end
  429.           if c == "\006"
  430.             @write_wait += 20
  431.             c = ""
  432.           end
  433.           if c == "\016"
  434.             text_not_skip = false
  435.             c = ""
  436.           end
  437.           if c == "\017"
  438.             text_not_skip = true
  439.             c = ""
  440.           end
  441.           if c == "\020"
  442.             @mid_stop = true
  443.             c = ""
  444.           end
  445.           if c == "\021"
  446.             terminate_message
  447.             return
  448.           end
  449.           if c == "\023"
  450.             @indent = @x
  451.             c = ""
  452.           end
  453.           if c == "\024"
  454.             @now_text.sub!(/\[([0-9]+)\]/, "")
  455.             @opacity = $1.to_i
  456.             c = ""
  457.           end
  458.           if c == "\025"
  459.             @now_text.sub!(/\[([0-9]+)\]/, "")
  460.             self.contents.font.size = [[$1.to_i, 6].max, 32].min
  461.             c = ""
  462.           end
  463.           if c == "\026"
  464.             @now_text.sub!(/\[([0-9]+)\]/, "")
  465.             @x += $1.to_i
  466.             c = ""
  467.           end
  468.           if c == "\027"
  469.             @now_text.sub!(/\[(.*?)\]/, "")
  470.             @x += ruby_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), $1, @opacity)
  471.             if $game_system.soundname_on_speak != ""
  472.               Audio.se_play($game_system.soundname_on_speak)
  473.             end
  474.             c = ""
  475.           end
  476.           if c == "\030"
  477.             @now_text.sub!(/\[(.*?)\]/, "")
  478.             self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
  479.            if $game_system.soundname_on_speak != ""
  480.               Audio.se_play($game_system.soundname_on_speak)
  481.             end
  482.             @x += 24
  483.             c = ""
  484.           end
  485.           if c == "\n"
  486.             if @lines >= $game_temp.choice_start
  487.               @cursor_width = [@cursor_width, @max_x - @face_indent].max
  488.             end
  489.             @lines += 1
  490.             @y += 1
  491.             @x = 0 + @indent + @face_indent
  492.             if @lines >= $game_temp.choice_start
  493.               @x = 8 + @indent + @face_indent
  494.             end
  495.             c = ""
  496.           end
  497.           if c != ""
  498.             # 文字描画
  499.             @x += opacity_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), c, @opacity)
  500.             if $game_system.soundname_on_speak != "" then
  501.             Audio.se_play($game_system.soundname_on_speak)
  502.             end
  503.           end
  504.           if Input.press?(Input::B)
  505.             text_not_skip = false
  506.           end
  507.         else
  508.           text_not_skip = true
  509.           break
  510.         end
  511.         # 終了判定
  512.         if text_not_skip
  513.           break
  514.         end
  515.       end
  516.       @write_wait += @write_speed
  517.       return
  518.     end
  519.     if @input_number_window != nil
  520.       @input_number_window.update
  521.       # 決定
  522.       if Input.trigger?(Input::C)
  523.         $game_system.se_play($data_system.decision_se)
  524.         $game_variables[$game_temp.num_input_variable_id] =
  525.         @input_number_window.number
  526.         $game_map.need_refresh = true
  527.         @input_number_window.dispose
  528.         @input_number_window = nil
  529.         terminate_message
  530.       end
  531.       return
  532.     end
  533.     if @contents_showing
  534.       if $game_temp.choice_max == 0
  535.         self.pause = true
  536.       end
  537.       # 取消
  538.       if Input.trigger?(Input::B)
  539.         if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  540.           $game_system.se_play($data_system.cancel_se)
  541.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  542.           terminate_message
  543.         end
  544.       end
  545.       # 決定
  546.       if Input.trigger?(Input::C)
  547.         ############################kk######################
  548.          if @k_tale != nil  
  549.           @k_tale.dispose
  550.           @k_tale = nil
  551.           @k2_tale.dispose
  552.           @k2_tale = nil
  553.         end
  554.         ############################kk######################
  555.         if $game_temp.choice_max > 0
  556.           $game_system.se_play($data_system.decision_se)
  557.           $game_temp.choice_proc.call(self.index)
  558.         end
  559.         if @mid_stop
  560.           @mid_stop = false
  561.           return
  562.         else
  563.           terminate_message
  564.         end
  565.       end
  566.       return
  567.     end
  568.     if @fade_out == false and $game_temp.message_text != nil
  569.       @contents_showing = true
  570.       $game_temp.message_window_showing = true
  571.       refresh
  572.       Graphics.frame_reset
  573.       self.visible = true
  574.       self.contents_opacity = 0
  575.     if @input_number_window != nil
  576.       @input_number_window.contents_opacity = 0
  577.     end
  578.       @fade_in = true
  579.       return
  580.     end
  581.     if self.visible
  582.       @fade_out = true
  583.       self.opacity -= 48
  584.       if self.opacity == 0
  585.         self.visible = false
  586.         @fade_out = false
  587.         $game_temp.message_window_showing = false
  588.       end
  589.       return
  590.     end
  591.   end
  592.   #--------------------------------------------------------------------------
  593.   # ● 获得字符
  594.   #--------------------------------------------------------------------------
  595.   def get_character(parameter)
  596.     case parameter
  597.     when 0
  598.       return $game_player
  599.     else
  600.       events = $game_map.events
  601.       return events == nil ? nil : events[parameter]
  602.     end
  603.   end
  604.   #--------------------------------------------------------------------------
  605.   # ● ウィンドウの位置と不透明度の設定
  606.   #--------------------------------------------------------------------------
  607.   def reset_window
  608.     # 判定
  609.     #################################kk#######################
  610.     if @k_tale != nil  
  611.       @k_tale.dispose
  612.       @k_tale = nil
  613.       @k2_tale.dispose
  614.       @k2_tale = nil
  615.     end
  616.     #################################kk########################
  617.     if @popchar >= 0
  618.       events = $game_map.events
  619.       if events != nil
  620.         character = get_character(@popchar)
  621.         ###########################kk########################
  622.         x = [[character.screen_x - 0 - self.width / 2, 4].max, 636 - self.width].min
  623.         y = [[character.screen_y - 80 + self.height, 4].max, 476 - self.height].min
  624.         y = [[character.screen_y - 48 - self.height, 4].max, 476 - self.height].min if $game_system.message_position == 0
  625.         ###########################kk########################
  626. #        x = [[character.screen_x - 0 - self.width / 2, 4].max, 636 - self.width].min
  627. #        y = [[character.screen_y - 48 - self.height, 4].max, 476 - self.height].min
  628.         self.x = x
  629.         self.y = y
  630.         ###########################kk########################
  631.         #kk
  632.         @k_tale = Sprite.new
  633.         @k_tale.bitmap = RPG::Cache.windowskin("001-Blue01-top")
  634.         @k_tale.x = ( character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  635.         @k_tale.y = self.y + self.height - 16
  636.         @k_tale.z = 9999
  637.         @k2_tale = Sprite.new
  638.         @k2_tale.bitmap = RPG::Cache.windowskin("001-Blue01-under")
  639.         @k2_tale.x = ( character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16
  640.         @k2_tale.y = self.y + self.height - 16
  641.         @k2_tale.z = 9999
  642.         if @left_picture != nil and !@left_picture.disposed?
  643.           @left_picture.x = x+8
  644.           @left_picture.y = y - @left_picture.bitmap.height + self.height - 8
  645.           @left_picture.z += self.z
  646.         end
  647.         if @right_picture != nil and !@right_picture.disposed?
  648.           @right_picture.x = x+self.width-@right_picture.bitmap.width-8
  649.           @right_picture.y = y - @right_picture.bitmap.height + self.height - 8
  650.           @right_picture.z += self.z
  651.         end
  652.         ###########################kk########################
  653.       end
  654.     elsif @popchar == -1
  655.       self.x = -4
  656.       self.y = -4
  657.       self.width = 648
  658.       self.height = 488
  659.     else
  660.       if $game_temp.in_battle
  661.         self.y = 16
  662.       else
  663.         case $game_system.message_position
  664.         when 0 # 上
  665.           self.y = 16
  666.         when 1 # 中
  667.           self.y = 160
  668.         when 2 # 下
  669.           self.y = 304
  670.         end
  671.         self.x = 80
  672.         if @face_file == nil
  673.           self.width = 480
  674.         else
  675.           self.width = 600
  676.           self.x -= 60
  677.         end
  678.         self.height = 160
  679.       end
  680.     end
  681.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  682.     if @face_file != nil
  683.       self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
  684.     end
  685.     if @popchar == -1
  686.       self.opacity = 255
  687.       self.back_opacity = 0
  688.     elsif $game_system.message_frame == 0
  689.       self.opacity = 255
  690.       self.back_opacity = 200
  691.     else
  692.       self.opacity = 0
  693.       self.back_opacity = 200
  694.     end
  695.   end
  696.   #--------------------------------------------------------------------------
  697.   # ● line_height
  698.   #--------------------------------------------------------------------------
  699.   # 返回値:行高
  700.   #--------------------------------------------------------------------------
  701.   def line_height
  702.     return 32
  703.     if self.contents.font.size >= 20 and self.contents.font.size <= 24
  704.       return 32
  705.     else
  706.       return self.contents.font.size * 15 / 10
  707.     end
  708.   end
  709.   #--------------------------------------------------------------------------
  710.   # ● 透過文字描画
  711.   #--------------------------------------------------------------------------
  712.   # target :描画対象。Bitmapクラスを指定。
  713.   # x :x座標
  714.   # y :y座標
  715.   # str  :描画文字列
  716.   # opacity:透過率(0~255)
  717.   # 返回値 :文字幅(@x増加値)。
  718.   #--------------------------------------------------------------------------
  719.   def opacity_draw_text(target, x, y, str,opacity)
  720.     height = target.font.size
  721.     width = target.text_size(str).width
  722.     opacity = [[opacity, 0].max, 255].min
  723.     if opacity == 255
  724.       target.draw_text(x, y, width, height, str)
  725.       return width
  726.     else
  727.       if @opacity_text_buf.width < width or @opacity_text_buf.height < height
  728.         @opacity_text_buf.dispose
  729.         @opacity_text_buf = Bitmap.new(width, height)
  730.       else
  731.         @opacity_text_buf.clear
  732.       end
  733.       @opacity_text_buf.font.size = target.font.size
  734.       @opacity_text_buf.draw_text(0, 0, width, height, str)
  735.       target.blt(x, y, @opacity_text_buf, Rect.new(0, 0, width, height), opacity)
  736.     return width
  737.     end
  738.   end
  739.   def ruby_draw_text(target, x, y, str,opacity)
  740.     sizeback = target.font.size
  741.     target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2
  742.     rubysize = [rubysize, 6].max
  743.    
  744.     opacity = [[opacity, 0].max, 255].min
  745.     split_s = str.split(/,/)
  746.    
  747.     split_s[0] == nil ? split_s[0] = "" : nil
  748.     split_s[1] == nil ? split_s[1] = "" : nil
  749.    
  750.     height = sizeback + rubysize
  751.     width = target.text_size(split_s[0]).width
  752.    
  753.     target.font.size = rubysize
  754.     ruby_width = target.text_size(split_s[1]).width
  755.     target.font.size = sizeback
  756.    
  757.     buf_width = [target.text_size(split_s[0]).width, ruby_width].max
  758.    
  759.     width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0
  760.    
  761.     if opacity == 255
  762.       target.font.size = rubysize
  763.       target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1])
  764.       target.font.size = sizeback
  765.       target.draw_text(x, y, width, target.font.size, split_s[0])
  766.       return width
  767.     else
  768.       if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height
  769.         @opacity_text_buf.dispose
  770.         @opacity_text_buf = Bitmap.new(buf_width, height)
  771.       else
  772.         @opacity_text_buf.clear
  773.       end
  774.       @opacity_text_buf.font.size = rubysize
  775.       @opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1)
  776.       @opacity_text_buf.font.size = sizeback
  777.       @opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1)
  778.       if sub_x >= 0
  779.         target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  780.       else
  781.         target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  782.       end
  783.       return width
  784.     end
  785.   end
  786.   #--------------------------------------------------------------------------
  787.   # ● \V 变换
  788.   #--------------------------------------------------------------------------
  789.   def convart_value(option, index)
  790.     option == nil ? option = "" : nil
  791.     option.downcase!
  792.     case option
  793.       when "i"
  794.         unless $data_items[index].name == nil
  795.           r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
  796.         end
  797.       when "w"
  798.         unless $data_weapons[index].name == nil
  799.           r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
  800.         end
  801.       when "a"
  802.         unless $data_armors[index].name == nil
  803.           r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
  804.         end
  805.       when "s"
  806.         unless $data_skills[index].name == nil
  807.           r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
  808.         end
  809.       else
  810.       r = $game_variables[index]
  811.     end
  812.     r == nil ? r = "" : nil
  813.     return r
  814.   end
  815.   #--------------------------------------------------------------------------
  816.   # ● 解放
  817.   #--------------------------------------------------------------------------
  818.   def dispose
  819.     terminate_message
  820.     if @gaiji_cache != nil
  821.       unless @gaiji_cache.disposed?
  822.         @gaiji_cache.dispose
  823.       end
  824.     end
  825.     unless @opacity_text_buf.disposed?
  826.       @opacity_text_buf.dispose
  827.     end
  828.     $game_temp.message_window_showing = false
  829.     if @input_number_window != nil
  830.       @input_number_window.dispose
  831.     end
  832.     super
  833.   end
  834.   #--------------------------------------------------------------------------
  835.   # ● 矩形更新
  836.   #--------------------------------------------------------------------------
  837.   def update_cursor_rect
  838.     if @index >= 0
  839.       n = $game_temp.choice_start + @index
  840.       self.cursor_rect.set(4 + @indent + @face_indent, n * 32 + 4, @cursor_width, 32)
  841.     else
  842.       self.cursor_rect.empty
  843.     end
  844.   end
  845. end
  846. #==============================================================================
  847. # ■ Window_Frame (枠だけで中身の無いウィンドウ)
  848. #==============================================================================
  849. class Window_Frame < Window_Base
  850.   #--------------------------------------------------------------------------
  851.   # ● オブジェクト初期化
  852.   #--------------------------------------------------------------------------
  853.   def initialize(x, y, width, height)
  854.     super(x, y, width, height)
  855.     self.contents = nil
  856.     self.back_opacity = 200
  857.   end
  858.   #--------------------------------------------------------------------------
  859.   # ● 解放
  860.   #--------------------------------------------------------------------------
  861.   def dispose
  862.     super
  863.     end
  864.   end
  865. #==============================================================================
  866. # ■ Air_Text (何も無いところに文字描写 = 枠の無い瞬間表示メッセージウィンドウ)
  867. #==============================================================================
  868. class Air_Text < Window_Base
  869.   #--------------------------------------------------------------------------
  870.   # ● オブジェクト初期化
  871.   #--------------------------------------------------------------------------
  872.   def initialize(x, y, designate_text)
  873.     super(x-16, y-16, 32 + designate_text.size * 12, 56)
  874.     self.opacity = 0
  875.     self.back_opacity = 0
  876.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  877.     w = self.contents.width
  878.     h = self.contents.height
  879.     self.contents.draw_text(0, 0, w, h, designate_text)
  880.   end
  881.   #--------------------------------------------------------------------------
  882.   # ● 解放
  883.   #--------------------------------------------------------------------------
  884.   def dispose
  885.     self.contents.clear
  886.     super
  887.   end
  888. end

  889. #==============================================================================
  890. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  891. #==============================================================================
复制代码

001-Blue01-top.png (21.63 KB, 下载次数: 5)

001-Blue01-top.png

001-Blue01-under.png (20.45 KB, 下载次数: 4)

001-Blue01-under.png

QQ截图未命名.jpg (27.52 KB, 下载次数: 1)

QQ截图未命名.jpg

001-Blue01-top.png (21.63 KB, 下载次数: 1)

001-Blue01-top.png
目前任务:学习
目前进度:没有
最新说明:MUD嘛~~自由度~

原来泥巴更容易挖坑
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
54
在线时间
36 小时
注册时间
2006-6-13
帖子
237
3
 楼主| 发表于 2009-8-21 12:21:30 | 只看该作者
那啥~~~自顶一下。。。
目前任务:学习
目前进度:没有
最新说明:MUD嘛~~自由度~

原来泥巴更容易挖坑
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
54
在线时间
36 小时
注册时间
2006-6-13
帖子
237
4
 楼主| 发表于 2009-8-22 16:01:54 | 只看该作者
难道这个问题就没人帮解决么。。。。。
目前任务:学习
目前进度:没有
最新说明:MUD嘛~~自由度~

原来泥巴更容易挖坑
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
54
在线时间
36 小时
注册时间
2006-6-13
帖子
237
5
 楼主| 发表于 2009-8-24 09:53:02 | 只看该作者
继续等。。。。。等到老。。。。。
目前任务:学习
目前进度:没有
最新说明:MUD嘛~~自由度~

原来泥巴更容易挖坑
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
55
在线时间
0 小时
注册时间
2009-4-7
帖子
341
6
发表于 2009-9-8 18:07:12 | 只看该作者
事件设置移动路线,能否人物走动,对话框也跟着?
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-1 01:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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