| 赞 | 14  | 
 
| VIP | 0 | 
 
| 好人卡 | 4 | 
 
| 积分 | 24 | 
 
| 经验 | 30333 | 
 
| 最后登录 | 2024-3-12 | 
 
| 在线时间 | 912 小时 | 
 
 
 
 
 
Lv3.寻梦者 
	- 梦石
 - 0 
 
        - 星屑
 - 2399 
 
        - 在线时间
 - 912 小时
 
        - 注册时间
 - 2014-10-14
 
        - 帖子
 - 1331
 
 
  
 
 | 
	
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员  
 
x
 
 本帖最后由 j296196585 于 2017-8-11 03:00 编辑  
 
我用‘桜雅’的即时横版战斗系统时发现这个范本是以三名同伴为基础设定的,因此战斗时的坐标也是按3个人物定的吧?我设定了四个人物,如果一起出战的话胜利退出后,在遇到第2次战斗时就会显示脚本'fullcbs part-11'的第88行错误:undefined method`-'for nil:NilClass,进脚本后发现88行(红色字)所在的部分如下: 
#-------------------------------------------------------------------------- 
  # ● バトル画面 X 座標の取得 
  #-------------------------------------------------------------------------- 
  def screen_x 
    # パーティ内の並び順から X 座標を計算して返す 
    if self.index != nil 
      if @actor_in_battlefield 
        $xcam_x = 0 if $xcam_x == nil 
        return 96 + 32 - @field_x_offset + (@x_pos - $xcam_x) * @zoom     
      else 
        return self.index * 160 + 80 
      end 
    else 
      return 0 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● バトル画面 Y 座標の取得 
  #-------------------------------------------------------------------------- 
  def screen_y 
    if @actor_in_battlefield 
      $xcam_y = 0 if $xcam_y == nil 
return 96 + 32 - @field_x_offset + (@x_pos - $xcam_x) * @zoom   
 
    else 
      return 464 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● バトル画面 Z 座標の取得 
  #-------------------------------------------------------------------------- 
  def screen_z 
    index = $game_party.actors.reverse.index(self) 
    return @z_pos + (index == nil ? 0 : index) 
  end 
end 
 
 
请问该改成多少才能使4个同伴战斗时不会再出错呢? |   
 
 
 
 |