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

Project1

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

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

 关闭 [复制链接]

Lv4.逐梦者

梦石
3
星屑
6420
在线时间
1131 小时
注册时间
2007-12-26
帖子
2402
跳转到指定楼层
1
发表于 2009-10-23 13:55:12 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我希望当按下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
囡囚囨囚囨図囨囧

Lv1.梦旅人

梦石
0
星屑
60
在线时间
61 小时
注册时间
2006-9-15
帖子
946
2
发表于 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  那个  改小点
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
3
星屑
6420
在线时间
1131 小时
注册时间
2007-12-26
帖子
2402
3
 楼主| 发表于 2009-10-24 00:53:27 | 只看该作者
class Game_Player
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alia ...
secondsen 发表于 2009-10-23 20:34



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

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
60
在线时间
61 小时
注册时间
2006-9-15
帖子
946
4
发表于 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
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-20 20:12

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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