以下脚本添加在Scene_Map的def update下,用来判断当事件的坐标变量重合并且按S键就执行相应的公共事件,但是在游戏中并没有执行相应的公共事件。
但是把if Input.trigger?(Input::Y)这个条件判断去除就可以执行i号公共事件了,为什么 if Input.trigger?(Input::Y) 这个判断不能添加?
for i in 1..20
if $game_variables[9] == $game_variables[i*2+199] and $game_variables[10] == $game_variables[i*2+200]
if Input.trigger?(Input::Y)
$game_variables[5] = i
$game_temp.common_event_id = i
break
end
end
end
if Input.trigger?(Input::Y)
for i in 1..20
if $game_variables[9] == $game_variables[i*2+199] and $game_variables[10] == $game_variables[i*2+200]
$game_variables[5] = i
$game_temp.common_event_id = i
break
end
end
end
----------------------------------------------------------
这样呢?
if Input.trigger?(Input::Y)
for i in 1..20
if $game_variables[9] == $game_variables and $game_variables[10] == $game_variables
$game_variables[5] = i
$game_temp.common_event_id = i
b ...
猫哥哥 发表于 2009-7-7 17:36