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
######################################################################
when 2
if Game_Switches[11]==off
then move_down
else move_up
end
when 4
if Game_Switches[12]==off
then move_left
else move_right
end
when 6
if Game_Switches[13]==off
then move_right
else move_left
end
when 8
if Game_Switches[14]==off
then move_up
else move_down
end
end
end
######################################################################
复制代码
# 本地变量记忆坐标 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