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

Project1

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

[已经解决] VA有木有半身对话脚本。苦逼了啊

[复制链接]

Lv1.梦旅人

梦石
0
星屑
59
在线时间
831 小时
注册时间
2010-8-23
帖子
487
跳转到指定楼层
1
发表于 2012-2-13 09:15:07 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
VA有木有半身对话脚本。苦逼了啊

评分

参与人数 1星屑 -20 收起 理由
仲秋启明 -20 伸手

查看全部评分

Lv2.观梦者

梦石
0
星屑
728
在线时间
687 小时
注册时间
2011-2-13
帖子
638
2
发表于 2012-2-13 17:44:28 | 只看该作者
我觉得那个东西事件弄一弄就行了
反正主角就那几个
弄到公用事件里 每次调用 取消 也不是很麻烦
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
432
在线时间
4175 小时
注册时间
2010-6-26
帖子
6474
3
发表于 2012-2-13 19:36:27 | 只看该作者

我自己写的一个草稿,从XP的FUKI移植过来的。

本帖最后由 eve592370698 于 2012-2-13 22:11 编辑

首先是创立Heads文件夹识别:
  1. module Cache
  2.   #--------------------------------------------------------------------------
  3.   # ○ 取得半身像   
  4.   def self.head(filename)
  5.     load_bitmap("Graphics/Heads/", filename)   
  6.   end
  7. end
复制代码
模仿XP的FUKI对话框创建事件脚本代号
  1. class Game_Interpreter
  2. =begin ═════════════════════════════════
  3.    □ FUKI对话框的自定义
  4. --------------------------------------------------
  5.   考虑到用户的习惯,就不改变了
  6.  ○ 方便用户同时设置2个常用参数而使用的函数,
  7. =end #--------------------------------------------------
  8.   def chat(id = nil ,name = nil , nes_width = true , mes_line = 4 )
  9.     if id == 0
  10.       # 没办法了,只好在这里动动手脚吧
  11.       $mes_id = @event_id
  12.     else
  13.       $mes_id = id
  14.     end   
  15.     $mes_name = name  
  16.     $mes_width = nes_width
  17.     pngFile = "Graphics/Heads/" + name + ".png"
  18.     if FileTest.exist?(pngFile) == true
  19.       p "真的存在啊"
  20.       $has_head = true
  21.     else
  22.       $has_head = false
  23.       
  24.     end
  25.    
  26.     SceneManager::scene.changelines(mes_line)
  27.   end
  28.   
  29.   
  30.   
  31. end
复制代码
设定FUKI对话框参数
  1. module FUKI
  2.   
  3.   
  4. # Skin的设定使用数据库默认窗口Skin情况下这里使用[""]
  5. FUKI_SKIN_NAME = ""   # 呼出对话框用Skin
  6. NAME_SKIN_NAME = ""   # 角色名字窗口用Skin
  7. #↓最多显示的行数,如果超过,就智能化地分成多次显示。
  8. Line_Max = 12

  9. # 字体大小
  10. MES_FONT_SIZE = 22    # 呼出对话框
  11. NAME_FONT_SIZE = 18   # 角色名字窗口
  12. #   这里是FUKI多选框的参数设置!
  13. # 字体颜色(设定为 Color.new(0, 0, 0, 0) 表示使用普通文字色)
  14. FUKI_COLOR = Color.new(2, 2, 2, 255)  # 呼出对话框
  15. NAME_COLOR = Color.new(255, 255, 255, 255)  # 角色名字窗口

  16. # 窗口透明度,如修改窗口透明度请同时修改尾部箭头图形内部的透明度
  17. FUKI_OPACITY = 200    # 呼出对话框
  18. MES_OPACITY = 200     # 默认信息窗口
  19. NAME_OPACITY = 200    # 角色名字窗口

  20. # 角色名字窗口的相对位置
  21. NAME_SHIFT_X = 0      # 横坐标
  22. NAME_SHIFT_Y = 16     # 纵坐标
  23.   
  24. end
复制代码
替换原来的Window_Message
注意,是替换!不是插入
  1. #==============================================================================
  2. # ■ Window_Message
  3. #------------------------------------------------------------------------------
  4. #  显示文章信息的窗口。
  5. #==============================================================================

  6. class Window_Message < Window_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化
  9.   #--------------------------------------------------------------------------
  10.   def initialize( linenumber = 4 )
  11.     @linenumber = linenumber
  12.     #↓初始化数值好像和self.后面数值不一样
  13.     super(0, 0, window_width , window_height)   
  14.     self.z = 200
  15.     self.openness = 0
  16.     #↓初始化为兼容半身像
  17.     create_all_windows
  18.     create_back_bitmap
  19.     create_back_sprite
  20.     clear_instance_variables
  21.   end  #-------
  22.   # ● 取得窗口的宽度
  23.   #--------------------------------------------------------------------------
  24.   def window_width
  25.     Graphics.width
  26.   end
  27. =begin  #--------------------------------------------------------------------------
  28.     ● 取得窗口的高度上限,我干脆直接弄到一起吧。
  29. =end  #--------------------------------------------------------------------------
  30.   def window_height
  31.     #坑爹的初始化值啊!限制头像!
  32.     fitting_height(@linenumber)
  33.      # 真不知道这是方法还是变量了。
  34.     #↑应该是限制最多显示的行数,如果超了,就自动换行。
  35.   end


  36.   #--------------------------------------------------------------------------
  37.   # ● 清除实例变量
  38.   #--------------------------------------------------------------------------
  39.   def clear_instance_variables
  40.     @fiber = nil                # 纤程
  41.     @background = 0             # 背景类型
  42.     @position = 2               # 显示位置
  43.     clear_flags
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ● 清除的标帜
  47.   #--------------------------------------------------------------------------
  48.   def clear_flags
  49.     @show_fast = false          # 快进的标帜
  50.     @line_show_fast = false     # 行单位快进的标帜
  51.     @pause_skip = false         # [不进行输入等待]的标帜
  52.   end

  53.   #--------------------------------------------------------------------------
  54.   # ● 释放
  55.   #--------------------------------------------------------------------------
  56.   def dispose
  57.     super
  58.     dispose_all_windows
  59.     dispose_back_bitmap
  60.     dispose_back_sprite
  61.   end
  62.   #--------------------------------------------------------------------------
  63.   # ● 帧更新
  64.   #--------------------------------------------------------------------------
  65.   def update
  66.     super
  67.     update_all_windows
  68.     update_back_sprite
  69.     update_fiber
  70.   end
  71.   #--------------------------------------------------------------------------
  72.   # ● 纤程的更新
  73.   #--------------------------------------------------------------------------
  74.   def update_fiber
  75.     if @fiber
  76.       @fiber.resume
  77.     elsif $game_message.busy? && !$game_message.scroll_mode
  78.       @fiber = Fiber.new { fiber_main }
  79.       @fiber.resume
  80.     else
  81.       $game_message.visible = false
  82.     end
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● 生成所有窗口
  86.   #--------------------------------------------------------------------------
  87.   def create_all_windows
  88.     @gold_window = Window_Gold.new
  89.     @gold_window.x = Graphics.width - @gold_window.width
  90.     @gold_window.y = 0
  91.     @gold_window.openness = 0
  92.     @choice_window = Window_ChoiceList.new(self)
  93.     @number_window = Window_NumberInput.new(self)
  94.     @item_window = Window_KeyItem.new(self)
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # ● 生成背景位图
  98.   #--------------------------------------------------------------------------
  99.   def create_back_bitmap
  100.     @back_bitmap = Bitmap.new(width, height)
  101.     rect1 = Rect.new(0, 0, width, 12)
  102.     rect2 = Rect.new(0, 12, width, height - 24)
  103.     rect3 = Rect.new(0, height - 12, width, 12)
  104.     @back_bitmap.gradient_fill_rect(rect1, back_color2, back_color1, true)
  105.     @back_bitmap.fill_rect(rect2, back_color1)
  106.     @back_bitmap.gradient_fill_rect(rect3, back_color1, back_color2, true)
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # ● 取得背景色 1
  110.   #--------------------------------------------------------------------------
  111.   def back_color1
  112.     Color.new(0, 0, 0, 160)
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ● 取得背景色 2
  116.   #--------------------------------------------------------------------------
  117.   def back_color2
  118.     Color.new(0, 0, 0, 0)
  119.   end
  120.   #--------------------------------------------------------------------------
  121.   # ● 生成背景活动块
  122.   #--------------------------------------------------------------------------
  123.   def create_back_sprite
  124.     @back_sprite = Sprite.new
  125.     @back_sprite.bitmap = @back_bitmap
  126.     @back_sprite.visible = false
  127.     @back_sprite.z = z - 1
  128.   end
  129.   #--------------------------------------------------------------------------
  130.   # ● 释放所有窗口
  131.   #--------------------------------------------------------------------------
  132.   def dispose_all_windows
  133.     @gold_window.dispose
  134.     @choice_window.dispose
  135.     @number_window.dispose
  136.     @item_window.dispose
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # ● 释放背景位图
  140.   #--------------------------------------------------------------------------
  141.   def dispose_back_bitmap
  142.     @back_bitmap.dispose
  143.   end
  144.   #--------------------------------------------------------------------------
  145.   # ● 释放背景活动块
  146.   #--------------------------------------------------------------------------
  147.   def dispose_back_sprite
  148.     @back_sprite.dispose
  149.   end
  150.   #--------------------------------------------------------------------------
  151.   # ● 更新所有窗口
  152.   #--------------------------------------------------------------------------
  153.   def update_all_windows
  154.     @gold_window.update
  155.     @choice_window.update
  156.     @number_window.update
  157.     @item_window.update
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   # ● 更新背景活动块
  161.   #--------------------------------------------------------------------------
  162.   def update_back_sprite
  163.     @back_sprite.visible = (@background == 1)
  164.     @back_sprite.y = y
  165.     @back_sprite.opacity = openness
  166.     @back_sprite.update
  167.   end
  168. =begin --------------------------------------------------------------------------
  169.   ★ 处理进程的主逻辑
  170.    由于某人翻译措辞不当导致本人误会

  171. =end #--------------------------------------------------------------------------
  172.   def fiber_main   
  173.     self.height = window_height
  174.    
  175.    
  176.     $game_message.visible = true
  177.     update_background
  178.     loop do
  179.       # 这样让每次对话框内出现字符时都更新一次各种精灵和窗口的位置。
  180.       update_placement
  181.       # ↑那个说明已经获取了文章位置了,给它先转移过来。
  182.       # 默认在text_continue?判定是否还有字符+是否位置一样。
  183.    
  184.       get_tale_pos
  185.       set_namewindow   
  186.       # 如果位置一样并且还有字符的话,就会回到loop的这个位置,因此不会更新。
  187.       process_all_text if $game_message.has_text?
  188.       process_input
  189.       $game_message.clear
  190.       @gold_window.close
  191.       # ↓顺便把释放也放到这里,每次循环释放一次。
  192.       fuki_dispose
  193.       Fiber.yield
  194.       break unless text_continue?
  195.     end
  196.     close_and_wait
  197.     $game_message.visible = false
  198.     @fiber = nil
  199.   end
  200.   
  201.   #--------------------------------------------------------------------------
  202.   # ● 更新窗口背景
  203.   #------------------------------------
  204.   def update_background
  205.     @background = $game_message.background
  206.     self.opacity = @background == 0 ? 255 : 0
  207.   end
  208. =begin --------------------------------------------
  209.  ★ 更新窗口的位置
  210. 这里特别要说明一下:
  211. 在XP以及旧版本的VX中,文章位置是用常数设定好的,
  212. =end  #————————————————————————————————————————————————————————————————
  213.   def update_placement           
  214.     @position = $game_message.position
  215.     # ↓ 在这里,成为变量决定了。
  216.     self.y = @position * (Graphics.height - height) / 2
  217.     @gold_window.y = y > 0 ? 0 : Graphics.height - @gold_window.height
  218.   end  
  219. =begin        ╔════════════════╗
  220.           ║★ 友情说明 ★║
  221.           ╚════════════════╝
  222.             下面那些内容是从XP的FUKI对话框移植过来的。
  223. ————————————————————————————————————————————————————————————————————————
  224.   ☆ 取得角色位置     
  225.       由XP的FUKI对话框仿制过来  
  226. =end #--------------------------------------------------------------------      
  227.   def get_tale_pos
  228.     #↓获取角色,坐标
  229.     if $mes_id == nil        
  230.       return
  231.     elsif $mes_id >= 0
  232.       x = $game_map.events[$mes_id].screen_x
  233.       y = $game_map.events[$mes_id].screen_y
  234.     elsif $mes_id == -1
  235.       x = $game_player.screen_x
  236.       y = $game_player.screen_y
  237.     else
  238.       party_followers = 0 - $mes_id - 2
  239.       x = $game_player.followers[party_followers].screen_x
  240.       y = $game_player.followers[party_followers].screen_y
  241.     end
  242.     #↓给说话的人弄个方块
  243.     @tale_cursor = Sprite.new
  244.     @tale_cursor.bitmap = Cache.system("cursor")
  245.     #处理坐标,请注意,图标文件以改变,故在此重新修正数值。   
  246.     @tale_cursor.x = x - 16
  247.     @tale_cursor.y = y - 32
  248.     @tale_cursor.z = self.z + 1
  249.     #↓然后弄个对话框箭头
  250.     @tale_fuki = Sprite.new
  251.     #↓使用局部变量请注意上面进程调用方法的先后顺序
  252.     if @position == 0
  253.       @tale_fuki.bitmap = Cache.system("上角标")
  254.       @tale_fuki.x = x
  255.       @tale_fuki.y = y - 55
  256.       if @tale_fuki.y > self.y + height
  257.         self.y += ( @tale_fuki.y - height )
  258.       else
  259.         @tale_fuki.dispose
  260.       end
  261.     elsif @position == 2
  262.       @tale_fuki.bitmap = Cache.system("下角标")
  263.       @tale_fuki.x = x
  264.       @tale_fuki.y = y
  265.       if self.y > @tale_fuki.y + @tale_fuki.bitmap.height
  266.         self.y = @tale_fuki.y + @tale_fuki.bitmap.height
  267.       else
  268.         @tale_fuki.dispose
  269.       end
  270.     else
  271.       @tale_fuki.dispose
  272.     end      
  273.   end
  274. =begin ——————————————————————————————————————————————
  275.   ★ 生成角色名字窗口
  276.     这里我基本上把XP的弄过来的,除了windowskin,这个函数,别的都是原样照搬
  277.     没办法啊,刚开始,别对我有太高的期望
  278. =end #————————————————————————————————————————————————
  279.   def set_namewindow
  280.         
  281.     #↓因VX窗口设定变了,所以就这么弄吧
  282.     windowskin = Cache.system("Window")
  283.     # ↓获取高度
  284.   # ●
  285.   #--------------------------------------------------------------------------
  286.     if $mes_name == nil or $mes_name == "" or $mes_name == false or $game_message.background != 0
  287.       return   
  288.       
  289.       
  290.     #↓如果想使用半身像的话,注意文件不太支持中文名。
  291.     elsif $has_head == true and ( $game_message.face_name.empty? or @linenumber < 4 )
  292.       bmp = Cache.head($mes_name)
  293.       @pic_width = bmp.width
  294.       @pic_height = bmp.height
  295.       
  296.       name_x = self.x + FUKI::NAME_SHIFT_X
  297.       name_y = self.y - @pic_height - 22 + FUKI::NAME_SHIFT_Y
  298.       
  299.       # 生成角色头像窗口
  300.       @name_win = Window_Base.new(name_x, name_y, @pic_width + 5, @pic_height + 5)
  301.       @name_win.windowskin = windowskin
  302.       @name_win.back_opacity = FUKI::NAME_OPACITY
  303.       @name_win.z = self.z + 2
  304.       
  305.       @name_contents = Sprite.new
  306.       @name_contents.bitmap = bmp
  307.       @name_contents.x = name_x + 2
  308.       @name_contents.y = name_y + 2
  309.       @name_contents.z = @name_win.z + 2
  310.     else
  311.       # 设定变量      
  312.       mes_name = $mes_name #      
  313.       
  314.       #↓生成名字的宽度,这里好像对字符的大小重新定义了
  315.       name_width = mes_name.size * FUKI::NAME_FONT_SIZE
  316.       name_height = FUKI::NAME_FONT_SIZE
  317.       
  318.       @name_x = self.x + FUKI::NAME_SHIFT_X
  319.       @name_y = self.y - name_height - 22 + FUKI::NAME_SHIFT_Y
  320.       @name_y = 0 if @name_y < 0
  321.       # 生成角色名字窗口(只有边框)
  322.       @name_win = Window_Base.new(@name_x, @name_y, name_width + 16, name_height + 16)
  323.       @name_win.windowskin = windowskin
  324.       @name_win.back_opacity = FUKI::NAME_OPACITY
  325.       @name_win.z = self.z + 2      
  326. =begin ↑设定窗口边框结束了
  327.       ↓设定名字窗口内容开始
  328. =end  # 为了使空白比Windows类限定的更小使用双重结构
  329.       @name_contents = Sprite.new
  330.       @name_contents.x = @name_x + 12
  331.       @name_contents.y = @name_y + 8
  332.       @name_contents.bitmap = Bitmap.new(name_width, name_height)
  333.       @name_contents.z = self.z + 2      
  334.       # 设定文字色      
  335.       nil_color = Color.new(0,0,0,0)
  336.       if FUKI::NAME_COLOR != nil_color
  337.         @name_contents.bitmap.font.color = FUKI::NAME_COLOR
  338.       else
  339.         @name_contents.bitmap.font.color = normal_color
  340.       end
  341.       @name_contents.bitmap.font.size = FUKI::NAME_FONT_SIZE
  342.       # 调整窗口尺寸
  343.       rect = @name_contents.bitmap.text_size(mes_name)
  344.       @name_win.width = rect.width + 32
  345.       # 描画名字
  346.       @name_contents.bitmap.draw_text(rect, mes_name)   
  347.       # 模仿猫君的杰作colortext            
  348.       @name_contents.bitmap.clear      
  349.       colortext = mes_name.clone
  350.       # 描画名字               
  351.       # 重置x坐标
  352.       x = 0
  353.       # 为了方便、将 "\\\\" 变换为 "\000"
  354.       colortext.gsub!(/\\\\/) { "\000" }
  355.       # "\\C" 变为 需要的功能
  356.       colortext.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  357.       # c 获取 1 个字 (如果不能取得文字就循环)
  358.       while ((c = colortext.slice!(/./m)) != nil)
  359.         # \\ 的情况下
  360.         if c == "\000"
  361.           # 还原为本来的文字
  362.           c = "\\"
  363.         end
  364.         # \C[n] 的情况下
  365.         if c == "\001"
  366.           # 兼容1.03
  367.           c = ""
  368.           # 更改文字色
  369.           colortext.sub!(/\[([0-9]+)\]/, "")
  370.           color = $1.to_i
  371.           if color >= 0 and color <= 7
  372.             @name_contents.bitmap.font.color = text_color(color)
  373.           end
  374.           # 下面的文字
  375.           next                  
  376.         end
  377.         # 调整窗口尺寸
  378.         # 描绘文字
  379.         @name_contents.bitmap.draw_text(x,2 + name_height / 2 - FUKI::NAME_FONT_SIZE , 40, 32, c )
  380.         # 推进x坐标
  381.         x += @name_contents.bitmap.text_size(c).width
  382.       end
  383.     end
  384.    
  385.    
  386.   end
  387.   
  388. =begin -----------------------------------
  389.   ☆ 这里就是释放窗口了
  390.        引用癫狂侠客那句话就是早借早还……
  391.        就是这位置实在是不好找啊
  392. =end #---------------------------------------
  393.   def fuki_dispose
  394.     unless @tale_cursor == nil
  395.       @tale_cursor.dispose
  396.     end
  397.     unless @tale_fuki == nil
  398.       @tale_fuki.dispose
  399.     end
  400.     unless @name_win == nil
  401.       @name_win.dispose
  402.     end   
  403.     unless @name_contents == nil
  404.       @name_contents.dispose
  405.     end   
  406.     unless @face_fuki_vx == nil
  407.       @face_fuki_vx.dispose   
  408.     end
  409.   end
  410. =begin        ╔════════════════╗
  411.           ║★ 友情说明 ★║
  412.           ╚════════════════╝
  413. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  414.         一下内容是从旧VX的一些增强对话框移植过来的
  415. -------------------------------------------------------------------
  416.    ○ 生成半身像,绕过VX头像
  417.        VX ACE默认的这个头像显示真的好坑爹!
  418. =end  #----------------------------------------------
  419.   
  420.   
  421.   
  422. =begin ----------------------------
  423.   
  424. =end #--------------------------------------------------------------------------

  425.   # ○ 设定半身像位置
  426.   #--------------------------------------------------------------------------

  427.   # ○ 获取半身像高度
  428.   #     face_name  : 半身像图像文件名
  429.   #--------------------------------------------------------------------------
  430.   
  431.   
  432.   
  433.   
  434. =begin     ┏━━━━━━━━━━━━━━━━━━━━┓
  435.        ┃ 好了,下面继续VX ACE的默认内容 ┃
  436.        ┗━━━━━━━━━━━━━━━━━━━━┛
  437. ————————————————————————————————————————————————————————————————————
  438.   
  439.   # ● 处理所有内容
  440. =end #--------------------------------------------------------------------------
  441.   def process_all_text
  442.     open_and_wait
  443.     text = convert_escape_characters($game_message.all_text)
  444.     pos = {}
  445.     new_page(text, pos)
  446.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  447.   end
  448.   #--------------------------------------------------------------------------
  449.   # ● 输入处理
  450.   #--------------------------------------------------------------------------
  451.   def process_input
  452.     if $game_message.choice?
  453.       input_choice
  454.     elsif $game_message.num_input?
  455.       input_number
  456.     elsif $game_message.item_choice?
  457.       input_item
  458.     else
  459.       input_pause unless @pause_skip
  460.     end
  461.   end
  462.   #--------------------------------------------------------------------------
  463.   # ● 打开窗口并等待窗口开启完成
  464.   #--------------------------------------------------------------------------
  465.   def open_and_wait
  466.     open
  467.     Fiber.yield until open?
  468.   end
  469.   #--------------------------------------------------------------------------
  470.   # ● 关闭窗口并等待窗口关闭完成
  471.   #--------------------------------------------------------------------------
  472.   def close_and_wait
  473.     close
  474.     Fiber.yield until all_close?
  475.   end
  476.   #--------------------------------------------------------------------------
  477.   # ● 判定是否所有窗口已全部关闭
  478.   #--------------------------------------------------------------------------
  479.   def all_close?
  480.     close? && @choice_window.close? &&
  481.     @number_window.close? && @item_window.close?
  482.   end
  483.   #--------------------------------------------------------------------------
  484.   # ● 判定文章是否继续显示
  485.   #--------------------------------------------------------------------------
  486.   def text_continue?
  487.     $game_message.has_text? && !settings_changed?
  488.   end
  489.   #--------------------------------------------------------------------------
  490.   # ● 判定背景和位置是否被变更
  491.   #--------------------------------------------------------------------------
  492.   def settings_changed?
  493.     @background != $game_message.background ||
  494.     @position != $game_message.position
  495.   end
  496.   #--------------------------------------------------------------------------
  497.   # ● 等待
  498.   #--------------------------------------------------------------------------
  499.   def wait(duration)
  500.     duration.times { Fiber.yield }
  501.   end
  502.   #--------------------------------------------------------------------------
  503.   # ● 监听[确定]键的按下,更新快进的标帜
  504.   #--------------------------------------------------------------------------
  505.   def update_show_fast
  506.     @show_fast = true if Input.trigger?(:C)
  507.   end
  508.   #--------------------------------------------------------------------------
  509.   # ● 输出一个字符后的等待
  510.   #--------------------------------------------------------------------------
  511.   def wait_for_one_character
  512.     update_show_fast
  513.     Fiber.yield unless @show_fast || @line_show_fast
  514.   end
  515. =begin --------------------------------------------------------------------------
  516.   ★ 翻页处理,真的是一大让我头疼得要命的难题啊
  517. =end  #--------------------------------------------------------------------------
  518.   def new_page(text, pos)
  519.     contents.clear
  520.     #↓这个处理头像是有点难度,得改一改了   
  521.     if @linenumber >= 4
  522.       draw_face($game_message.face_name, $game_message.face_index, 0, 0)
  523.     end
  524.     reset_font_settings
  525.     pos[:x] = new_line_x
  526.     pos[:y] = 0 #- $face_height + self.height
  527.     pos[:new_x] = new_line_x
  528.     #↓原来是行间距差不多啊?
  529.     pos[:height] = calc_line_height(text)
  530.     clear_flags
  531.   end
  532.   #--------------------------------------------------------------------------
  533.   # ● 取得换行位置,因为坑爹的头像识别,这里又改回去了
  534.   #--------------------------------------------------------------------------
  535.   def new_line_x
  536.     if $game_message.face_name.empty? or @linenumber < 4
  537.       return 0
  538.     else  
  539.       return  112
  540.     end
  541.   end
  542.   #--------------------------------------------------------------------------
  543.   # ● 普通文字的处理
  544.   #--------------------------------------------------------------------------
  545.   def process_normal_character(c, pos)
  546.     super
  547.     wait_for_one_character
  548.   end
  549.   #--------------------------------------------------------------------------
  550.   # ● 换行文字的处理
  551.   #--------------------------------------------------------------------------
  552.   def process_new_line(text, pos)
  553.     @line_show_fast = false
  554.     super
  555.     if need_new_page?(text, pos)
  556.       input_pause
  557.       new_page(text, pos)
  558.     end
  559.   end
  560.   #--------------------------------------------------------------------------
  561.   # ● 判定是否需要翻页
  562.   #--------------------------------------------------------------------------
  563.   def need_new_page?(text, pos)
  564.     #做一下局部修改,以便适应变量的变化
  565.     a = @linenumber * line_height
  566.     pos[:y] + pos[:height] > a && !text.empty?
  567.   end
  568.   #--------------------------------------------------------------------------
  569.   # ● 翻页文字的处理
  570.   #--------------------------------------------------------------------------
  571.   def process_new_page(text, pos)
  572.     text.slice!(/^\n/)
  573.     input_pause
  574.     new_page(text, pos)
  575.   end
  576.   #--------------------------------------------------------------------------
  577.   # ● 处理控制符指定的图标描画
  578.   #--------------------------------------------------------------------------
  579.   def process_draw_icon(icon_index, pos)
  580.     super
  581.     wait_for_one_character
  582.   end
  583. =begin --------------------------------------------------------------------------
  584.   ★ 控制符的处理
  585.        code : 控制符的实际形式(比如「\C[1]」是「C」)
  586.        text : 描画处理中的字符串缓存(字符串可能会被修改)
  587.        pos  : 描画位置 {:x, :y, :new_x, :height}
  588.     这里特别说明一下,case c when有很多内容是隐藏在内部类中的,少部分在父类
  589.     Window_Base中,所以不要随便定义以防止冲突
  590. =end #--------------------------------------------------------------------------
  591.   def process_escape_character(code, text, pos)
  592.     case code.upcase
  593.     when '$'
  594.       @gold_window.open
  595.     when '.'
  596.       wait(15)
  597.     when '|'
  598.       wait(60)
  599.     when '!'
  600.       input_pause
  601.     when '>'
  602.       @line_show_fast = true
  603.     when '<'
  604.       @line_show_fast = false
  605.     when '^'
  606.       @pause_skip = true
  607.     else
  608.       super
  609.     end
  610.   end
  611.   #--------------------------------------------------------------------------
  612.   # ● 处理输入等待
  613.   #--------------------------------------------------------------------------
  614.   def input_pause
  615.     self.pause = true
  616.     wait(10)
  617.     Fiber.yield until Input.trigger?(:B) || Input.trigger?(:C)
  618.     Input.update
  619.     self.pause = false
  620.   end
  621.   #--------------------------------------------------------------------------
  622.   # ● 处理选项的输入
  623.   #--------------------------------------------------------------------------
  624.   def input_choice
  625.     @choice_window.start
  626.     Fiber.yield while @choice_window.active
  627.   end
  628.   #--------------------------------------------------------------------------
  629.   # ● 处理数值的输入
  630.   #--------------------------------------------------------------------------
  631.   def input_number
  632.     @number_window.start
  633.     Fiber.yield while @number_window.active
  634.   end
  635.   #--------------------------------------------------------------------------
  636.   # ● 处理物品的选择
  637.   #--------------------------------------------------------------------------
  638.   def input_item
  639.     @item_window.start
  640.     Fiber.yield while @item_window.active
  641.   end
  642. end
复制代码
@怕鼠的猫 还有一个插入脚本
  1. class Scene_Map < Scene_Base
  2. =begin  --------------------------------------
  3.   + 换行变化
  4.     调用方法:事件中的脚本输入    SceneManager::scene.changelines(2)
  5.               就变成两行对话框了。以后持续有效
  6. =end #------------------------------------
  7.   def changelines(n)
  8.     @message_window.dispose
  9.     @message_window = Window_Message.new(n)
  10.   end
  11. end
复制代码
一定要在Graphics文件夹下创建一个Heads文件夹,把XP使用的头像或者半身像拿过来,然后请看截图效果

FUKI2b.jpg (47.82 KB, 下载次数: 33)

FUKI2b.jpg

评分

参与人数 2星屑 +450 梦石 +2 收起 理由
冰舞蝶恋 + 250 太神奇!
「旅」 + 200 + 2 认可答案,恭喜你获得由66RPG提供的精美好.

查看全部评分

潜水,专心忙活三次元工作了……
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
21977
在线时间
8570 小时
注册时间
2011-12-31
帖子
3362
4
发表于 2012-2-13 21:34:47 | 只看该作者
本帖最后由 tseyik 于 2012-2-13 21:36 编辑

日網有一個
http://a1tktk.web.fc2.com/scripts_page/stand_picture.html

点评

http://115.com/file/e7hd559e# stand_pic_sample.zip  发表于 2012-2-13 22:29
打不开网站。  发表于 2012-2-13 22:11

评分

参与人数 1星屑 +200 梦石 +2 收起 理由
「旅」 + 200 + 2 认可答案,恭喜你获得由66RPG提供的精美好.

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
45
在线时间
138 小时
注册时间
2011-11-15
帖子
216
5
发表于 2012-3-20 13:44:50 | 只看该作者
可以直接在事件中弄啊,比如说和NPC说话时,出现对话框的同时还出现“显示图片”就好了,需要自己调图片在对话框的位置坐标,事件其实大部分能解决脚本的作用,不必什么都用脚本吧
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
182 小时
注册时间
2009-4-22
帖子
208
6
发表于 2012-3-21 11:18:04 | 只看该作者
tseyik 发表于 2012-2-13 21:34
日網有一個
http://a1tktk.web.fc2.com/scripts_page/stand_picture.html

怎么没有分享啊,谢谢

点评

115的問題, 現在応可以了  发表于 2012-3-21 11:30
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-7 13:42

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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