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

Project1

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

[已经解决] 怎样在ACE中,在对话框中出现选项

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
179 小时
注册时间
2012-11-14
帖子
94
跳转到指定楼层
1
发表于 2012-11-19 16:54:47 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我现在还是在做一个任务系统,就是和一个NPC对话后,会出现多个任务可以选择,但是ACE自带的选择框体,会出现在屏幕右边靠下的位置。
所以想问下各位大神,能不能够制作出,和NPC在对话过程中出现的对话选项那种的,就和AVG游戏分支那种一样~谢谢

Lv1.梦旅人

梦石
0
星屑
159
在线时间
181 小时
注册时间
2012-6-11
帖子
65
2
发表于 2012-11-20 11:46:41 | 只看该作者
本帖最后由 zhy012003 于 2012-11-20 11:54 编辑

不是很明白意思,是想做成这种?

额,就不要吐槽在哪个儿童游戏里截取的啦……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
179 小时
注册时间
2012-11-14
帖子
94
3
 楼主| 发表于 2012-11-20 14:45:46 | 只看该作者
zhy012003 发表于 2012-11-20 11:46
不是很明白意思,是想做成这种?

额,就不要吐槽在哪个儿童游戏里截取的啦…… ...

对的哦~这种的更好,就是选项出现在对话框那里
这种的,是在ACE中通过脚本实现的么?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
52 小时
注册时间
2012-5-13
帖子
126
4
发表于 2012-11-27 00:11:26 | 只看该作者
那种效果你去首页整个脚本,然后顺带着下载了对话框素材就可以了- -
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
52
在线时间
704 小时
注册时间
2011-12-27
帖子
941
5
发表于 2012-11-27 07:57:41 手机端发表。 | 只看该作者
用事件中的選項,用條件分岐及變量分析申請了的任務
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
179 小时
注册时间
2012-11-14
帖子
94
6
 楼主| 发表于 2012-11-27 17:07:13 | 只看该作者
l854501881 发表于 2012-11-27 00:11
那种效果你去首页整个脚本,然后顺带着下载了对话框素材就可以了- -

下了也研究了不少整合的脚本了,但是还没发现改动选项框的..
有的话麻烦发下地址....
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
179 小时
注册时间
2012-11-14
帖子
94
7
 楼主| 发表于 2012-11-27 17:08:18 | 只看该作者
zeldafd 发表于 2012-11-27 07:57
用事件中的選項,用條件分岐及變量分析申請了的任務

能说的详细点么?条件分支和变量的话,也只能改变任务的出现条件啊..
我现在想改变的是选项框的位置..
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
52 小时
注册时间
2012-5-13
帖子
126
8
发表于 2012-11-28 00:22:06 | 只看该作者
月满月西楼 发表于 2012-11-27 17:07
下了也研究了不少整合的脚本了,但是还没发现改动选项框的..
有的话麻烦发下地址.... ...

#==============================================================================
#
# ¥ Yami Engine Ace - Pop Message
# -- Last Updated: 2012.06.07
# -- Level: Normal
# -- Requires: n/a
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["YSE-PopMessage"] = true

#==============================================================================
# ¥ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2012.06.07 - Fixed Compatible: YEA - Ace Message System.
# 2012.05.11 - Fixed Message Position.
#            - Remove Requirement: YSE - Fix Events Order.
# 2012.05.07 - Fixed Face position.
#            - Added Requirement: YSE - Fix Events Order.
# 2012.04.06 - You can change Bubble Tag filename.
# 2012.03.28 - Fixed Default Message Position and Sizes.
# 2012.03.27 - Fixed Default Message.
# 2012.03.27 - Added Bubble Tag.
# 2012.03.25 - Fixed Escape Message.
# 2012.03.24 - Fixed Battle Message.
# 2012.03.24 - Rewrote script.
#
#==============================================================================
# ¥ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ¥ Materials/‘fÞ but above ¥ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Message Window text Codes - These go inside of your message window.
# -----------------------------------------------------------------------------
#  Position:   Effect:
#    \bm[x]    - Sets Message Window position to event x. *Note
#    \cbm      - Cancel bubble message.
#
#              *Note: Set to 0 to sets position to Game Player.
#
#==============================================================================
# ¥ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================

module YSE
  module POP_MESSAGE
   
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Visual Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    LIMIT = { # Start.
      :limit_width    =>  0,  # Set to 0 to disable limit.
      :limit_line     =>  6,  # Set to 0 to disable limit.
    } # End.
   
    POSITION = { # Start.
      :x_buffer       =>  0,
      :y_buffer       =>  -36,
      :face_x_buffer  =>  8,
      :face_y_buffer  =>  24,
      :tag_y_buffer   =>  -6,
      :name_x_buffer  =>  112, # Require YEA - Message System.
    } # End.
   
    EFFECT = { # Start.
      :fade_face       =>  true,
      :move_face       =>  true,
      :use_bubble_tag  =>  true,
      :bubble_tag_name => "BubbleTag",
    } # End.
   
  end
end

#==============================================================================
# ¥ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================

#==============================================================================
# ¡ Spriteset_Map
#==============================================================================

class Spriteset_Map
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :character_sprites
  
end # Spriteset_Map

#==============================================================================
# ¡ Window_Message_Face
#==============================================================================

class Window_Message_Face < Window_Base
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 120, 120)
    self.opacity = 0
    @face_name = ""
    @face_index = 0
    @move_x = 0
    close
  end
  
  #--------------------------------------------------------------------------
  # message_window=
  #--------------------------------------------------------------------------
  def message_window=(window)
    @message_window = window
  end
  
  #--------------------------------------------------------------------------
  # set_face
  #--------------------------------------------------------------------------
  def set_face
    contents.clear
    return unless @message_window
    if !$game_message.face_name.empty?
      draw_face($game_message.face_name, $game_message.face_index, 0, 0)
      set_position
      show_face
    else
      hide_face
    end
  end
  
  #--------------------------------------------------------------------------
  # set_position
  #--------------------------------------------------------------------------
  def set_position
    return unless @message_window
    self.x = @message_window.x
    self.y = @message_window.y - 96
    self.x += YSE::POP_MESSAGE::POSITION[:face_x_buffer]
    self.y += YSE::POP_MESSAGE::POSITION[:face_y_buffer]
    self.y += (@message_window.real_lines - 1) * 24
    self.z = @message_window.z + 1
    if (@face_name != $game_message.face_name || @face_index != $game_message.face_index)
      if YSE::POP_MESSAGE::EFFECT[:move_face]
        @move_x = 30
        self.x -= 30
      end
      @face_name = $game_message.face_name
      @face_index = $game_message.face_index
      self.contents_opacity = 0 if YSE::POP_MESSAGE::EFFECT[:fade_face]
    end
  end
  
  #--------------------------------------------------------------------------
  # show_face
  #--------------------------------------------------------------------------
  def show_face
    open
  end
  
  #--------------------------------------------------------------------------
  # hide_face
  #--------------------------------------------------------------------------
  def hide_face
    contents.clear
    close
  end
  
  #--------------------------------------------------------------------------
  # update
  #--------------------------------------------------------------------------
  def update
    super
    self.contents_opacity += 15 if self.contents_opacity < 255
    unless @move_x <= 0
      self.x += 2
      @move_x -= 2
    end
  end
  
end # Sprite_Message_Face

#==============================================================================
# ¡ Window_Message
#==============================================================================

class Window_Message < Window_Base
  
  #--------------------------------------------------------------------------
  # new method: face_window=
  #--------------------------------------------------------------------------
  def face_window=(window)
    @face_window = window
  end
  
  #--------------------------------------------------------------------------
  # new method: bubble_tag=
  #--------------------------------------------------------------------------
  def bubble_tag=(sprite)
    @bubble_tag = sprite
  end
  
  #--------------------------------------------------------------------------
  # new method: message_escape_characters_pop_message
  #--------------------------------------------------------------------------
  def message_escape_characters_pop_message(result)
    result.gsub!(/\eBM\[(\d+)\]/i) { event_pop_message_setup($1.to_i, false) }
    result.gsub!(/\eBMF\[(\d+)\]/i) { event_pop_message_setup($1.to_i, true) }
    result.gsub!(/\eCBM/i) { event_pop_message_setup(nil, false) }
    result
  end
  
  #--------------------------------------------------------------------------
  # alias method: convert_escape_characters
  #--------------------------------------------------------------------------
  alias yse_convert_escape_characters_pm convert_escape_characters
  def convert_escape_characters(text)
    result = yse_convert_escape_characters_pm(text)
    result = message_escape_characters_pop_message(result)
    result
  end
  
  #--------------------------------------------------------------------------
  # new method: event_pop_message_setup
  #--------------------------------------------------------------------------
  def event_pop_message_setup(event_id, follower = false)
    if follower && $game_player.followers[event_id].nil?
      @event_pop_id = nil
      @event_pop_follower = false
      return ""
    end
    @event_pop_follower = follower
    @event_pop_id = event_id
    return ""
  end
  
  #--------------------------------------------------------------------------
  # new method: set_face_position
  #--------------------------------------------------------------------------
  def set_face_position
    return unless SceneManager.scene_is?(Scene_Map)
    return unless @event_pop_id
    return unless @face_window
    contents.clear
    @face_window.set_face
    return unless $imported["YEA-MessageSystem"]
    return if @face_window.close?
    #@name_window.x = self.x + YSE::POP_MESSAGE::POSITION[:face_x_buffer] + YSE::POP_MESSAGE::POSITION[:name_x_buffer] if (@name_position == 1 || @name_position == 2)
  end
  
  #--------------------------------------------------------------------------
  # alias method: new_page
  #--------------------------------------------------------------------------
  alias window_message_new_page_pm_yse new_page
  def new_page(text, pos)
    window_message_new_page_pm_yse(text, pos)
    set_face_position
  end
  
  #--------------------------------------------------------------------------
  # alias method: close
  #--------------------------------------------------------------------------
  alias pop_message_close close
  def close
    pop_message_close
    return unless SceneManager.scene_is?(Scene_Map)
    return unless @event_pop_id
    @event_pop_id = nil
    @event_pop_follower = false
    @face_window.hide_face
    return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
    @bubble_tag.visible = false if @bubble_tag
  end
  
  #--------------------------------------------------------------------------
  # alias method: open_and_wait
  #--------------------------------------------------------------------------
  alias pop_message_open_and_wait open_and_wait
  def open_and_wait
    pop_message_open_and_wait
    return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
    @bubble_tag.visible = true if @event_pop_id && @bubble_tag
  end
  
  #--------------------------------------------------------------------------
  # alias method: process_all_text
  #--------------------------------------------------------------------------
  alias pop_message_process_all_text process_all_text
  def process_all_text
    @event_pop_id = nil
    convert_escape_characters($game_message.all_text)
    update_placement
    adjust_pop_message($game_message.all_text)
    pop_message_process_all_text
  end

  #--------------------------------------------------------------------------
  # alias method: update_placement
  #--------------------------------------------------------------------------
  alias event_pop_message_update_placement update_placement
  def update_placement
    if SceneManager.scene_is?(Scene_Map)
      if @event_pop_id.nil?
        fix_default_message
        event_pop_message_update_placement
      elsif @event_pop_id == 0
        character = $game_player
        self.y = character.screen_y - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
        self.x = character.screen_x - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
        fix_position_bubble(character)
        set_bubble_tag(character)
      elsif @event_pop_id > 0
        hash = @event_pop_follower ? $game_player.followers : $game_map.events
        character = hash[@event_pop_id]
        self.y = character.screen_y - self.height + YSE::POP_MESSAGE::POSITION[:y_buffer]
        self.x = character.screen_x - self.width / 2 + YSE::POP_MESSAGE::POSITION[:x_buffer]
        fix_position_bubble(character)
        set_bubble_tag(character)
      end
    else
      event_pop_message_update_placement
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: fix_default_message
  #--------------------------------------------------------------------------
  def fix_default_message
    self.width = window_width
    self.height = window_height
    self.x = 0
    @face_window.hide_face if @face_window
    create_contents
    return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
    @bubble_tag.visible = false if @bubble_tag
  end
  
  #--------------------------------------------------------------------------
  # new method: fix_position_bubble
  #--------------------------------------------------------------------------
  def fix_position_bubble(character)
    end_x = self.x + self.width
    end_y = self.y + self.height
    self.x = 0 if self.x < 0
    self.y = character.screen_y if self.y < 0
    self.x = Graphics.width - self.width if end_x > Graphics.width
    self.y = Graphics.height - self.height if end_y > Graphics.height
  end
  
  #--------------------------------------------------------------------------
  # new method: set_bubble_tag
  #--------------------------------------------------------------------------
  def set_bubble_tag(character)
    return unless YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
    return unless @bubble_tag
    up = self.y == character.screen_y
    self.y += up ? @bubble_tag.height / 2 : -@bubble_tag.height / 2
    @bubble_tag.x = character.screen_x - @bubble_tag.width / 2
    if up
      @bubble_tag.src_rect.set(0, @bubble_tag.height, @bubble_tag.width, @bubble_tag.height)
      @bubble_tag.y = self.y - @bubble_tag.height - YSE::POP_MESSAGE::POSITION[:tag_y_buffer]
    else
      @bubble_tag.src_rect.set(0, 0, @bubble_tag.width, @bubble_tag.height)
      @bubble_tag.y = self.y + self.height + YSE::POP_MESSAGE::POSITION[:tag_y_buffer]
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: cal_number_line
  #--------------------------------------------------------------------------
  def cal_number_line(text)
    result = 0
    text.each_line { result += 1 }
    return result
  end
  
  #--------------------------------------------------------------------------
  # new method: cal_width_line
  #--------------------------------------------------------------------------
  def cal_width_line(text)
    result = 0
    text.each_line { |line|
      result = text_size(line).width if result < text_size(line).width
    }
    return result
  end

  #--------------------------------------------------------------------------
  # alias method: adjust_message_window_size
  #--------------------------------------------------------------------------
  if $imported["YEA-MessageSystem"]
  alias yse_pop_message_adjust_message_window_size adjust_message_window_size
  def adjust_message_window_size
    start_name_window if @event_pop_id
    return if @event_pop_id
    yse_pop_message_adjust_message_window_size
  end
  end
  
  #--------------------------------------------------------------------------
  # new method: adjust_pop_message
  #--------------------------------------------------------------------------
  def adjust_pop_message(text = " ")
    return unless SceneManager.scene_is?(Scene_Map)
    unless @event_pop_id
      if $imported["YEA-MessageSystem"]
        #adjust_message_window_size
      end
      return
    end
    n_line = cal_number_line(text)
    n_line = YSE::POP_MESSAGE::LIMIT[:limit_line] if YSE::POP_MESSAGE::LIMIT[:limit_line] > 0 && cal_number_line(text) > YSE::POP_MESSAGE::LIMIT[:limit_line]
    @real_lines = n_line
    self.height = fitting_height(n_line)
    self.width = cal_width_line(text) + 24
    self.width += new_line_x
    if self.width > YSE::POP_MESSAGE::LIMIT[:limit_width] && YSE::POP_MESSAGE::LIMIT[:limit_width] > 0
      self.width = YSE::POP_MESSAGE::LIMIT[:limit_width]
    end
    create_contents
    update_placement
  end
  
  #--------------------------------------------------------------------------
  # overwrite method: new_line_x
  #--------------------------------------------------------------------------
  def new_line_x
    if $game_message.face_name.empty?
      return 0
    else
      result = YSE::POP_MESSAGE::POSITION[:face_x_buffer]
      p_x = $imported["YEA-MessageSystem"] ? YEA::MESSAGE::FACE_INDENT_X : 112
      result += p_x
      return result
    end
  end
  
  #--------------------------------------------------------------------------
  # new method: real_lines
  #--------------------------------------------------------------------------
  def real_lines
    @real_lines
  end
  
end # Window_Message

#==============================================================================
# ¡ Scene_Map
#==============================================================================

class Scene_Map < Scene_Base
  
  #--------------------------------------------------------------------------
  # alias method: create_message_window
  #--------------------------------------------------------------------------
  alias yse_pm_create_message_window create_message_window
  def create_message_window
    yse_pm_create_message_window
    @face_window = Window_Message_Face.new
    @face_window.message_window = @message_window
    if YSE::POP_MESSAGE::EFFECT[:use_bubble_tag]
      @bubble_tag_sprite = Sprite.new
      @bubble_tag_sprite.visible = false
      @bubble_tag_sprite.bitmap = Cache.system(YSE::POP_MESSAGE::EFFECT[:bubble_tag_name])
      @bubble_tag_sprite.src_rect.set(0, 0, @bubble_tag_sprite.width, @bubble_tag_sprite.height / 2)
      @message_window.bubble_tag = @bubble_tag_sprite
    end
    @message_window.face_window = @face_window
  end
  
  #--------------------------------------------------------------------------
  # alias method: dispose_spriteset
  #--------------------------------------------------------------------------
  alias pop_message_dispose_spriteset dispose_spriteset
  def dispose_spriteset
    pop_message_dispose_spriteset
    return unless @bubble_tag_sprite
    @bubble_tag_sprite.dispose
  end
  
end # Scene_Map

#==============================================================================
#
# ¥ End of File
#
#==============================================================================





好像是这个么- -
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
22436
在线时间
8598 小时
注册时间
2011-12-31
帖子
3364
9
发表于 2012-11-28 17:00:28 | 只看该作者
本帖最后由 tseyik 于 2012-11-28 17:40 编辑

這様?


    選択肢の作成

  1. #==============================================================================
  2. # □ 選択肢の作成 (for VX Ace)
  3. #------------------------------------------------------------------------------
  4. # Version : 1_20120112
  5. # by サリサ・タイクーン
  6. # http://www.tycoon812.com/rgss/
  7. #==============================================================================

  8. #==============================================================================
  9. # □ 素材スイッチ
  10. #==============================================================================
  11. $rgsslab = {} if $rgsslab == nil
  12. $rgsslab["選択肢の作成"] = true

  13. if $rgsslab["選択肢の作成"]
  14.   
  15. #==============================================================================
  16. # □ カスタマイズポイント
  17. #==============================================================================
  18. module RGSSLAB end
  19. module RGSSLAB::Choices_Make
  20.   #--------------------------------------------------------------------------
  21.   # ○ 選択肢の作成
  22.   #    記述方法:
  23.   #    "呼び出しの文字列" => [ "選択肢",
  24.   #                            "選択肢",
  25.   #                                 …,
  26.   #                          ],
  27.   #    (最後の設定のみ、後ろのカンマを省略できます)
  28.   #
  29.   #    呼び出しの文字列は、その選択肢を呼び出す時のキーで
  30.   #    イベントコマンドのスクリプトにおいて
  31.   #    「call_choices("呼び出しの文字列")」
  32.   #    と言うように記述する為にあるものです。
  33.   #   
  34.   #    選択肢の数の範囲は、2~7まで対応します。
  35.   #
  36.   #    尚、MODEが1の場合に限り、制御文字が扱えますが
  37.   #    扱う場合は、\を1つ多く記述して下さい。
  38.   #
  39.   #    例:\N[1]の場合→ \\N[1] と言う風にして下さい。
  40.   #--------------------------------------------------------------------------
  41.   SETTING = {
  42.   # 1:選択肢画面
  43.   "選択肢画面" => [
  44.     "1番目の選択肢",
  45.     "2番目の選択肢",
  46.     "3番目の選択肢",
  47.     "4番目の選択肢",
  48.     "5番目の選択肢",
  49.     "6番目の選択肢",
  50.     "7番目の選択肢",
  51.     ],
  52.   ###
  53.    
  54.   }
  55. end

  56. # カスタマイズポイントは、ここまで

  57. #==============================================================================
  58. # □ RGSSLAB::Choices_Make [module]
  59. #==============================================================================
  60. module RGSSLAB::Choices_Make
  61.   #--------------------------------------------------------------------------
  62.   # ○ 素材設定用の定数定義
  63.   #--------------------------------------------------------------------------
  64.   MATERIAL_NAME = "選択肢の作成"
  65.   VERSION       = 1
  66.   RELEASE       = 20120112
  67. end

  68. #==============================================================================
  69. # ■ Game_Interpreter [class]
  70. #==============================================================================
  71. class Game_Interpreter
  72.   #--------------------------------------------------------------------------
  73.   # ○ モジュールの設定
  74.   #--------------------------------------------------------------------------
  75.   RGSSLAB_052_2 = RGSSLAB::Choices_Make
  76. end

  77. #==============================================================================
  78. # □ Scene_Choices [class]
  79. #==============================================================================
  80. class Scene_Choices
  81.   #--------------------------------------------------------------------------
  82.   # ○ モジュールの設定
  83.   #--------------------------------------------------------------------------
  84.   RGSSLAB_052_2 = RGSSLAB::Choices_Make
  85. end

  86. end
复制代码
選択肢画面

  1. #==============================================================================
  2. # □ 選択肢画面 (for VX Ace)
  3. #------------------------------------------------------------------------------
  4. # Version : 2_20120223
  5. # by サリサ・タイクーン
  6. # http://www.tycoon812.com/rgss/
  7. #==============================================================================

  8. #==============================================================================
  9. # □ 素材スイッチ
  10. #==============================================================================
  11. $rgsslab = {} if $rgsslab == nil
  12. $rgsslab["選択肢画面"] = true

  13. if $rgsslab["選択肢画面"]
  14.   
  15. #==============================================================================
  16. # □ カスタマイズポイント
  17. #==============================================================================
  18. module RGSSLAB end
  19. module RGSSLAB::Scene_Choices
  20.   #--------------------------------------------------------------------------
  21.   # ○ 結果内容を受け取る変数
  22.   #    受け取る変数を指定します。
  23.   #
  24.   #    注意:
  25.   #    変数拡張の変数に設定する事はできません。
  26.   #--------------------------------------------------------------------------
  27.   RESULT_VARIABLE = 3
  28.   #--------------------------------------------------------------------------
  29.   # ○ 選択肢の番号表示
  30.   #    0 : アラビア数字
  31.   #    1 : アルファベット
  32.   #    2 : ローマ数字
  33.   #    3 : 漢数字
  34.   #
  35.   #    上記以外は、0として扱われます。
  36.   #--------------------------------------------------------------------------
  37.   DRAW = 0
  38.   #--------------------------------------------------------------------------
  39.   # ○ モードの選択(New!)
  40.   #    この素材のモードを選択します。
  41.   #
  42.   #    0 : 通常モード(制御文字は使えません)
  43.   #    1 : 制御文字モード
  44.   #
  45.   #    これら以外の数値は0として扱われます。
  46.   #
  47.   #    使えない制御文字もありますので、ご注意下さい。
  48.   #--------------------------------------------------------------------------
  49.   MODE = 0
  50. end

  51. # カスタマイズポイントは、ここまで

  52. #==============================================================================
  53. # □ RGSSLAB::Scene_Choices [module]
  54. #==============================================================================
  55. module RGSSLAB::Scene_Choices
  56.   #--------------------------------------------------------------------------
  57.   # ○ 素材設定用の定数定義
  58.   #--------------------------------------------------------------------------
  59.   MATERIAL_NAME = "選択肢画面"
  60.   VERSION       = 2
  61.   RELEASE       = 20120223
  62.   #--------------------------------------------------------------------------
  63.   # ○ 操作エラー
  64.   #     error_number : エラー番号
  65.   #--------------------------------------------------------------------------
  66.   def self.operate_error(error_number)
  67.     text = "【RGSS研究所:#{MATERIAL_NAME}】"
  68.     case error_number
  69.     when 1
  70.       msgbox_p text,
  71.       "呼び出しの文字列を記述して下さい。"
  72.     when 2
  73.       msgbox_p text,
  74.       "呼び出しの文字列:#{string}は存在しない為、実行できません。"
  75.     when 3
  76.       msgbox_p text,
  77.       "選択肢の数が2よりも小さい為、実行できません。"
  78.     when 4
  79.       msgbox_p text,
  80.       "選択肢の数が7よりも多い為、実行できません。"
  81.     end
  82.   end
  83. end

  84. #==============================================================================
  85. # ■ Game_Interpreter [class]
  86. #==============================================================================
  87. class Game_Interpreter
  88.   #--------------------------------------------------------------------------
  89.   # ○ モジュールの設定
  90.   #--------------------------------------------------------------------------
  91.   RGSSLAB_052 = RGSSLAB::Scene_Choices
  92.   #--------------------------------------------------------------------------
  93.   # ○ 選択肢画面の呼び出し
  94.   #     index : 選択肢の種類
  95.   #--------------------------------------------------------------------------
  96.   def call_choices(index)
  97.     if index == nil
  98.       RGSSLAB_052.operate_error(1)
  99.       return
  100.     end
  101.     if RGSSLAB_052_2::SETTING[index] == nil
  102.       RGSSLAB_052.operate_error(2, index)
  103.       return
  104.     end
  105.     if RGSSLAB_052_2::SETTING[index].size < 2
  106.       RGSSLAB_052.operate_error(3)
  107.       return
  108.     end
  109.     if RGSSLAB_052_2::SETTING[index].size > 7
  110.       RGSSLAB_052.operate_error(4)
  111.       return
  112.     end
  113.     SceneManager.call(Scene_Choices)
  114.     SceneManager.scene.prepare(index)
  115.     Fiber.yield
  116.   end
  117. end

  118. #==============================================================================
  119. # □ Window_Dummy_052 [class]
  120. #==============================================================================
  121. class Window_Dummy_052 < Window_Base
  122.   #--------------------------------------------------------------------------
  123.   # ○ オブジェクト初期化 [オーバーライド]
  124.   #--------------------------------------------------------------------------
  125.   def initialize
  126.     if $rgsslab["XP画面サイズ"]
  127.       super(48, 288, 544, 160)
  128.     else
  129.       super(0, 256, 544, 160)
  130.     end
  131.   end
  132. end

  133. #==============================================================================
  134. # □ Window_Choices_Display [class]
  135. #==============================================================================
  136. class Window_Choices_Display < Window_Base
  137.   #--------------------------------------------------------------------------
  138.   # ○ モジュールの設定
  139.   #--------------------------------------------------------------------------
  140.   RGSSLAB_052 = RGSSLAB::Scene_Choices
  141.   #--------------------------------------------------------------------------
  142.   # ○ オブジェクト初期化 [オーバーライド]
  143.   #     text : 最初に描画させる選択肢の文字列
  144.   #--------------------------------------------------------------------------
  145.   def initialize(text = "")
  146.     if $rgsslab["XP画面サイズ"]
  147.       super(48, 288, 544, 80)
  148.     else
  149.       super(0, 256, 544, 80)
  150.     end
  151.     self.opacity  = 0
  152.     refresh(text)
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # ○ リフレッシュ
  156.   #     text : 現在選択中の選択肢の文字列
  157.   #--------------------------------------------------------------------------
  158.   def refresh(text)
  159.     contents.clear
  160.     contents.font.color = normal_color
  161.     case RGSSLAB_052::MODE
  162.     when 0 ; contents.draw_text(4, 0, self.width - 40, 32, text)
  163.     when 1 ; draw_text_ex(4, 0, text)
  164.     else   ; contents.draw_text(4, 0, self.width - 40, 32, text)
  165.     end
  166.   end
  167. end

  168. #==============================================================================
  169. # □ Window_Label_Display [class]
  170. #==============================================================================
  171. class Window_Label_Display < Window_Selectable
  172.   #--------------------------------------------------------------------------
  173.   # ○ モジュールの設定
  174.   #--------------------------------------------------------------------------
  175.   RGSSLAB_052 = RGSSLAB::Scene_Choices
  176.   #--------------------------------------------------------------------------
  177.   # ○ オブジェクト初期化 [オーバーライド]
  178.   #     item_max : 候補数
  179.   #--------------------------------------------------------------------------
  180.   def initialize(item_max)
  181.     @item_max     = item_max
  182.     if $rgsslab["XP画面サイズ"]
  183.       super(48, 368, 544, 80)
  184.     else
  185.       super(0, 336, 544, 80)
  186.     end
  187.     self.index    = -1
  188.     self.opacity  = 0
  189.     case RGSSLAB_052::DRAW
  190.     when 1 ; @label = ["A", "B", "C", "D", "E", "F", "G"]
  191.     when 2 ; @label = ["Ⅰ", "Ⅱ", "Ⅲ", "Ⅳ", "Ⅴ", "Ⅵ", "Ⅶ"]
  192.     when 3 ; @label = ["一", "二", "三", "四", "五", "六", "七"]
  193.     else   ; @label = ["1", "2", "3", "4", "5", "6", "7"]
  194.     end
  195.     refresh
  196.   end
  197.   #--------------------------------------------------------------------------
  198.   # ○ 桁数の取得 [オーバーライド]
  199.   #--------------------------------------------------------------------------
  200.   def col_max
  201.     return 7
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # ○ 項目数の取得 [オーバーライド]
  205.   #--------------------------------------------------------------------------
  206.   def item_max
  207.     @item_max
  208.   end
  209.   #--------------------------------------------------------------------------
  210.   # ○ リフレッシュ
  211.   #--------------------------------------------------------------------------
  212.   def refresh
  213.     contents.clear
  214.     for i in 0...@item_max
  215.       draw_item(i)
  216.     end
  217.   end
  218.   #--------------------------------------------------------------------------
  219.   # ○ 項目の描画
  220.   #     index : 項目番号
  221.   #--------------------------------------------------------------------------
  222.   def draw_item(index)
  223.     rect = Rect.new(10 + index * 32, 0, 32, 32)
  224.     self.contents.draw_text(rect, @label[index])
  225.   end
  226.   #--------------------------------------------------------------------------
  227.   # ○ カーソルの矩形更新 [オーバーライド]
  228.   #--------------------------------------------------------------------------
  229.   def update_cursor
  230.     if @index < 0
  231.       self.cursor_rect.empty
  232.     else
  233.       self.cursor_rect.set(4 + @index * 32, 0, 32, 32)
  234.     end
  235.   end
  236. end

  237. #==============================================================================
  238. # □ Scene_Choices [class]
  239. #==============================================================================
  240. class Scene_Choices < Scene_Base
  241.   #--------------------------------------------------------------------------
  242.   # ○ モジュールの設定
  243.   #--------------------------------------------------------------------------
  244.   RGSSLAB_052 = RGSSLAB::Scene_Choices
  245.   #--------------------------------------------------------------------------
  246.   # ○ 準備
  247.   #     index : 選択肢の種類
  248.   #--------------------------------------------------------------------------
  249.   def prepare(index)
  250.     @index    = RGSSLAB_052_2::SETTING[index]
  251.     @item_max = RGSSLAB_052_2::SETTING[index].size
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ○ 開始処理 [オーバーライド]
  255.   #--------------------------------------------------------------------------
  256.   def start
  257.     super
  258.     create_spriteset
  259.     create_all_windows
  260.   end
  261.   #--------------------------------------------------------------------------
  262.   # ○ スプライトセットの作成
  263.   #--------------------------------------------------------------------------
  264.   def create_spriteset
  265.     @spriteset = Spriteset_Map.new
  266.   end
  267.   #--------------------------------------------------------------------------
  268.   # ○ 全ウィンドウの作成
  269.   #--------------------------------------------------------------------------
  270.   def create_all_windows
  271.     [url=home.php?mod=space&uid=37298]@Window[/url]              = Window_Dummy_052.new
  272.     @choices_window      = Window_Choices_Display.new(@index[0])
  273.     @label_window        = Window_Label_Display.new(@item_max)
  274.     @label_window.index  = 0
  275.     @label_window.active = true
  276.   end
  277.   #--------------------------------------------------------------------------
  278.   # ○ フレーム更新 [オーバーライド]
  279.   #--------------------------------------------------------------------------
  280.   def update
  281.     super
  282.     update_choices
  283.     update_input
  284.   end
  285.   #--------------------------------------------------------------------------
  286.   # ○ 選択肢の更新
  287.   #--------------------------------------------------------------------------
  288.   def update_choices
  289.     @choices_window.refresh(@index[@label_window.index])
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # ○ 入力
  293.   #--------------------------------------------------------------------------
  294.   def update_input
  295.     if Input.trigger?(:C)
  296.       Sound.play_ok
  297.       $game_variables[RGSSLAB_052::RESULT_VARIABLE] = @label_window.index + 1
  298.       return_scene
  299.     end
  300.   end
  301.   #--------------------------------------------------------------------------
  302.   # ○ 終了処理 [オーバーライド]
  303.   #--------------------------------------------------------------------------
  304.   def terminate
  305.     super
  306.     dispose_spriteset
  307.   end
  308.   #--------------------------------------------------------------------------
  309.   # ○ スプライトセットの解放
  310.   #--------------------------------------------------------------------------
  311.   def dispose_spriteset
  312.     @spriteset.dispose
  313.   end
  314. end

  315. end
复制代码

评分

参与人数 1梦石 +1 收起 理由
迷糊的安安 + 1 认可答案 附赠66RPG提供的精美好人卡一张^^.

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
179 小时
注册时间
2012-11-14
帖子
94
10
 楼主| 发表于 2012-12-6 14:16:45 | 只看该作者
tseyik 发表于 2012-11-28 17:00
這様?

不好意思好久没上来了..应该就是图片这个样子!
但是日文大丈夫啊,一个生成的代码段,还有一个是選択肢画面...这两个应该怎么使用..选项要在選択肢里面设定么?
万分感谢!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-5-16 13:07

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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