查看: 1264|回复: 3

[已经解决] 关于残影效果脚本的修改

  [复制链接]
梦石
3
星屑
6420
在线时间
1131 小时
注册时间
2007-12-26
回帖
914
发表于 2009-10-23 13:55:12 | 显示全部楼层 |阅读模式

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

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

×
我希望当按下SHIFT键,角色按照自己当前的朝向,自动以速度6前冲5格距离,当遇到不可通行的障碍或者事件就停止前冲。如何修改这个脚本?

出处:http://rpg.blue/htm/Topic_30761.htm

class Game_Player
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias old_update update
  def update
    unless $game_system.map_interpreter.running? or
      @move_route_forcing or $game_temp.message_window_showing
      if Input.press?(Input::SHIFT)
        if moving?
          if @move_speed != 5
            @move_speed = 5
            @character_name_run = @character_name
            @character_name = @character_name + "run"
            Audio.se_play("Audio/SE/"+"013-Move01",80,100)
          end
        end
      else
        if @move_speed != 4
          @move_speed = 4
          @character_name = @character_name_run
        end
      end  
    end
    old_update
  end
end
囡囚囨囚囨図囨囧
梦石
0
星屑
60
在线时间
61 小时
注册时间
2006-9-15
回帖
864
发表于 2009-10-23 20:34:01 | 显示全部楼层
class Game_Player
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias old_update update
  def update
    unless $game_system.map_interpreter.running? or
      @move_route_forcing or $game_temp.message_window_showing
      if Input.press?(Input::SHIFT)
        if moving?
          if @move_speed != 6
            @move_speed = 6
            move_route = RPG::MoveRoute.new
            move_route.repeat = false
            move_route.list.clear
            move_command = RPG::MoveCommand.new
            move_command.code = @direction / 2
            5.times{move_route.list.push(move_command.clone)}
            move_command.code = 0
            move_route.list.push(move_command)
            force_move_route(move_route)
            @character_name_run = @character_name
            @character_name = @character_name + "run"
            Audio.se_play("Audio/SE/"+"013-Move01",80,100)
          end
        end
      else
        if @move_speed != 4
          @move_speed = 4
          @character_name = @character_name_run
        end
      end  
    end
    old_update
  end
end



如果觉得5格太多  可以把  5.times  那个  改小点
回复

使用道具 举报

梦石
3
星屑
6420
在线时间
1131 小时
注册时间
2007-12-26
回帖
914
 楼主| 发表于 2009-10-24 00:53:27 | 显示全部楼层
class Game_Player
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alia ...
secondsen 发表于 2009-10-23 20:34



用这个脚本运行,角色冲到障碍前停住就再也不能动了!而且我希望按一个键角色就自动前冲,不用按方向键移动
囡囚囨囚囨図囨囧
回复

使用道具 举报

梦石
0
星屑
60
在线时间
61 小时
注册时间
2006-9-15
回帖
864
发表于 2009-10-24 01:52:15 | 显示全部楼层
class Game_Player
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias old_update update
  def update
    unless $game_system.map_interpreter.running? or
      @move_route_forcing or $game_temp.message_window_showing
      if Input.press?(Input::SHIFT)
        if @move_speed != 6
          @move_speed = 6
          move_route = RPG::MoveRoute.new
          move_route.repeat = false
          move_route.list.clear
          move_command = RPG::MoveCommand.new
          move_command.code = @direction / 2
          5.times{move_route.list.push(move_command.clone)}
          move_command.code = 0
          move_route.list.push(move_command)
          force_move_route(move_route)
          @character_name_run = @character_name
          @character_name = @character_name + "run"
          Audio.se_play("Audio/SE/"+"013-Move01",80,100)
        end
      else
        if @move_speed != 4
          @move_speed = 4
          @character_name = @character_name_run
        end
      end  
    end
    old_update
    if @move_route_forcing
      if not @move_route.skippable and not moving? and not jumping?
        @move_route_index = @move_route.list.size - 1
        return
      end
    end
  end
end
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部