查看: 2109|回复: 1

[已经过期] 如何修改人物创建脚本?

[复制链接]
梦石
0
星屑
50
在线时间
16 小时
注册时间
2013-11-1
回帖
4
发表于 2014-2-26 14:53:00 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 丿梁丶小柒 于 2014-2-26 21:56 编辑
  1. #==============================================================================
  2. # 角色创建脚本
  3. #
  4. # 原作者:不详
  5. # 整合:bb崽 亿万星辰
  6. #==============================================================================
  7. # ■ Scene_Create
  8. #------------------------------------------------------------------------------
  9. #  自定义创建一个新角色
  10. #==============================================================================
  11. class Scene_Create

  12.   #--------------------------------------------------------------------------
  13.   # ● 主处理
  14.   #--------------------------------------------------------------------------
  15.   def main
  16.     # 生成索引
  17.     [url=home.php?mod=space&uid=370741]@Index[/url] = 0
  18.     # 生成窗口
  19.     @create_window = Window_Create.new
  20.     @create_window.index = 0
  21.     # 执行过渡
  22.     Graphics.transition
  23.     # 主循环
  24.     loop do
  25.       Graphics.frame_reset
  26.       # 刷新游戏画面
  27.       Graphics.update
  28.       # 刷新输入情报
  29.       Input.update
  30.       # 刷新画面
  31.       update
  32.       # 如果画面被切换的话就中断循环
  33.       if $scene != self
  34.         break
  35.       end
  36.     end
  37.     # 准备过渡
  38.     Graphics.freeze
  39.     # 释放窗口
  40.     @create_window.dispose
  41.   end
  42.   
  43.   #--------------------------------------------------------------------------
  44.   # ● 选择退出
  45.   #--------------------------------------------------------------------------
  46.   def on_cancel
  47.     # 播放取消SE
  48.     $game_system.se_play($data_system.cancel_se)
  49.     # 切换画面
  50.     $scene = Scene_Title.new
  51.   end
  52.   
  53.   #--------------------------------------------------------------------------
  54.   # ● 改变角色名称
  55.   #--------------------------------------------------------------------------
  56.   def change_name
  57.     if Input.trigger?(Input::C)
  58.       Sound.play_decision
  59.       # 下面包含了三种起名的方法
  60.       # 方式一是RMXP默认的选字起名
  61.       # 方式二是通过外挂dll来实现用系统的输入法来输入名称
  62.       # 方式三则是用BB崽和亿万星辰一同开发的RM输入法来实现名称输入
  63.       # 三种方式只能选一种哦!
  64.       
  65.       #$game_temp.name_actor_id = 1  # 角色ID
  66.       #$game_temp.name_max_char = 16 # 名字长度
  67.       #$scene = Scene_Name.new  # 起名方式1
  68.       
  69.       #$game_temp.name_actor_id = 1  # 起名方式2
  70.       #ActorNameInput(1)             # 起名方式2
  71.       
  72.       $game_temp.name_actor_id = 1  # 角色ID
  73.       $game_temp.name_max_char = 16 # 名字长度
  74.       $scene = Scene_Name_CHN.new  # 起名方式3
  75.     end
  76.   end
  77.   
  78.   #--------------------------------------------------------------------------
  79.   # ● 改变角色性别
  80.   #--------------------------------------------------------------------------
  81.   def change_gender
  82.     if Input.trigger?(Input::LEFT)
  83.       Sound.play_cursor
  84.       $gender = "男"
  85.       RPG::GRAPHIC.new
  86.       $game_actors[1].style_id = 0
  87.       return
  88.     elsif Input.trigger?(Input::RIGHT)
  89.       Sound.play_cursor
  90.       $gender = "女"
  91.       RPG::GRAPHIC.new
  92.       $game_actors[1].style_id = 0
  93.       return
  94.     end   
  95.   end
  96.   
  97.   #--------------------------------------------------------------------------
  98.   # ● 改变角色职业
  99.   #--------------------------------------------------------------------------
  100.   def change_class
  101.     if Input.trigger?(Input::LEFT)
  102.       Sound.play_cursor
  103.       $game_actors[1].class_id -= 1
  104.       $game_actors[1].style_id = 0
  105.       return
  106.     elsif Input.trigger?(Input::RIGHT)
  107.       Sound.play_cursor
  108.       $game_actors[1].class_id += 1
  109.       $game_actors[1].style_id = 0
  110.       return
  111.     end  
  112.   end
  113.   
  114.   #--------------------------------------------------------------------------
  115.   # ● 改变角色样式
  116.   #--------------------------------------------------------------------------
  117.   def change_style
  118.     if Input.trigger?(Input::LEFT)
  119.       Sound.play_cursor
  120.       $game_actors[1].style_id -= 1
  121.       return
  122.     elsif Input.trigger?(Input::RIGHT)
  123.       Sound.play_cursor
  124.       $game_actors[1].style_id += 1
  125.       return
  126.     end
  127.   end
  128.   
  129.   #--------------------------------------------------------------------------
  130.   # ● 创建完毕
  131.   #--------------------------------------------------------------------------
  132.   def create
  133.     if Input.trigger?(Input::C)
  134.       Sound.play_decision
  135.       $game_actors[1].style_id = $game_actors[1].style_id
  136.       for s in $game_actors[1].skills
  137.         $game_actors[1].forget_skill(s)
  138.       end
  139.       for s in $data_classes[$game_actors[1].class_id].learnings
  140.         if s.level == 1
  141.           $game_actors[1].learn_skill(s.skill_id)
  142.         end
  143.       end
  144.       $scene = Scene_Map.new
  145.     end
  146.   end
  147.   
  148.   #--------------------------------------------------------------------------
  149.   # ● 控制处理
  150.   #--------------------------------------------------------------------------
  151.   def update_commands
  152.     if Input.trigger?(Input::B)
  153.       on_cancel
  154.     elsif Input.trigger?(Input::UP)
  155.       Sound.play_cursor
  156.       [url=home.php?mod=space&uid=370741]@Index[/url] = (@index + 4) % 5
  157.       @create_window.index = @index
  158.       return
  159.     elsif Input.trigger?(Input::DOWN)
  160.       Sound.play_cursor        
  161.       @index = (@index + 1) % 5
  162.       @create_window.index = @index
  163.       return
  164.     end
  165.   end   
  166.   
  167.   #--------------------------------------------------------------------------
  168.   # ● 刷新
  169.   #--------------------------------------------------------------------------
  170.   def update
  171.     case @index   
  172.     when 0
  173.       change_name
  174.     when 1  
  175.       change_gender
  176.     when 2
  177.       change_class  
  178.     when 3
  179.       change_style
  180.     when 4
  181.       create
  182.     end
  183.     update_commands   
  184.     @create_window.update
  185.   end
  186. end
复制代码




这里应该怎么修改啊?达到可以选择职业,出来对应的属性的效果呢?  

人物创建v1.01.zip

529.57 KB, 下载次数: 131

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部