Project1

标题: Game_Player里我改的一段脚本,各位看看错在哪 [打印本页]

作者: lxczzzcxl    时间: 2008-8-10 19:06
标题: Game_Player里我改的一段脚本,各位看看错在哪
  #--------------------------------------------------------------------------
  # ● 画面更新
  #--------------------------------------------------------------------------
  def update
    # 本地变量记录移动信息
    last_moving = moving?
    # 移动中、事件执行中、强制移动路线中、
    # 信息窗口一个也不显示的时候
    unless moving? or $game_system.map_interpreter.running? or
           @move_route_forcing or $game_temp.message_window_showing
      # 如果方向键被按下、主角就朝那个方向移动
      case Input.dir4
  1. ######################################################################
  2.       when 2
  3.         if Game_Switches[11]==off
  4.           then move_down
  5.         else move_up
  6.           end
  7.       when 4
  8.         if Game_Switches[12]==off
  9.           then move_left
  10.         else move_right
  11.           end
  12.       when 6
  13.         if Game_Switches[13]==off
  14.           then move_right
  15.         else move_left
  16.           end
  17.       when 8
  18.         if Game_Switches[14]==off
  19.           then move_up
  20.         else move_down
  21.           end
  22.       end
  23.     end
  24. ######################################################################
复制代码

    # 本地变量记忆坐标    last_real_x = @real_x
    last_real_y = @real_y
    super
    # 角色向下移动、画面上的位置在中央下方的情况下
    if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
      # 画面向下卷动
      $game_map.scroll_down(@real_y - last_real_y)
    end
    # 角色向左移动、画面上的位置在中央左方的情况下
    if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
      # 画面向左卷动
      $game_map.scroll_left(last_real_x - @real_x)
    end
    # 角色向右移动、画面上的位置在中央右方的情况下
    if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
      # 画面向右卷动
      $game_map.scroll_right(@real_x - last_real_x)
    end
    # 角色向上移动、画面上的位置在中央上方的情况下
    if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
      # 画面向上卷动
      $game_map.scroll_up(last_real_y - @real_y)
    end
    # 不在移动中的情况下
    unless moving?
      # 上次主角移动中的情况
      if last_moving
        # 与同位置的事件接触就判定为事件启动
        result = check_event_trigger_here([1,2])
        # 没有可以启动的事件的情况下
        if result == false
          # 调试模式为 ON 并且按下 CTRL 键的情况下除外
          unless $DEBUG and Input.press?(Input::CTRL)
            # 遇敌计数下降
            if @encounter_count > 0
              @encounter_count -= 1
            end
          end
        end
      end
      # 按下 C 键的情况下
      if Input.trigger?(Input::C)
        # 判定为同位置以及正面的事件启动
        check_event_trigger_here([0])
        check_event_trigger_there([0,1,2])
      end
    end
  end
end [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: 关重7    时间: 2008-8-10 19:09
出了什么错
作者: lxczzzcxl    时间: 2008-8-10 19:30
无法移动了,一移动就提示脚本错误
作者: 关重7    时间: 2008-8-10 19:31
问版主吧,(话说俺也是一个新手)PAI
作者: dbshy    时间: 2008-8-10 19:32
Game_Switches
改为
$game_switches [LINE]1,#dddddd[/LINE]系统信息:本贴获得楼主认可,66RPG感谢您的热情解答~
作者: lxczzzcxl    时间: 2008-8-10 19:36
话说还有错......不过原来那个错被改正了{/fd}
作者: dbshy    时间: 2008-8-10 19:38
以下引用lxczzzcxl于2008-8-10 11:36:20的发言:

话说还有错......不过原来那个错被改正了


$game_switches[id] = true or false

不能是OFF [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: lxczzzcxl    时间: 2008-8-11 01:55
改好了你看看:
http://rpg.blue/upload_program/f ... 手脚_98819505.rar




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1