| 赞 | 300 |
| VIP | |
| 好人卡 | |
| 积分 | 242 |
| 经验 | |
| 最后登录 | 2026-10-3 |
| 在线时间 | 9564 小时 |
- 梦石
- 1
- 星屑
- 23241
- 在线时间
- 9564 小时
- 注册时间
- 2012-6-19
- 回帖
- 7018
 
|
发表于 2014-6-17 17:16:44
|
显示全部楼层
本帖最后由 喵呜喵5 于 2014-6-17 17:26 编辑
说明脚本插入到main以上,然后按照脚本开头的设置执行事件内容
截图
脚本- =begin
- ===============================================================================
- 共同移动 By喵呜喵5
- ===============================================================================
- 【说明】
-
- 在事件中的脚本编辑器里输入
-
- movetog(1,2,3)
-
- 1,2,3换成地图事件的ID,用英文逗号隔开,数量不限
-
- 接着按方向键时指定ID的事件就会跟着玩家的操作一起移动
-
- =end
- $m5script = {} if $m5script.nil?
- $m5script["M5MoveTogether"] = true
- module M5MoveTogether
- #==============================================================================
- # 设定部分
- #==============================================================================
-
- VAR = 1
-
- #这里设置一个变量的ID,在游戏中请不要随意修改这个ID对应的变量
-
-
- #==============================================================================
- # 脚本部分
- #==============================================================================
- end
- class Game_Interpreter
- def movetog(*eve)
- $game_variables[M5MoveTogether::VAR] = eve.clone
- end
- end
- class Game_Event
- def movable?
- return false if moving?
- return false if $game_message.busy? || $game_message.visible
- return true
- end
- end
- class Game_Player
- alias m5_20140617_move_by_input move_by_input
- def move_by_input
- m5_20140617_move_by_input
- return unless $game_variables[M5MoveTogether::VAR].is_a?(Array)
- return if $game_map.interpreter.running?
- return unless Input.dir4 > 0
- $game_variables[M5MoveTogether::VAR].each do |id|
- next unless $game_map.events[id]
- next unless $game_map.events[id].movable?
- $game_map.events[id].move_straight(Input.dir4)
- end
- end
- end
复制代码 |
评分
-
查看全部评分
|