Project1

标题: 请教个关于赵云传2状态栏和名字的问题! [打印本页]

作者: holwar天下    时间: 2008-2-4 05:59
提示: 作者被禁止或删除 内容自动屏蔽
作者: holwar天下    时间: 2008-2-4 07:55
提示: 作者被禁止或删除 内容自动屏蔽
作者: cmbljsw    时间: 2008-2-4 10:52
LZ……要记得哦36小时内不能自顶哦……
你能截上图上来嘛?我没见过呀……
作者: 天圣的马甲    时间: 2008-2-4 11:06
新手提问区磨练读心术啊……{/hx}

人物创建的意思,是吧?
RM默认有一个名称输入处理,将脚本里Window_NameInput的日文换成常见的中文字就行了。

或者用脚本:
http://rpg.blue/web/htm/news196.htm
http://rpg.blue/web/htm/news375.htm
作者: cmbljsw    时间: 2008-2-4 11:09
以下引用天圣的马甲于2008-2-4 3:06:09的发言:

新手提问区磨练读心术啊……

……无语,貌似那个怪物属性还米人有法呢……不知道作者是哪位。
还有问个弱弱的问题,那样不就说话都要搞脚本了?
作者: holwar天下    时间: 2008-2-4 18:33
提示: 作者被禁止或删除 内容自动屏蔽
作者: holwar天下    时间: 2008-2-4 18:35
提示: 作者被禁止或删除 内容自动屏蔽
作者: mikeliuxuan    时间: 2008-2-4 18:47
这是名字脚本(XP中自带 但默认是 日文
  1. )# --------------------------------------------------------------------

  2. # 本脚本来自www.66rpg.com,转载自www.phylomortis.com,转载请保留此信息
  3. # --------------------------------------------------------------------

  4. class Scene_Name
  5.   # -------------------------
  6.   def main
  7.     @actor = $game_actors[$game_temp.name_actor_id]
  8.     @edit_window = Window_NameEdit.new(@actor, $game_temp.name_max_char)
  9.     @input_window = Window_NameInput.new
  10.     @alert_window = Window_Base.new(188, 208, 264, 64)
  11.     @alert_window.contents = Bitmap.new(228, 32)
  12.     @alert_window.contents.font.name = "黑体"
  13.     @alert_window.contents.font.size = 24
  14.     @alert_window.contents.draw_text(0, 0, 228, 32, "你必须输入一个名字")
  15.     @alert_window.z = 1001
  16.     @alert_window.visible = false
  17.     c1 = " English"
  18.     c2 = " ひらがな"
  19.     c3 = " 输入中文"
  20.     c4 = " 输入空格"
  21.     c5 = " 输入退格"
  22.     c6 = " 默认姓名"
  23.     c7 = "   确定"
  24.     commands = [c1, c2, c3, c4, c5, c6, c7]
  25.     @command_window = Window_NameCommand.new(160, commands)
  26.     @input_window.active = false
  27.     @input_window.visible = true
  28.     @command_window.index = 0
  29.     @command_window.visible = true
  30.     @command_window.active = true
  31.     @command_window.x = 0
  32.     @command_window.y = 128
  33.     @command_window.z = 1000
  34.     @alert_count = 0
  35.     Graphics.transition
  36.     loop do
  37.       Graphics.update
  38.       Input.update
  39.       update
  40.       if $scene != self
  41.         break
  42.       end
  43.     end
  44.     Graphics.freeze
  45.     @edit_window.dispose
  46.     @input_window.dispose
  47.     @command_window.dispose
  48.     @alert_window.dispose
  49.   end
  50.   # -------------------------
  51.   def update
  52.     @edit_window.update
  53.     @input_window.update
  54.     @command_window.update
  55.     @alert_window.update
  56.     if @alert_window.visible == true && @alert_count > 0
  57.       @alert_count -= 1
  58.       if @alert_count <= 0
  59.         @command_window.active = true
  60.         @alert_window.visible = false
  61.       end
  62.     return
  63.     end
  64.     if @input_window.active == false
  65.       @command_window.active = true
  66.     end
  67.     if @command_window.active == false
  68.       @input_window.active = true
  69.     end
  70.     if Input.repeat?(Input::B) && @input_window.active == true
  71.       if @edit_window.index == 0
  72.         return
  73.       else
  74.       $game_system.se_play($data_system.cancel_se)
  75.       @edit_window.back
  76.       end
  77.     end
  78.     if Input.repeat?(Input::B) && @command_window.active == true
  79.       $game_system.se_play($data_system.buzzer_se)
  80.       return
  81.     end
  82.     if Input.trigger?(Input::C)
  83.       if @command_window.active == true
  84.         case @command_window.index
  85.         when 0
  86.         $game_system.se_play($data_system.decision_se)
  87.         @input_window.mode = 1
  88.         @input_window.refresh
  89.         @command_window.active = false
  90.         @input_window.active = true
  91.         @input_window.index = 0
  92.         return
  93.         when 1
  94.         $game_system.se_play($data_system.decision_se)
  95.         @input_window.mode = 2
  96.         @input_window.refresh
  97.         @command_window.active = false
  98.         @input_window.active = true
  99.         @input_window.index = 0
  100.         return
  101.         when 2
  102.         $game_system.se_play($data_system.decision_se)
  103.         @input_window.mode = 3
  104.         @input_window.refresh
  105.         @command_window.active = false
  106.         @input_window.active = true
  107.         @input_window.index = 0
  108.         return
  109.         when 3
  110.         if @edit_window.index < $game_temp.name_max_char
  111.           $game_system.se_play($data_system.decision_se)
  112.           @edit_window.add(" ")
  113.         else
  114.           $game_system.se_play($data_system.buzzer_se)
  115.         end
  116.         return
  117.         when 4
  118.         $game_system.se_play($data_system.decision_se)
  119.         @edit_window.back
  120.         return
  121.         when 5
  122.         $game_system.se_play($data_system.decision_se)
  123.         @edit_window.restore_default
  124.         return
  125.         when 6
  126.         if @edit_window.name == ""
  127.           $game_system.se_play($data_system.buzzer_se)
  128.           @alert_window.visible = true
  129.           @command_window.active = false
  130.           @alert_count = 60
  131.           return
  132.         end
  133.           $game_system.se_play($data_system.decision_se)
  134.           @actor.name = @edit_window.name
  135.           $game_system.se_play($data_system.decision_se)
  136.           $scene = Scene_Map.new
  137.           return
  138.         end
  139.        end
  140.       if @edit_window.index == $game_temp.name_max_char &&
  141.         @input_window.active == true
  142.         $game_system.se_play($data_system.buzzer_se)
  143.         return
  144.       end
  145.       if @input_window.character == "" && @input_window.active == true
  146.         $game_system.se_play($data_system.buzzer_se)
  147.         return
  148.       end
  149.      if @input_window.character != nil && @input_window.active == true &&
  150.         @edit_window.index <= $game_temp.name_max_char
  151.       $game_system.se_play($data_system.decision_se)
  152.       if @input_window.mode == 1
  153.         @edit_window.char_type[@edit_window.index] = 1
  154.       else
  155.         @edit_window.char_type[@edit_window.index] = 2
  156.       end
  157.       @edit_window.add(@input_window.character)
  158.       end
  159.       return
  160.       end
  161.   end
  162. end




  163. class Window_NameEdit < Window_Base
  164.   # ---------------------------
  165.   attr_accessor :char_type
  166.   attr_reader   :name
  167.   attr_reader   :index
  168.   # ---------------------------
  169.   def initialize(actor, max_char)
  170.     super(0, 0, 640, 128)
  171.     self.contents = Bitmap.new(width - 32, height - 32)
  172.     @actor = actor
  173.     @name = actor.name
  174.     @max_char = max_char
  175.     @char_type = []
  176.     name_array = @name.split(//)[0...@max_char]
  177.     @name = ""
  178.     for i in 0...name_array.size
  179.       @name += name_array[i]
  180.       @char_type[i] = 1
  181.     end
  182.     @default_name = @name
  183.     @index = name_array.size
  184.     refresh
  185.     update_cursor_rect
  186.   end
  187.   # ---------------------------
  188.   def restore_default
  189.     @name = @default_name
  190.     for i in 0..@default_name.size
  191.        @char_type[i] = 1
  192.     end
  193.     @index = @name.split(//).size
  194.     refresh
  195.     update_cursor_rect
  196.   end
  197.   # ---------------------------
  198.   def add(character)
  199.     if @index < @max_char and character != ""
  200.       @name += character
  201.       @index += 1
  202.       refresh
  203.       update_cursor_rect
  204.     end
  205.   end
  206.   # ---------------------------
  207.   def back
  208.     if @index > 0
  209.       name_array = @name.split(//)
  210.       @name = ""
  211.       for i in 0...name_array.size-1
  212.         @name += name_array[i]
  213.       end
  214.       @index -= 1
  215.       refresh
  216.       update_cursor_rect
  217.     end
  218.   end
  219.   # ---------------------------
  220.   def refresh
  221.     self.contents.clear
  222.     name_array = @name.split(//)
  223.     for i in 0...@max_char
  224.       c = name_array[i]
  225.       if c == nil
  226.         c = "_"
  227.       end
  228.       x = 320 - @max_char * 14 + i * 28
  229.       if @char_type[i] == 1
  230.         self.contents.font.name = "黑体"
  231.         self.contents.font.size = 24
  232.       else
  233.         self.contents.font.name = "黑体"
  234.         self.contents.font.size = 22
  235.       end
  236.       self.contents.draw_text(x, 32, 28, 32, c, 1)
  237.     end
  238.     draw_actor_graphic(@actor, 320 - @max_char * 14 - 40, 80)
  239.   end
  240.   # ---------------------------
  241.   def update_cursor_rect
  242.     x = 320 - @max_char * 14 + @index * 28
  243.     self.cursor_rect.set(x, 32, 28, 32)
  244.   end
  245.   # ---------------------------
  246.   def update
  247.     super
  248.     update_cursor_rect
  249.   end
  250. end




  251. class Window_NameInput < Window_Base
  252.   # ----------------------------------
  253.   attr_accessor :mode
  254.   # ----------------------------------
  255.   ENGLISH_TABLE =
  256.   [
  257.     "A","B","C","D","E",
  258.     "F","G","H","I","J",
  259.     "K","L","M","N","O",
  260.     "P","Q","R","S","T",
  261.     "U","V","W","X","Y",
  262.     "Z","","","","",
  263.     "0","1","2","3","4",
  264.     "5", "6" ,"7", "8" ,"9",
  265.     "","","","","",
  266.     "a", "b" ,"c", "d" ,"e",
  267.     "f","g","h","i","j",
  268.     "k","l","m","n","o",
  269.     "p","q","r","s","t",
  270.     "u","v","w","x","y",
  271.     "z","","","","",
  272.     ".",",","?","!","/",
  273.     "\\","<",">",";",":",
  274.     "","", "" , "" , "" ,
  275.     "@","#","$","%","^",
  276.     "&","*","(",")","",
  277.     "[","]","'","\"","~",
  278.     "良","翔","叶","青","黥",
  279.     "恐","开","御","恺","寇",
  280.     "阔","适","彬","霰","霞",
  281.     "侠","降","鹰","欣","齿",
  282.     "赤","冷","冰","秉","耿",
  283.     "根","更","罡","功","恭",
  284.   ]
  285.   HIRAGANA_TABLE =
  286.   [
  287.     "あ","い","う","え","お",
  288.     "か","き","く","け","こ",
  289.     "さ","し","す","せ","そ",
  290.     "た","ち","つ","て","と",
  291.     "な","に","ぬ","ね","の",
  292.     "は","ひ","ふ","へ","ほ",
  293.     "ま","み","む","め","も",
  294.     "や", "" ,"ゆ", "" ,"よ",
  295.     "ら","り","る","れ","ろ",
  296.     "わ", "" ,"を", "" ,"ん",
  297.     "が","ぎ","ぐ","げ","ご",
  298.     "ざ","じ","ず","ぜ","ぞ",
  299.     "だ","ぢ","づ","で","ど",
  300.     "ば","び","ぶ","べ","ぼ",
  301.     "ぱ","ぴ","ぷ","ぺ","ぽ",
  302.     "ゃ","ゅ","ょ","っ","ゎ",
  303.     "ぁ","ぃ","ぅ","ぇ","ぉ",
  304.     "ー","・", "淫","民","霖" ,
  305.     "巧","小","大","神","灵",
  306.     "月","乐","天","地","人",
  307.     "仙","汉","阳","阴","五",
  308.     "行","杏","星","情","晴",
  309.     "擎","卿","靓","英","雄",
  310.     "勇","士","兵","雷","豹",
  311.     "恶","狼","魔","妖","恒",
  312.     "痕","幻","环","官","才",
  313.     "夫","腾","棠","剪","宾",
  314.     "欣","军","寻","深","嫔",
  315.   ]
  316.   KATAKANA_TABLE =
  317.   [
  318.     "张","王","李","赵","曹",
  319.     "许","刘","郑","周","吴",
  320.     "冯","马","钱","孙","陈",
  321.     "扬","徐","高","胡","朱",
  322.     "林","何","郭","罗","狮",
  323.     "梁","宋","韩","唐","董",
  324.     "萧","程","袁","邓","沈",
  325.     "方","石","谭","熊","金",
  326.     "陆","孔","白","崔","康",
  327.     "毛","秦","江","史","顾",
  328.     "彭","吕","苏","蒋","蔡",
  329.     "贾","魏","薛","叶","余",
  330.     "潘","杜","戴","夏","钟",
  331.     "汪","田","任","姜","范",
  332.     "侯","孟","龙","万","段",
  333.     "汤","离","常","易","武",
  334.     "乔","贺","龚","文","邹",
  335.     "峰","风","封","锋","严",
  336.     "国","华","勇","毅","坚",
  337.     "猛","亮","雨","莹","淑",
  338.     "男","心","夜","珍","伟",
  339.     "波","涛","浩","瀚","炎",
  340.     "言","岩","焰","麟","伦",
  341.     "琴","矜","银","殷","奔",
  342.     "别","剑","姬","疾","精",
  343.     "镜","景","疆","强","将",
  344.     "虹","空","恐","彪","骠",
  345.   ]
  346.   # ----------------------------------
  347.   def initialize
  348.     super(160, 128, 480, 352)
  349.     self.contents = Bitmap.new(width - 32, height - 32)
  350.     self.active = false
  351.     @index = -1
  352.     @mode = 1
  353.     refresh
  354.     update_cursor_rect
  355.   end
  356.   # ----------------------------------
  357.   def index=(value)
  358.     @index = value
  359.     update_cursor_rect
  360.   end
  361.   #--------------------------------------
  362.   def character
  363.     if @mode == 1
  364.     return ENGLISH_TABLE[@index]
  365.   elsif @mode == 2
  366.     return HIRAGANA_TABLE[@index]
  367.   else
  368.     return KATAKANA_TABLE[@index]
  369.     end
  370.   end
  371.   # ----------------------------------
  372.   def refresh
  373.     self.contents.clear
  374.     for i in 0..134
  375.       x = 4 + i / 5 / 9 * 152 + i % 5 * 28
  376.       y = i / 5 % 9 * 32
  377.       if @mode == 1
  378.       self.contents.font.name = "黑体"
  379.       self.contents.font.size = 24
  380.       self.contents.draw_text(x, y, 28, 32, ENGLISH_TABLE[i], 1)
  381.     elsif @mode == 2
  382.       self.contents.font.name = "黑体"
  383.       self.contents.font.size = 22
  384.       self.contents.draw_text(x, y, 28, 32, HIRAGANA_TABLE[i], 1)
  385.     else
  386.       self.contents.font.name = "黑体"
  387.       self.contents.font.size = 22
  388.       self.contents.draw_text(x, y, 28, 32, KATAKANA_TABLE[i], 1)
  389.       end
  390.     end
  391.   end
  392.   # ----------------------------------
  393.   def update_cursor_rect
  394.     if self.active == false
  395.       self.cursor_rect.empty
  396.     else
  397.       x = 4 + @index / 5 / 9 * 152 + @index % 5 * 28
  398.       y = @index / 5 % 9 * 32
  399.       self.cursor_rect.set(x, y, 28, 32)
  400.     end
  401.   end
  402.   # ----------------------------------
  403.   def update
  404.     super
  405.     if @index >= 0 && @index <= 134
  406.       if Input.repeat?(Input::RIGHT)
  407.         $game_system.se_play($data_system.cursor_se)
  408.           if @index % 5 == 4
  409.             if @index < 94
  410.               @index += 41
  411.             end
  412.           else
  413.             @index += 1
  414.           end
  415.         end
  416.       if Input.repeat?(Input::LEFT)
  417.         $game_system.se_play($data_system.cursor_se)
  418.           if @index % 5 == 0
  419.             if @index < 45
  420.               self.active = false
  421.               @index = -999
  422.               return
  423.             else
  424.               @index -= 41
  425.             end
  426.           else
  427.             @index -= 1
  428.           end
  429.       end
  430.       if Input.repeat?(Input::DOWN)
  431.         $game_system.se_play($data_system.cursor_se)
  432.         if @index % 45 < 40
  433.           @index += 5
  434.         end
  435.       end
  436.       if Input.repeat?(Input::UP)
  437.         if Input.trigger?(Input::UP) or @index % 45 >= 5
  438.           $game_system.se_play($data_system.cursor_se)
  439.           if @index % 45 >= 5
  440.             @index -= 5
  441.           end
  442.         end
  443.       end
  444.     end
  445.     update_cursor_rect
  446.   end
  447. end




  448. class Window_NameCommand < Window_Command
  449. # -------------------------------
  450.   def refresh
  451.     self.contents.clear
  452.     for i in 0...@item_max
  453.       if i == 1 or i == 2
  454.         font = 1
  455.         self.contents.font.name = "黑体"
  456.         self.contents.font.size = 22
  457.       else
  458.         font = 0
  459.         self.contents.font.name = "黑体"
  460.         self.contents.font.size = 24
  461.       end
  462.       draw_item(i, normal_color, font)
  463.     end
  464.   end
  465. # -------------------------------
  466. def draw_item(index, color, f)
  467.   if f == 0
  468.     self.contents.font.color = color
  469.     self.contents.font.name = "黑体"
  470.     self.contents.font.size = 24
  471.   else
  472.     self.contents.font.name = "黑体"
  473.     self.contents.font.size = 22
  474.   end
  475.     rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
  476.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  477.     self.contents.draw_text(rect, @commands[index])
  478.   end
  479. end
复制代码



触发一个自动事件。 事件中设定一个更换角色姓名。
[LINE]1,#dddddd[/LINE]脚本太长,已经修改。


作者: 天圣的马甲    时间: 2008-2-4 18:47
哦……= =
早把你那长长的回复打上不就没这么麻烦了= =
如果识别名字不行,就直接识别角色编号不就好了?比如赵云是1号角色,就设置成1_状态栏。
描绘角色编号的语句是actor.id
作者: holwar天下    时间: 2008-2-4 19:10
提示: 作者被禁止或删除 内容自动屏蔽
作者: holwar天下    时间: 2008-2-4 19:11
提示: 作者被禁止或删除 内容自动屏蔽
作者: holwar天下    时间: 2008-2-4 19:18
提示: 作者被禁止或删除 内容自动屏蔽
作者: holwar天下    时间: 2008-2-4 20:24
提示: 作者被禁止或删除 内容自动屏蔽
作者: holwar天下    时间: 2008-2-4 20:25
提示: 作者被禁止或删除 内容自动屏蔽
作者: holwar天下    时间: 2008-2-4 21:14
提示: 作者被禁止或删除 内容自动屏蔽
作者: holwar天下    时间: 2008-2-4 21:34
提示: 作者被禁止或删除 内容自动屏蔽
作者: holwar天下    时间: 2008-2-6 05:45
提示: 作者被禁止或删除 内容自动屏蔽
作者: 沉影不器    时间: 2008-2-6 06:01
提示: 作者被禁止或删除 内容自动屏蔽
作者: holwar天下    时间: 2008-2-7 19:44
提示: 作者被禁止或删除 内容自动屏蔽
作者: 纯子    时间: 2008-2-7 20:03
class Window_CharStatus找到def draw_name
testname = actor.name.to_s + "_状态栏"把name改id,图片名字都改角色id。。。 [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: holwar天下    时间: 2008-2-7 20:15
提示: 作者被禁止或删除 内容自动屏蔽
作者: 纯子    时间: 2008-2-7 21:56
没问题啊,我试过了
作者: holwar天下    时间: 2008-2-8 01:29
提示: 作者被禁止或删除 内容自动屏蔽
作者: 天圣的马甲    时间: 2009-6-12 08:00
66RPG的官方脚本应该是自动根据战斗图选择头像……如果那个赵云传真的是用了这个整合脚本的话。
我在66RPG的官方脚本工程里利用名称输入处理修改了角色的姓名,并没有出现读取头像失败的问题。
整合脚本在这里,你下载看看:http://rpg.blue/web/htm/dj16.htm

此外如果方便,把那个赵云传的脚本文件打包传上来吧。




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1