以下引用kissye于2008-8-15 19:15:55的发言:
不可以
member不是变量,而是一个方法
#--------------------------------------------------------------------------
# ● 获取队员
#--------------------------------------------------------------------------
def members
result = []
for i in @actors#这个变量才是关键
result.push($game_actors)
end
return result
end
正确的做法是先将@actors变量变为可读写变量,即添上
attr_accessor :actors
然后在需要更改的地方写上
@changer = $game_party.actors[0]
$game_party.actors[0] = $game_party.actors[1]
$game_party.actors[1] = @changer
$game_player.refresh
或者直接在Game_Party里添加一个更换队员位置的方法,那就不用将@actors变量改成可读写了.例如
def changeplayer(m1, m2)
@changer = @actors[m1]
@actors[m1] = @actors[m2]
@actors = @changer
$game_player.refresh
end
[本贴由作者于 2008-8-15 19:17:16 最后编辑]
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |