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

Project1

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

[已经解决] 脚本重复上回合动作 v1.1出现了问题如何解决?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
235
在线时间
3 小时
注册时间
2013-8-16
帖子
2
跳转到指定楼层
1
发表于 2013-8-16 13:05:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
新人求教。
脚本链接:http://www.66rpg.com/articles/3170
出现的问题是游戏测试时出现了一个对话框:“脚本的第152行发生了SyntaxError。”
第152行是这个:         if a.skill_learn?(skill_id) and \
我对脚本一窍不通,还请各位帮我解决一下,感激不尽。

Lv1.梦旅人

梦石
0
星屑
50
在线时间
24 小时
注册时间
2013-8-13
帖子
21
2
发表于 2013-8-19 21:31:11 | 只看该作者
本帖最后由 ljwlove1995 于 2013-8-19 22:54 编辑

解决了~~~

复制这个脚本即可解决
  1. #==============================================================================
  2. # 本脚本来自[url]www.66rpg.com[/url],转载和使用请保留此信息  
  3. #重复上回合动作  v1.1
  4. #by 叶子       Date: 12-12-2005
  5. #QQ:121058265
  6. #本脚本根据66rpg的站长柳柳提出的思路制作
  7. #如发现有bug请与作者联系或上66rpg发贴说明
  8. #==============================================================================
  9. #当战斗时按下T键,
  10. #当前角色就会重复上回合的动作(包括攻击,特技,防御,物品)。
  11. #当战斗时按下R键,
  12. #所有角色就会重复上回合的动作。
  13. #当战斗时按下F键,
  14. #所有角色就会普通攻击同一个敌人。
  15. #脚本占用了第一号开关。
  16. #当第一号开关打开时,重复上回合动作功能关闭。
  17. #如果想用其他开关,改第130,263,323行中相应内容。
  18. #--------------------------------------------------------------------------
  19. class Game_Battler
  20. #--------------------------------------------------------------------------
  21. # ● 初始化对像
  22. #--------------------------------------------------------------------------
  23. def initialize
  24.    @battler_name = ""
  25.    @battler_hue = 0
  26.    @hp = 0
  27.    @sp = 0
  28.    @states = []
  29.    @states_turn = {}
  30.    @maxhp_plus = 0
  31.    @maxsp_plus = 0
  32.    @str_plus = 0
  33.    @dex_plus = 0
  34.    @agi_plus = 0
  35.    @int_plus = 0
  36.    @hidden = false
  37.    @immortal = false
  38.    @damage_pop = false
  39.    @damage = nil
  40.    @critical = false
  41.    @animation_id = 0
  42.    @animation_hit = false
  43.    @white_flash = false
  44.    @blink = false
  45.    @current_action = Game_BattleAction.new
  46.    @last_action = Game_BattleAction.new
  47. end
  48. #--------------------------------------------------------------------------
  49. # ● 获取前一回合的动作
  50. #--------------------------------------------------------------------------
  51. def last_action
  52.    return @last_action
  53. end
  54. end

  55. class Game_Party
  56. def last_actions
  57.    for actor in @actors
  58.      actor.last_action.kind = actor.current_action.kind
  59.      actor.last_action.basic = actor.current_action.basic
  60.      actor.last_action.forcing = actor.current_action.forcing
  61.      actor.last_action.target_index = actor.current_action.target_index
  62.      actor.last_action.skill_id = actor.current_action.skill_id
  63.      actor.last_action.item_id = actor.current_action.item_id
  64.    end
  65. end
  66. end

  67. class Scene_Battle
  68. #--------------------------------------------------------------------------
  69. # ● 开始同伴命令回合
  70. #--------------------------------------------------------------------------
  71. def start_phase2
  72.    # 转移到回合 2
  73.    @phase = 2
  74.    # 设置角色为非选择状态
  75.    @actor_index = -1
  76.    @active_battler = nil
  77.    # 有效化同伴指令窗口
  78.    @party_command_window.active = true
  79.    @party_command_window.visible = true
  80.    # 无效化角色指令窗口
  81.    @actor_command_window.active = false
  82.    @actor_command_window.visible = false
  83.    # 清除主回合标志
  84.    $game_temp.battle_main_phase = false
  85.    # 记录行动
  86.    $game_party.last_actions
  87.    # 清除全体同伴的行动
  88.    $game_party.clear_actions
  89.    # 不能输入命令的情况下
  90.    unless $game_party.inputable?
  91.      # 开始主回合
  92.      start_phase4
  93.    end
  94. end
  95. #--------------------------------------------------------------------------
  96. # ● 刷新画面 (同伴命令回合)
  97. #--------------------------------------------------------------------------
  98. def update_phase2
  99.    # 按下 C 键的情况下
  100.    if Input.trigger?(Input::C)
  101.      # 同伴指令窗口光标位置分支
  102.      case @party_command_window.index
  103.      when 0  # 战斗
  104.        # 演奏确定 SE
  105.        $game_system.se_play($data_system.decision_se)
  106.        # 开始角色的命令回合
  107.        start_phase3
  108.      when 1  # 逃跑
  109.        # 不能逃跑的情况下
  110.        if $game_temp.battle_can_escape == false
  111.          # 演奏冻结 SE
  112.          $game_system.se_play($data_system.buzzer_se)
  113.          return
  114.        end
  115.        # 演奏确定 SE
  116.        $game_system.se_play($data_system.decision_se)
  117.        # 逃走处理
  118.        update_phase2_escape
  119.      end
  120.      return
  121.    end
  122.    #------------------------------
  123.    # 按下 R 键的情况下
  124.    #------------------------------
  125.    if Kboard.keyboard($R_Key_R)
  126.      #如果一号开关打开就禁止重复上回合动作
  127.      if $game_switches[1] == true #开关号可以改,把那个1改成你要的开关号
  128.        # 演奏冻结 SE
  129.        $game_system.se_play($data_system.buzzer_se)
  130.        return
  131.      end
  132.      for a in $game_party.actors
  133.        if a.inputable?
  134.          case a.last_action.kind
  135.          when 0  # 攻击,防御
  136.            #防御
  137.            if a.last_action.basic == 1
  138.              # 设置行动
  139.              a.current_action.kind = 0
  140.              a.current_action.basic = 1
  141.              #攻击
  142.              else
  143.              # 设置行动
  144.              a.current_action.kind = 0
  145.              a.current_action.basic = 0
  146.              a.current_action.target_index = a.last_action.target_index
  147.            end
  148.          when 1  # 特技
  149.          skill_id = a.last_action.skill_id
  150.          if a.skill_learn?(skill_id) and  
  151.            a.skill_can_use?(skill_id)
  152.            # 设置行动
  153.            a.current_action.kind = 1
  154.            a.current_action.skill_id = a.last_action.skill_id
  155.            a.current_action.target_index = a.last_action.target_index
  156.          else
  157.            # 不能使用就攻击
  158.            if $data_skills[skill_id].scope < 3
  159.              a.current_action.kind = 0
  160.              a.current_action.basic = 0
  161.              a.current_action.target_index = a.last_action.target_index
  162.            else
  163.              a.current_action.kind = 0
  164.              a.current_action.basic = 0
  165.              a.current_action.target_index = 0
  166.            end
  167.          end
  168.          when 2  # 物品
  169.            item_id = a.last_action.item_id
  170.            if $game_party.item_can_use?(item_id)
  171.              # 设置行动
  172.              a.current_action.kind = 2
  173.              a.current_action.item_id = a.last_action.item_id
  174.              a.current_action.target_index = a.last_action.target_index
  175.            else
  176.              # 不能使用就攻击
  177.              a.current_action.kind = 0
  178.              a.current_action.basic = 0
  179.              a.current_action.target_index = 0
  180.            end
  181.          end
  182.        end
  183.      end
  184.      # 演奏确定 SE
  185.      $game_system.se_play($data_system.decision_se)
  186.      start_phase4
  187.      return
  188.    end
  189.    #------------------------------
  190.    # 按下 F 键的情况下
  191.    #------------------------------
  192.    if Kboard.keyboard($R_Key_T)
  193.      for a in $game_party.actors
  194.        if a.inputable?
  195.          a.current_action.kind = 0
  196.          a.current_action.basic = 0
  197.          a.current_action.target_index = 0
  198.        end
  199.      end
  200.      # 演奏确定 SE
  201.      $game_system.se_play($data_system.decision_se)
  202.      start_phase4
  203.      return
  204.    end
  205. end
  206. #--------------------------------------------------------------------------
  207. # ● 刷新画面 (角色命令回合 : 基本命令)
  208. #--------------------------------------------------------------------------
  209. def update_phase3_basic_command
  210.    # 按下 B 键的情况下
  211.    if Input.trigger?(Input::B)
  212.      # 演奏取消 SE
  213.      $game_system.se_play($data_system.cancel_se)
  214.      # 转向前一个角色的指令输入
  215.      phase3_prior_actor
  216.      return
  217.    end
  218.    # 按下 C 键的情况下
  219.    if Input.trigger?(Input::C)
  220.      # 角色指令窗口光标位置分之
  221.      case @actor_command_window.index
  222.      when 0  # 攻击
  223.        # 演奏确定 SE
  224.        $game_system.se_play($data_system.decision_se)
  225.        # 设置行动
  226.        @active_battler.current_action.kind = 0
  227.        @active_battler.current_action.basic = 0
  228.        # 开始选择敌人
  229.        start_enemy_select
  230.      when 1  # 特技
  231.        # 演奏确定 SE
  232.        $game_system.se_play($data_system.decision_se)
  233.        # 设置行动
  234.        @active_battler.current_action.kind = 1
  235.        # 开始选择特技
  236.        start_skill_select
  237.      when 2  # 防御
  238.        # 演奏确定 SE
  239.        $game_system.se_play($data_system.decision_se)
  240.        # 设置行动
  241.        @active_battler.current_action.kind = 0
  242.        @active_battler.current_action.basic = 1
  243.        # 转向下一位角色的指令输入
  244.        phase3_next_actor
  245.      when 3  # 物品
  246.        # 演奏确定 SE
  247.        $game_system.se_play($data_system.decision_se)
  248.        # 设置行动
  249.        @active_battler.current_action.kind = 2
  250.        # 开始选择物品
  251.        start_item_select
  252.      end
  253.      return
  254.    end
  255.    #------------------------------
  256.    # 按下 T 建的情况下
  257.    #------------------------------
  258.    if Kboard.keyboard($R_Key_T)
  259.      #如果一号开关打开就禁止重复上回合动作
  260.      if $game_switches[1] == true #开关号可以改,把那个1改成你要的开关号
  261.        # 演奏冻结 SE
  262.        $game_system.se_play($data_system.buzzer_se)
  263.        return
  264.      end
  265.      case @active_battler.last_action.kind
  266.      when 0  # 攻击,防御
  267.        #防御
  268.        if @active_battler.last_action.basic == 1
  269.          # 设置行动
  270.          @active_battler.current_action.kind = 0
  271.          @active_battler.current_action.basic = 1
  272.          # 演奏确定 SE
  273.          $game_system.se_play($data_system.decision_se)
  274.          phase3_next_actor
  275.          #攻击
  276.          else
  277.          # 演奏确定 SE
  278.          $game_system.se_play($data_system.decision_se)
  279.          # 设置行动
  280.          @active_battler.current_action.kind = 0
  281.          @active_battler.current_action.basic = 0
  282.          @active_battler.current_action.target_index = @active_battler.last_action.target_index
  283.          phase3_next_actor
  284.        end
  285.      when 1  # 特技
  286.        skill_id = @active_battler.last_action.skill_id
  287.        if @active_battler.skill_learn?(skill_id) and
  288.          @active_battler.skill_can_use?(skill_id)
  289.          # 设置行动
  290.          @active_battler.current_action.kind = 1
  291.          @active_battler.current_action.skill_id = @active_battler.last_action.skill_id
  292.          @active_battler.current_action.target_index = @active_battler.last_action.target_index
  293.          phase3_next_actor
  294.        else
  295.          # 演奏冻结 SE
  296.          $game_system.se_play($data_system.buzzer_se)
  297.        end
  298.      when 2  # 物品
  299.        item_id = @active_battler.last_action.item_id
  300.        if $game_party.item_can_use?(item_id)
  301.          # 设置行动
  302.          @active_battler.current_action.kind = 2
  303.          @active_battler.current_action.item_id = @active_battler.last_action.item_id
  304.          @active_battler.current_action.target_index = @active_battler.last_action.target_index
  305.          # 演奏确定 SE
  306.          $game_system.se_play($data_system.decision_se)
  307.          phase3_next_actor
  308.        else
  309.          # 演奏冻结 SE
  310.          $game_system.se_play($data_system.buzzer_se)
  311.        end
  312.      end
  313.      return
  314.    end
  315.    #------------------------------
  316.    # 按下 R 键的情况下
  317.    #------------------------------
  318.    if Kboard.keyboard($R_Key_R)
  319.      #如果一号开关打开就禁止重复上回合动作
  320.      if $game_switches[1] == true #开关号可以改,把那个1改成你要的开关号
  321.        # 演奏冻结 SE
  322.        $game_system.se_play($data_system.buzzer_se)
  323.        return
  324.      end
  325.      for a in $game_party.actors
  326.        if a.inputable?
  327.          case a.last_action.kind
  328.          when 0  # 攻击,防御
  329.            #防御
  330.            if a.last_action.basic == 1
  331.              # 设置行动
  332.              a.current_action.kind = 0
  333.              a.current_action.basic = 1
  334.              #攻击
  335.              else
  336.              # 设置行动
  337.              a.current_action.kind = 0
  338.              a.current_action.basic = 0
  339.              a.current_action.target_index = a.last_action.target_index
  340.            end
  341.          when 1  # 特技
  342.          skill_id = a.last_action.skill_id
  343.          if a.skill_learn?(skill_id) and  
  344.            a.skill_can_use?(skill_id)
  345.            # 设置行动
  346.            a.current_action.kind = 1
  347.            a.current_action.skill_id = a.last_action.skill_id
  348.            a.current_action.target_index = a.last_action.target_index
  349.          elsif
  350.            # 不能使用就攻击
  351.            if $data_skills[skill_id].scope < 3
  352.              a.current_action.kind = 0
  353.              a.current_action.basic = 0
  354.              a.current_action.target_index = a.last_action.target_index
  355.            else
  356.              a.current_action.kind = 0
  357.              a.current_action.basic = 0
  358.              a.current_action.target_index = 0
  359.            end
  360.          end
  361.          when 2  # 物品
  362.            item_id = a.last_action.item_id
  363.            if $game_party.item_can_use?(item_id)
  364.              # 设置行动
  365.              a.current_action.kind = 2
  366.              a.current_action.item_id = a.last_action.item_id
  367.              a.current_action.target_index = a.last_action.target_index
  368.            else
  369.              # 不能使用就攻击
  370.              a.current_action.kind = 0
  371.              a.current_action.basic = 0
  372.              a.current_action.target_index = 0
  373.            end
  374.          end
  375.        end
  376.        # 角色的明灭效果 OFF
  377.        if a != nil
  378.          a.blink = false
  379.        end
  380.      end
  381.      # 演奏确定 SE
  382.      $game_system.se_play($data_system.decision_se)
  383.      start_phase4
  384.      return
  385.    end
  386.    #------------------------------
  387.    # 按下 F 键的情况下
  388.    #------------------------------
  389.    if Kboard.keyboard($R_Key_F)
  390.      for a in $game_party.actors
  391.        if a.inputable?
  392.          a.current_action.kind = 0
  393.          a.current_action.basic = 0
  394.          a.current_action.target_index = 0
  395.        end
  396.        # 角色的明灭效果 OFF
  397.        if a != nil
  398.          a.blink = false
  399.        end
  400.      end
  401.      # 演奏确定 SE
  402.      $game_system.se_play($data_system.decision_se)
  403.      start_phase4
  404.      return
  405.    end
  406. end
  407. end
  408. #==============================================================================
  409. # 本脚本来自[url]www.66rpg.com[/url],转载和使用请保留此信息  
  410. #==============================================================================
复制代码

评分

参与人数 1星屑 +126 收起 理由
弗雷德 + 126 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
24 小时
注册时间
2013-8-13
帖子
21
3
发表于 2013-8-19 22:55:43 | 只看该作者
改了一下,可以正常使用了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
235
在线时间
3 小时
注册时间
2013-8-16
帖子
2
4
 楼主| 发表于 2013-8-20 09:23:20 | 只看该作者
ljwlove1995 发表于 2013-8-19 22:55
改了一下,可以正常使用了

谢谢,问题已经解决。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-29 21:29

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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