幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
12
返回列表 发新帖
楼主: 幻耶

[已解决] 有什么简便的写法么?

[复制链接]

550

主题

9116

帖子

214748万

积分

超级版主

如同神一般的存在,腿神!拖后腿的神~~

Rank: 8Rank: 8

积分
2147483647
发表于 2010-1-13 09:34:10 | 显示全部楼层
这次的改动,

经测试没有问题。。。
我就是你们的神,庶民们,追随我吧!跟着我一起拖后腿!
回复 支持 反对

使用道具 举报

40

主题

190

帖子

1635

积分

⑥精研

●~  ●~   ●

积分
1635
 楼主| 发表于 2010-1-13 10:50:13 | 显示全部楼层
似乎穿透发动结束以后,敌人事件就全可以被穿透了,能不能穿透结束以后1~20号事件再回到不穿透的状态?

本帖子中包含更多资源

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

x
回复 支持 反对

使用道具 举报

40

主题

190

帖子

1635

积分

⑥精研

●~  ●~   ●

积分
1635
 楼主| 发表于 2010-1-13 10:56:05 | 显示全部楼层
原脚本是这样的

class Game_Player
  attr_accessor :move_speed
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias old_update update
  def update
    unless $game_system.map_interpreter.running? or
      @move_route_forcing or $game_temp.message_window_showing
      if Kboard.trigger?($R_Key_D)
        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)
          for i in 1..20
            x  = $game_variables[7]
            y  = $game_variables[8]
            x1 = $game_map.events.x - x
            y1 = $game_map.events.y - y
            d = $game_player.direction
            new_x = (d == 6 ? 6 : d == 4 ? -6 : 0)
            new_y = (d == 2 ? 6 : d == 8 ? -6 : 0)
            if (x1 <= 0 && x1 >= new_x && y1 <= 0 && y1 >= new_y) ||
              (x1 >= 0 && x1 <= new_x && y1 >= 0 && y1 <= new_y)
              $game_map.events.through = true
            else
            $game_map.events.through = false
            end
          end
          @character_name_run = @character_name
          @character_name = @character_name
          Audio.se_play("Audio/SE/"+"013-Move01",80,100)
          $game_temp.common_event_id = 50
        end
      else
        for i in 1..20
          $game_self_switches[[$game_map.map_id,i,"E"]] = false
        end
        if @move_speed != $game_party.actors[0].agi/300.0 + $game_party.actors[0].dex/600.0 + 2.5
          @move_speed = $game_party.actors[0].agi/300.0 + $game_party.actors[0].dex/600.0 + 2.5
          @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
  def refresh_start
    @character_name_run = @character_name
  end
end
回复 支持 反对

使用道具 举报

550

主题

9116

帖子

214748万

积分

超级版主

如同神一般的存在,腿神!拖后腿的神~~

Rank: 8Rank: 8

积分
2147483647
发表于 2010-1-13 10:56:06 | 显示全部楼层
在这段脚本前面加上个
  1.   for i in 1..20
  2.     $game_map.events[i].through = false
  3.   end
复制代码
我就是你们的神,庶民们,追随我吧!跟着我一起拖后腿!
回复 支持 反对

使用道具 举报

40

主题

190

帖子

1635

积分

⑥精研

●~  ●~   ●

积分
1635
 楼主| 发表于 2010-1-13 11:08:27 | 显示全部楼层
加这儿没用,穿完就一直可以穿透了

class Game_Player
  attr_accessor :move_speed
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias old_update update
  def update

    unless $game_system.map_interpreter.running? or
      @move_route_forcing or $game_temp.message_window_showing
      if Kboard.trigger?($R_Key_D)
        
for i in 1..20
  $game_map.events.through = false
end

        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)
          for i in 1..20
            x  = $game_variables[7]
            y  = $game_variables[8]
            x1 = $game_map.events.x - x
            y1 = $game_map.events.y - y
            d = $game_player.direction
            new_x = (d == 6 ? 6 : d == 4 ? -6 : 0)
            new_y = (d == 2 ? 6 : d == 8 ? -6 : 0)
            if (x1 <= 0 && x1 >= new_x && y1 <= 0 &&
。。。。。。。。
。。。。。。。。。。。。。。
。。。。
回复 支持 反对

使用道具 举报

40

主题

190

帖子

1635

积分

⑥精研

●~  ●~   ●

积分
1635
 楼主| 发表于 2010-1-13 11:18:34 | 显示全部楼层
我是希望,那个50号公共事件执行完,就关闭穿透。。


可以了,我把这脚本放在50号公共事件的末尾就可以了
  for i in 1..20
    $game_map.events.through = false
  end
回复 支持 反对

使用道具 举报

40

主题

190

帖子

1635

积分

⑥精研

●~  ●~   ●

积分
1635
 楼主| 发表于 2010-1-13 11:26:36 | 显示全部楼层
但是用through 的话,有时侯敌人事件会跑到不可通行的图元上去,用独立开关E好像没这问题问题
回复 支持 反对

使用道具 举报

550

主题

9116

帖子

214748万

积分

超级版主

如同神一般的存在,腿神!拖后腿的神~~

Rank: 8Rank: 8

积分
2147483647
发表于 2010-1-13 12:35:54 | 显示全部楼层
都一样吧。。。都是控制@through
我就是你们的神,庶民们,追随我吧!跟着我一起拖后腿!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2024-5-16 00:39 , Processed in 0.027171 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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