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

Project1

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

关于角色换位的一些改进

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
3 小时
注册时间
2007-12-22
帖子
73
跳转到指定楼层
1
发表于 2007-12-29 00:18:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
已知1:
将角色行走图重置为队伍第一个人的脚本为:
$game_player.refresh

已知2:
调整人物顺序脚本为:

  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. class Scene_Menu
  5. # --------------------------------
  6.   def initialize(menu_index = 0)
  7.     @menu_index = menu_index
  8.     @changer = 0
  9.     @where = 0
  10.     @checker = 0
  11.   end
  12. # --------------------------------
  13.   def main
  14.     s1 = $data_system.words.item
  15.     s2 = $data_system.words.skill
  16.     s3 = $data_system.words.equip
  17.     s4 = "状态"
  18.     s5 = "储存进度"
  19.     s6 = "离开游戏"
  20.     s7 = "调整队伍"
  21.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
  22.     @command_window.index = @menu_index
  23.     if $game_party.actors.size == 0
  24.       @command_window.disable_item(0)
  25.       @command_window.disable_item(1)
  26.       @command_window.disable_item(2)
  27.       @command_window.disable_item(3)
  28.     end
  29.     if $game_system.save_disabled
  30.       @command_window.disable_item(4)
  31.     end
  32.     if $game_party.actors.size == 1
  33.       @command_window.disable_item(6)
  34.     end
  35.     @playtime_window = Window_PlayTime.new
  36.     @playtime_window.x = 0
  37.     @playtime_window.y = 256
  38.     @gold_window = Window_Gold.new
  39.     @gold_window.x = 0
  40.     @gold_window.y = 416
  41.     @status_window = Window_MenuStatus.new
  42.     @status_window.x = 160
  43.     @status_window.y = 0
  44.     Graphics.transition
  45.     loop do
  46.       Graphics.update
  47.       Input.update
  48.       update
  49.       if $scene != self
  50.         break
  51.       end
  52.     end
  53.     Graphics.freeze
  54.     @command_window.dispose
  55.     @playtime_window.dispose
  56.     @gold_window.dispose
  57.     @status_window.dispose
  58.   end
  59. # --------------------------------
  60.   def update
  61.     @command_window.update
  62.     @playtime_window.update
  63.     @gold_window.update
  64.     @status_window.update
  65.     if @command_window.active
  66.       update_command
  67.       return
  68.     end
  69.     if @status_window.active
  70.       update_status
  71.       return
  72.     end
  73.   end
  74. # --------------------------------
  75.   def update_command
  76.     if Input.trigger?(Input::B)
  77.       $game_system.se_play($data_system.cancel_se)
  78.       $scene = Scene_Map.new
  79.       return
  80.     end
  81.     if Input.trigger?(Input::C)
  82.       if $game_party.actors.size == 0 and @command_window.index < 4
  83.         $game_system.se_play($data_system.buzzer_se)
  84.         return
  85.       end
  86.       if $game_party.actors.size == 1 and @command_window.index ==6
  87.         $game_system.se_play($data_system.buzzer_se)
  88.         return
  89.       end
  90.       case @command_window.index
  91.       when 0
  92.         $game_system.se_play($data_system.decision_se)
  93.         $scene = Scene_Item.new
  94.       when 1
  95.         $game_system.se_play($data_system.decision_se)
  96.         @command_window.active = false
  97.         @status_window.active = true
  98.         @status_window.index = 0
  99.       when 2
  100.         $game_system.se_play($data_system.decision_se)
  101.         @command_window.active = false
  102.         @status_window.active = true
  103.         @status_window.index = 0
  104.       when 3
  105.         $game_system.se_play($data_system.decision_se)
  106.         @command_window.active = false
  107.         @status_window.active = true
  108.         @status_window.index = 0
  109.       when 4
  110.         if $game_system.save_disabled
  111.           $game_system.se_play($data_system.buzzer_se)
  112.           return
  113.         end
  114.         $game_system.se_play($data_system.decision_se)
  115.         $scene = Scene_Save.new
  116.       when 5
  117.         $game_system.se_play($data_system.decision_se)
  118.         $scene = Scene_End.new
  119.       when 6
  120.         $game_system.se_play($data_system.decision_se)
  121.         @checker = 0
  122.         @command_window.active = false
  123.         @status_window.active = true
  124.         @status_window.index = 0
  125.       end
  126.       return
  127.     end
  128.   end
  129. # --------------------------------
  130.   def update_status
  131.     if Input.trigger?(Input::B)
  132.       $game_system.se_play($data_system.cancel_se)
  133.       @command_window.active = true
  134.       @status_window.active = false
  135.       @status_window.index = -1
  136.       return
  137.     end
  138.     if Input.trigger?(Input::C)
  139.       case @command_window.index
  140.       when 1
  141.         if $game_party.actors[@status_window.index].restriction >= 2
  142.           $game_system.se_play($data_system.buzzer_se)
  143.           return
  144.         end
  145.         $game_system.se_play($data_system.decision_se)
  146.         $scene = Scene_Skill.new(@status_window.index)
  147.       when 2
  148.         $game_system.se_play($data_system.decision_se)
  149.         $scene = Scene_Equip.new(@status_window.index)
  150.       when 3
  151.         $game_system.se_play($data_system.decision_se)
  152.         $scene = Scene_Status.new(@status_window.index)
  153.       when 6
  154.         $game_system.se_play($data_system.decision_se)
  155.         if @checker == 0
  156.           @changer = $game_party.actors[@status_window.index]
  157.           @where = @status_window.index
  158.           @checker = 1
  159.         else
  160.           $game_party.actors[@where] = $game_party.actors[@status_window.index]
  161.           $game_party.actors[@status_window.index] = @changer
  162.           @checker = 0
  163.           @status_window.refresh
  164.         end
  165.       end
  166.       return
  167.     end
  168.   end
  169. end


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



求修饰效果如下:

1.当人物调整后,角色的行走图自动换成队伍第一人。

2.将[调整队伍]的位置改至[状态]和[储存游戏]之间。


有谁能帮帮忙~
狐狸在此谢过了~
本贴由论坛斑竹心情de对白结贴,如楼主认为问题未解决,请重新将此贴编辑为“有事请教”,并回帖叙述疑点即可~ ^-^

Lv1.梦旅人

梦石
0
星屑
50
在线时间
3 小时
注册时间
2007-12-22
帖子
73
2
 楼主| 发表于 2007-12-29 00:18:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
已知1:
将角色行走图重置为队伍第一个人的脚本为:
$game_player.refresh

已知2:
调整人物顺序脚本为:

  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. class Scene_Menu
  5. # --------------------------------
  6.   def initialize(menu_index = 0)
  7.     @menu_index = menu_index
  8.     @changer = 0
  9.     @where = 0
  10.     @checker = 0
  11.   end
  12. # --------------------------------
  13.   def main
  14.     s1 = $data_system.words.item
  15.     s2 = $data_system.words.skill
  16.     s3 = $data_system.words.equip
  17.     s4 = "状态"
  18.     s5 = "储存进度"
  19.     s6 = "离开游戏"
  20.     s7 = "调整队伍"
  21.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
  22.     @command_window.index = @menu_index
  23.     if $game_party.actors.size == 0
  24.       @command_window.disable_item(0)
  25.       @command_window.disable_item(1)
  26.       @command_window.disable_item(2)
  27.       @command_window.disable_item(3)
  28.     end
  29.     if $game_system.save_disabled
  30.       @command_window.disable_item(4)
  31.     end
  32.     if $game_party.actors.size == 1
  33.       @command_window.disable_item(6)
  34.     end
  35.     @playtime_window = Window_PlayTime.new
  36.     @playtime_window.x = 0
  37.     @playtime_window.y = 256
  38.     @gold_window = Window_Gold.new
  39.     @gold_window.x = 0
  40.     @gold_window.y = 416
  41.     @status_window = Window_MenuStatus.new
  42.     @status_window.x = 160
  43.     @status_window.y = 0
  44.     Graphics.transition
  45.     loop do
  46.       Graphics.update
  47.       Input.update
  48.       update
  49.       if $scene != self
  50.         break
  51.       end
  52.     end
  53.     Graphics.freeze
  54.     @command_window.dispose
  55.     @playtime_window.dispose
  56.     @gold_window.dispose
  57.     @status_window.dispose
  58.   end
  59. # --------------------------------
  60.   def update
  61.     @command_window.update
  62.     @playtime_window.update
  63.     @gold_window.update
  64.     @status_window.update
  65.     if @command_window.active
  66.       update_command
  67.       return
  68.     end
  69.     if @status_window.active
  70.       update_status
  71.       return
  72.     end
  73.   end
  74. # --------------------------------
  75.   def update_command
  76.     if Input.trigger?(Input::B)
  77.       $game_system.se_play($data_system.cancel_se)
  78.       $scene = Scene_Map.new
  79.       return
  80.     end
  81.     if Input.trigger?(Input::C)
  82.       if $game_party.actors.size == 0 and @command_window.index < 4
  83.         $game_system.se_play($data_system.buzzer_se)
  84.         return
  85.       end
  86.       if $game_party.actors.size == 1 and @command_window.index ==6
  87.         $game_system.se_play($data_system.buzzer_se)
  88.         return
  89.       end
  90.       case @command_window.index
  91.       when 0
  92.         $game_system.se_play($data_system.decision_se)
  93.         $scene = Scene_Item.new
  94.       when 1
  95.         $game_system.se_play($data_system.decision_se)
  96.         @command_window.active = false
  97.         @status_window.active = true
  98.         @status_window.index = 0
  99.       when 2
  100.         $game_system.se_play($data_system.decision_se)
  101.         @command_window.active = false
  102.         @status_window.active = true
  103.         @status_window.index = 0
  104.       when 3
  105.         $game_system.se_play($data_system.decision_se)
  106.         @command_window.active = false
  107.         @status_window.active = true
  108.         @status_window.index = 0
  109.       when 4
  110.         if $game_system.save_disabled
  111.           $game_system.se_play($data_system.buzzer_se)
  112.           return
  113.         end
  114.         $game_system.se_play($data_system.decision_se)
  115.         $scene = Scene_Save.new
  116.       when 5
  117.         $game_system.se_play($data_system.decision_se)
  118.         $scene = Scene_End.new
  119.       when 6
  120.         $game_system.se_play($data_system.decision_se)
  121.         @checker = 0
  122.         @command_window.active = false
  123.         @status_window.active = true
  124.         @status_window.index = 0
  125.       end
  126.       return
  127.     end
  128.   end
  129. # --------------------------------
  130.   def update_status
  131.     if Input.trigger?(Input::B)
  132.       $game_system.se_play($data_system.cancel_se)
  133.       @command_window.active = true
  134.       @status_window.active = false
  135.       @status_window.index = -1
  136.       return
  137.     end
  138.     if Input.trigger?(Input::C)
  139.       case @command_window.index
  140.       when 1
  141.         if $game_party.actors[@status_window.index].restriction >= 2
  142.           $game_system.se_play($data_system.buzzer_se)
  143.           return
  144.         end
  145.         $game_system.se_play($data_system.decision_se)
  146.         $scene = Scene_Skill.new(@status_window.index)
  147.       when 2
  148.         $game_system.se_play($data_system.decision_se)
  149.         $scene = Scene_Equip.new(@status_window.index)
  150.       when 3
  151.         $game_system.se_play($data_system.decision_se)
  152.         $scene = Scene_Status.new(@status_window.index)
  153.       when 6
  154.         $game_system.se_play($data_system.decision_se)
  155.         if @checker == 0
  156.           @changer = $game_party.actors[@status_window.index]
  157.           @where = @status_window.index
  158.           @checker = 1
  159.         else
  160.           $game_party.actors[@where] = $game_party.actors[@status_window.index]
  161.           $game_party.actors[@status_window.index] = @changer
  162.           @checker = 0
  163.           @status_window.refresh
  164.         end
  165.       end
  166.       return
  167.     end
  168.   end
  169. end


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



求修饰效果如下:

1.当人物调整后,角色的行走图自动换成队伍第一人。

2.将[调整队伍]的位置改至[状态]和[储存游戏]之间。


有谁能帮帮忙~
狐狸在此谢过了~
本贴由论坛斑竹心情de对白结贴,如楼主认为问题未解决,请重新将此贴编辑为“有事请教”,并回帖叙述疑点即可~ ^-^

Lv1.梦旅人

梦石
0
星屑
50
在线时间
3 小时
注册时间
2007-12-22
帖子
73
3
 楼主| 发表于 2007-12-29 17:08:34 | 只看该作者
贴子快沉到海底了~

只好自己顶一下......(犯规了,5555,要被扣分了)


有懂得脚本的朋友,愿意帮忙修改一下么?

狐狸最近也在学脚本,不过似懂非懂的~

试着改了几次,都出错,也不知道是怎么回事.(看来是RP太差的缘故)
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2026-6-19 23:22

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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