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

Project1

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

[已经解决] RPG Maker XP怎么做刚进游戏,人物自定名字的版面?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
105
在线时间
4 小时
注册时间
2012-6-26
帖子
3
跳转到指定楼层
1
发表于 2012-6-26 19:50:41 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
RPG Maker XP软件怎么做刚进游戏,人物自设名字的版面?像给你一排字,让你自己选字做成名字的那种(比如重装机兵)。新人求教啊!{:2_270:}

Lv2.观梦者

梦石
0
星屑
266
在线时间
122 小时
注册时间
2010-12-23
帖子
179
2
发表于 2012-6-26 20:42:45 | 只看该作者

这是系统默认的自定名字

而排版的话也可以自己写脚本

另外请擅用搜索

搜索关键字"名字"

然后就是,要是,只是我说的系统默认的这东西话,请看"版务"
- -作图太麻烦了,又是PS又是素材的
还不如玩游戏实际- -嗯嗯,娱乐就好!!

=====================
神马都简单,但是需要时间&精力,虽然我时间很多,但是专注一样东西的精力- -
====================
回复

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

3
发表于 2012-6-26 20:52:09 | 只看该作者
新建事件→打开事件指令第三页→名称输入处理,设定位数为X位(X为8的时候,角色名字最多是8个汉字或数字英文或者混合,如“LZ他不4hcm”等···)
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
105
在线时间
4 小时
注册时间
2012-6-26
帖子
3
4
 楼主| 发表于 2012-6-26 20:57:59 | 只看该作者
双叶GL 发表于 2012-6-26 20:42
这是系统默认的自定名字

而排版的话也可以自己写脚本

”排版的话也可以自己写脚本“怎么写啊?
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
111 小时
注册时间
2012-4-21
帖子
299
5
发表于 2012-6-28 14:13:44 | 只看该作者
直接脚本。如下:


  1. #==============================================================================
  2. # 本脚本来自www.66RPG.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.   # ----------------------------------
  348.   def initialize
  349.     super(160, 128, 480, 352)
  350.     self.contents = Bitmap.new(width - 32, height - 32)
  351.     self.active = false
  352.     @index = -1
  353.     @mode = 1
  354.     refresh
  355.     update_cursor_rect
  356.   end
  357.   # ----------------------------------
  358.   def index=(value)
  359.     @index = value
  360.     update_cursor_rect
  361.   end
  362.   #--------------------------------------
  363.   def character
  364.     if @mode == 1
  365.     return ENGLISH_TABLE[@index]
  366.   elsif @mode == 2
  367.     return HIRAGANA_TABLE[@index]
  368.   else
  369.     return KATAKANA_TABLE[@index]
  370.     end
  371.   end
  372.   # ----------------------------------
  373.   def refresh
  374.     self.contents.clear
  375.     for i in 0..134
  376.       x = 4 + i / 5 / 9 * 152 + i % 5 * 28
  377.       y = i / 5 % 9 * 32
  378.       if @mode == 1
  379.       self.contents.font.name = "黑体"
  380.       self.contents.font.size = 24
  381.       self.contents.draw_text(x, y, 28, 32, ENGLISH_TABLE[i], 1)
  382.     elsif @mode == 2
  383.       self.contents.font.name = "黑体"
  384.       self.contents.font.size = 22
  385.       self.contents.draw_text(x, y, 28, 32, HIRAGANA_TABLE[i], 1)
  386.     else
  387.       self.contents.font.name = "黑体"
  388.       self.contents.font.size = 22
  389.       self.contents.draw_text(x, y, 28, 32, KATAKANA_TABLE[i], 1)
  390.       end
  391.     end
  392.   end
  393.   # ----------------------------------
  394.   def update_cursor_rect
  395.     if self.active == false
  396.       self.cursor_rect.empty
  397.     else
  398.       x = 4 + @index / 5 / 9 * 152 + @index % 5 * 28
  399.       y = @index / 5 % 9 * 32
  400.       self.cursor_rect.set(x, y, 28, 32)
  401.     end
  402.   end
  403.   # ----------------------------------
  404.   def update
  405.     super
  406.     if @index >= 0 && @index <= 134
  407.       if Input.repeat?(Input::RIGHT)
  408.         $game_system.se_play($data_system.cursor_se)
  409.           if @index % 5 == 4
  410.             if @index < 94
  411.               @index += 41
  412.             end
  413.           else
  414.             @index += 1
  415.           end
  416.         end
  417.       if Input.repeat?(Input::LEFT)
  418.         $game_system.se_play($data_system.cursor_se)
  419.           if @index % 5 == 0
  420.             if @index < 45
  421.               self.active = false
  422.               @index = -999
  423.               return
  424.             else
  425.               @index -= 41
  426.             end
  427.           else
  428.             @index -= 1
  429.           end
  430.       end
  431.       if Input.repeat?(Input::DOWN)
  432.         $game_system.se_play($data_system.cursor_se)
  433.         if @index % 45 < 40
  434.           @index += 5
  435.         end
  436.       end
  437.       if Input.repeat?(Input::UP)
  438.         if Input.trigger?(Input::UP) or @index % 45 >= 5
  439.           $game_system.se_play($data_system.cursor_se)
  440.           if @index % 45 >= 5
  441.             @index -= 5
  442.           end
  443.         end
  444.       end
  445.     end
  446.     update_cursor_rect
  447.   end
  448. end




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

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


然后在事件中:






就OK了。

评分

参与人数 1星屑 +100 收起 理由
hcm + 100 感谢回答

查看全部评分

哇哈哈哈!祝你吃面吃到鼻孔里!
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
67
在线时间
39 小时
注册时间
2011-10-1
帖子
82
6
发表于 2012-7-19 18:45:36 | 只看该作者
好长好长哦脚本啊

评分

参与人数 1星屑 -20 收起 理由
懒De说 -20 这里不适合酱油

查看全部评分

回复

使用道具 举报

Lv2.观梦者

梦石
0
星屑
654
在线时间
336 小时
注册时间
2012-2-4
帖子
1767
7
发表于 2012-7-20 10:32:00 | 只看该作者
不用那么长,直接 打开脚本里的,然后把红框里的字改一下: ,最后 即可!!
(先把主角名改为  (空)   。)

回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
67
在线时间
39 小时
注册时间
2011-10-1
帖子
82
8
发表于 2012-7-20 10:58:48 | 只看该作者
小学生 发表于 2012-7-20 10:32
不用那么长,直接 打开脚本里的,然后把红框里的字改一下:,最后即可!!
(先把主角名改为  (空)   。 ...

11区字....不认识

点评

好象没有  发表于 2012-7-20 13:05
你说这句话对于解决这个问题有帮助吗? - -  发表于 2012-7-20 12:59

评分

参与人数 1星屑 -20 收起 理由
懒De说 -20 这很有意思?

查看全部评分

回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
229
在线时间
596 小时
注册时间
2010-6-21
帖子
1218
9
发表于 2012-7-21 10:58:39 | 只看该作者
如果要玩家选字的话,事件里就一有一个名字输入,如果玩家可以自己打字的话,就搜索脚本,角色创建
如果我是一个美工就好啦!
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-23 12:56

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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