Nagi wrote: $game_variables[1] = ($game_actors[1].next_level_exp - $game_actors[1].exp) Thử thay bằng kiểu này coi sao, rồi lấy nó ra từ variable 1. :huhu: :huhu:
slucis7593 wrote: Nagi wrote: $game_variables[1] = ($game_actors[1].next_level_exp - $game_actors[1].exp) Thử thay bằng kiểu này coi sao, rồi lấy nó ra từ variable 1. :huhu: :huhu: Đúng là = 50 đó bạn, không phải 112 - 50 đâu mà là 50 - 0
Số_lần_lặp = 3 for i in 0...Số_lần_lặp #0,1,2 msgbox i #Hiện 3 lần end
$game_party.members[0].weapons[0].id
Comments
Đúng là = 50 đó bạn, không phải 112 - 50 đâu mà là 50 - 0
Ví dụ như bên Game Maker thì mình vẫn dùng
[php]
repeat(n)
{
// Câu lệnh
}
[/php]
Và hỏi thêm một cái là lệnh "for" ở ruby xài như nào ? Thấy mấy chỗ mà họ xài hơi khó hiểu.
For i in j
Câu lệnh
End
Đoạn " i in j " thì chẳng hiểu gì ^^
Lại @death :D
Cách dùng câu lệnh for trong ruby
Ví dụ lặp lại n lần một hành động Action_1
Câu hỏi 2 :
Truy vấn ID của weapopn mà $game_party.members[0] đang cầm.
@death
2.
Làm sao để lấy index icon của 1 item ?
[php]class Window_Command_Custom< Window_Command
def make_command_list
add_command("Line 1", :Line1)
add_command("Line 2", :Line2)
add_command("Line 3", :Line3)
add_command("---Exit---", :Exit)
end
end
class Scene_Custom < Scene_MenuBase
def start
super
create_background
create_window
draw_pet_info
end
def create_window
@mycad = Window_Command_Custom.new(32,32)
@mycad.set_handler( :Line1 , method(:Action1))
@mycad.set_handler( :Line2 , method(:Action2))
@mycad.set_handler( :Line3 , method(:Action3))
@mycad.set_handler( :Exit , method(:Action_exit))
end
def Action1
# Action here
@mycad.active = false
end
def Action_exit
SceneManager.return
end
end[/php]
Giờ muốn Line 2 bị xám ngoét :D và ko chọn được (Tức là unselectable ) thì làm sao nhỉ ?
Nó chỉ unselectable khi biến Variable[1] == true chẳng hạn
Not workin , @death
mới đúng :-ss